mozilla

Revision 49529 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: 49529
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 196 words added, 243 words removed
Tags: 

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

Requesting https://services.addons.mozilla.org/en-US/firefox/api/1.3/addon/1865 returns the information for addon 1865, Adblock Plus:

[sample]

search

Returns add-ons that match a specified search term. This uses the same search engine as the rest of the site, so only exact matches are supported. The returned searchresults element has up to 10 addon elements describing each individual search result.

Prototype

https://services.addons.mozilla.org/api/[version]/search/[searchterm]/[optional:searchtype]/[optional:maxresults]/[optional:search_os /[optional:search_version]

Parameters

searchterm
The term to match.
searchtype
The type of results to return. The default, all, requests that only matching extensions and themes be considered. You may also specify extension, theme, plugin, dictionary, or searchengine.
maxresults
The maximum number of results to return. This is pegged to no more than 10; specifying a larger number will still return no more than 10 results. The total number of available results will be returned in the total_results attribute of the searchresults element. For example:
<searchresults total_results="196">
search_os
Specifies the operating system for which to return results; only add-ons compatible with the specified operating system will be returned. The default value is all; other possible values are winnt, darwin, and linux.
search_version
Specifies the application version with which the returned add-ons must be compatible.
Example return data:
      [sample]
      

Examples

https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/popup

Searches for add-ons matching "popup".

https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/nasa/theme

Searches for themes matching "nasa".

https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/blue/all/10/WINNT/3

Searches for add-ons of any type that match "blue", returning no more than 10 results. Only add-ons that are compatible with the Windows version of Firefox 3 are considered.

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> <dt>id</dt> <dd>The id of the desired add-on, as per AMO.</dd>
</dl>
<h4>Example</h4>
<p>Requesting <code><span class="nowiki">https://services.addons.mozilla.org/en-US/firefox/api/1.3/addon/1865</span></code> returns the information for addon 1865, Adblock Plus:</p>
<pre>[sample]
</pre><h3>search</h3>
<p>Returns add-ons that match a specified search term. This uses the same search engine as the rest of the site, so only exact matches are supported. The returned <code>searchresults</code> element has up to 10 <code>addon</code> elements describing each individual search result.</p>
<h4>Prototype</h4>
<p><code><span class="nowiki">https://services.<span id="1251316501779S" style="display: none;"> </span>addons.mozilla.org/api/[version]/search/[searchterm]/[optional:searchtype]/[optional:maxresults]/[optional:search_os /[optional:search_version]</span></code></p>
<h4>Parameters</h4>
<dl> <dt>searchterm</dt> <dd>The term to match.</dd> <dt>searchtype</dt> <dd>The type of results to return. The default, <code>all</code>, requests that only matching extensions and themes be considered. You may also specify <code>extension</code>, <code>theme</code>, <code>plugin</code>, <code>dictionary</code>, or <code>searchengine</code>.</dd> <dt>maxresults</dt> <dd>The maximum number of results to return. This is pegged to no more than 10; specifying a larger number will still return no more than 10 results. The total number of available results will be returned in the <code>total_results</code> attribute of the <code>searchresults</code> element. For example:</dd> <dd> <pre>&lt;searchresults total_results="196"&gt;</pre> </dd> <dt>search_os</dt> <dd>Specifies the operating system for which to return results; only add-ons compatible with the specified operating system will be returned. The default value is <code>all</code>; other possible values are <code>winnt</code>, <code>darwin</code>, and <code>linux</code>.</dd> <dt>search_version</dt> <dd>Specifies the application version with which the returned add-ons must be compatible.</dd> <dt>Example return data:</dt> <dd> <pre>      [sample]
      </pre> </dd>
</dl>
<h4>Examples</h4>
<pre><span class="plain">https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/popup</span>
</pre>
<p>Searches for add-ons matching "popup".</p>
<pre><span class="plain">https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/nasa/theme</span>
</pre>
<p>Searches for themes matching "nasa".</p>
<pre><span class="plain">https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/blue/all/10/WINNT/3</span>
</pre>
<p>Searches for add-ons of any type that match "blue", returning no more than 10 results. Only add-ons that are compatible with the Windows version of Firefox 3 are considered.</p><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