mozilla

Revision 49526 of The generic AMO API

  • Revision slug: addons.mozilla.org_(AMO)_API_Developers'_Guide/The_generic_AMO_API
  • Revision title: The generic AMO API
  • Revision id: 49526
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 11 words added, 15 words removed

Revision Content

URL Format

API calls are served by accessing https://services.addons.mozilla.org/api/.

You may localize the returned content by adding a locale string to this URL as follows:

http://services.addons.mozilla.org/[locale]/api

For example:

https://services.addons.mozilla.org/en-US/api
https://services.addons.mozilla.org/de/api

The API is versioned.  For all calls, the first parameter is the API version.  This is optional, and if it is not supplied, the version defaults to 0. This is maintained for compatibility with older versions of Firefox, but may give you some unexpected behavior, so be sure to specify the current API version. The current API version is 1.3.

All API calls only return public add-ons at present.

Available Methods

addon

Returns details of a particular add-on.

Prototype

https://services.addons.mozilla.org/api/[version]/addon/[id]

Parameters

id
The id of the desired add-on, as per AMO.
Example invocation
Requesting https://services.addons.mozilla.org/en-US/firefox/api/1.3/addon/1865 returns the information for addon 1865, Adblock Plus
Example return data:
        [sample]
      

search

Prototype
https://services.addons.mozilla.org/api/[version]/search/[searchterm]/[optional:searchtype]/[optional:maxresults]/[optional:search_os /[optional:search_version]
Purpose
Returns add-ons that match the [searchterm].  Uses the same search engine as the rest of the site, so only exact match is supported.  The searchtype may be one of 'extension', 'theme', 'plugin', 'dictionary', 'searchengine'.  If no searchtype is entered extensions and themes will be returned. Note that a maximum of 10 search results will be returned.  The total number of matching results is specified in the total_results attribute of the searchresults element. For example:
<searchresults total_results="196">
Within the searchresults element there are up to 10 addon elements, with the same structure as for the addon method.
Parameters
searchterm
Term to match
searchtype
Return results of this type.  The default is 'all'.  Possible values are 'all' (which is actually 'extension' plus 'theme', and not actually all types), 'extension', 'theme', 'plugin', 'dictionary', or 'searchengine'.
maxresults
Maximum number of results to return.  Regardless of what is specified, a hard maximum of 10 results will be returned.  If you specify a smaller number, less results will be returned.
search_os
Return results that match the specified operating system.  Default is 'all'.  Possible values are 'all', 'winnt', 'darwin', 'linux'
search_version
Return results that match the specified application version.
Example invocations
https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/popup
Search for add-ons matching "popup"

https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/nasa/theme
Search for themes matching "nasa"

https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/blue/all/10/WINNT/3
Search for add-ons that match "blue" of any type, return a maximum of 10 results, for add-ons that will work on Windows Firefox version 3.
Example return data:
      [sample]
      

list

Prototype:
https://services.addons.mozilla.org/api/[version]/list/[optional:listtype]/[optional:addontype]/[optional:number]/[optional:list_os]/[optional:list_version]
Purpose
Returns a random order and selection list of addons.
Note that a maximum of 10 results will be returned.
Parameters
listtype
The type of list.  Default is 'recommended'.  Possible values are 'recommended' or 'new'.  New addons have been posted in the last ten days.  Recommended addons are from the list recommended by AMO editors.
addontype
Type of add os to return. Default is 'all'.  Possible values are 'all', 'extension', 'theme', 'plugin', 'dictionary', 'searchengine'.
number
The maximum number of results to return.  Default is 3.
list_os
Return addons matching the specified OS. Possible values are 'all', 'winnt', 'darwin', 'linux'.
list_version
Return results that match the specified application version.
Example invocations
https://services.addons.mozilla.org/en-US/firefox/api/1.3/list/new/
Example return data
  [sample]

cumulative_downloads

This API call is currently disabled.

update_pings

This API call is currently disabled.

Revision Source

<h2>URL Format</h2>
<p>API calls are served by accessing <code><span class="nowiki">https://services.addons.mozilla.org/api/</span></code><span class="nowiki">.</span></p>
<p>You may localize the returned content by adding a locale string to this URL as follows:</p>
<pre>http://services.addons.mozilla.org/[locale]/api</pre>
<p>For example:</p>
<pre>https://services.addons.mozilla.org/en-US/api
https://services.addons.mozilla.org/de/api</pre>
<p>The API is versioned.  For all calls, the first parameter is the API version.  This is optional, and if it is not supplied, the version defaults to 0. This is maintained for compatibility with older versions of Firefox, but may give you some unexpected behavior, so be sure to specify the current API version. The current API version is 1.3.</p>
<p>All API calls only return public add-ons at present.</p>
<h2>Available Methods</h2>
<h3>addon</h3>
<p>Returns details of a particular add-on.</p>
<h4>Prototype</h4>
<p><code><span class="nowiki">https://services.addons.mozilla.org/api/[version]/addon/[id]</span></code></p>
<h4>Parameters</h4>
<dl> <dd> <dl> <dt>id<span id="1251316212139S" style="display: none;"> </span></dt> <dd>The id of the desired add-on, as per AMO.</dd> </dl> </dd> <dt>Example invoc<span id="1251306976435S" style="display: none;"> </span>ation</dt> <dd>Requesting <span class="nowiki">https://services.addons.mozilla.org/en-US/firefox/api/1.3/addon/1865</span> returns the information for addon 1865, Adblock Plus</dd> <dt>Example return data:</dt> <dd> <pre>        [sample]
      </pre> </dd>
</dl>
<h3>search</h3>
<dl> <dt>Prototype</dt> <dd><span class="nowiki">https://services.addons.mozilla.org/api/[version]/search/[searchterm]/[optional:searchtype]/[optional:maxresults]/[optional:search_os /[optional:search_version]</span></dd> <dt>Purpose</dt> <dd>Returns add-ons that match the <code>[searchterm]</code>.  Uses the same search engine as the rest of the site, so only exact match is supported.  The searchtype may be one of 'extension', 'theme', 'plugin', 'dictionary', 'searchengine'.  If no searchtype is entered extensions and themes will be returned. Note that a maximum of 10 search results will be returned.  The total number of matching results is specified in the <code>total_results</code> attribute of the searchresults element. For example:</dd> <pre>&lt;searchresults total_results="196"&gt;
</pre> <dd>Within the <code>searchresults</code> element there are up to 10 addon elements, with the same structure as for the addon method.</dd> <dt>Parameters</dt> <dd> <dl> <dt>searchterm</dt> <dd>Term to match</dd> <dt>searchtype</dt> <dd>Return results of this type.  The default is 'all'.  Possible values are 'all' (which is actually 'extension' plus 'theme', and not actually all types), 'extension', 'theme', 'plugin', 'dictionary', or 'searchengine'.</dd> <dt>maxresults</dt> <dd>Maximum number of results to return.  Regardless of what is specified, a hard maximum of 10 results will be returned.  If you specify a smaller number, less results will be returned.</dd> <dt>search_os</dt> <dd>Return results that match the specified operating system.  Default is 'all'.  Possible values are 'all', 'winnt', 'darwin', 'linux'</dd> <dt>search_version</dt> <dd>Return results that match the specified application version.</dd> </dl> </dd> <dt>Example invocations</dt> <dd><span class="nowiki">https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/popup</span><br> Search for add-ons matching "popup"<br> <br> <span class="nowiki">https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/nasa/theme</span><br> Search for themes matching "nasa"<br> <br> <span class="nowiki">https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/blue/all/10/WINNT/3</span><br> Search for add-ons that match "blue" of any type, return a maximum of 10 results, for add-ons that will work on Windows Firefox version 3.</dd> <dt>Example return data:</dt> <dd> <pre>      [sample]
      </pre> </dd>
</dl>
<h3>list</h3>
<dl> <dt>Prototype:</dt> <dd><span class="nowiki">https://services.addons.mozilla.org/api/[version]/list/[optional:listtype]/[optional:addontype]/[optional:number]/[optional:list_os]/[optional:list_version]</span></dd> <dt>Purpose</dt> <dd>Returns a random order and selection list of addons.<br> Note that a maximum of 10 results will be returned.</dd> <dt>Parameters</dt> <dd> <dl> <dt>listtype</dt> <dd>The type of list.  Default is 'recommended'.  Possible values are 'recommended' or 'new'.  New addons have been posted in the last ten days.  Recommended addons are from the list recommended by AMO editors.</dd> <dt>addontype</dt> <dd>Type of add os to return. Default is 'all'.  Possible values are 'all', 'extension', 'theme', 'plugin', 'dictionary', 'searchengine'.</dd> <dt>number</dt> <dd>The maximum number of results to return.  Default is 3.</dd> <dt>list_os</dt> <dd>Return addons matching the specified OS. Possible values are 'all', 'winnt', 'darwin', 'linux'.</dd> <dt>list_version</dt> <dd>Return results that match the specified application version.</dd> </dl> </dd> <dt>Example invocations</dt> <dd><span class="nowiki">https://services.addons.mozilla.org/en-US/firefox/api/1.3/list/new/</span></dd> <dt>Example return data</dt> <dd> <pre>  [sample]
</pre> </dd>
</dl>
<h3>cumulative_downloads</h3>
<p>This API call is currently disabled.</p>
<h3>update_pings</h3>
<p>This API call is currently disabled.</p>
Revert to this revision