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: 49532
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment clean up list command formatting; 148 words added, 111 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

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

See the output from this request.

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.

Examples

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

Searches for add-ons matching "popup". See the output from this request.

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

Searches for themes matching "nasa". See the output from this request.

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.

See the output from this request.

list

Returns a randomly ordered and selected list of add-ons.

Prototype

https://services.addons.mozilla.org/api/[version]/list/[optional:listtype]/[optional:addontype]/[optional:number]/[optional:list_os]/[optional:list_version]

Parameters

listtype
The type of list to return. The default is recommended; the only other possible value is new. Recommended add-ons are those recommended by AMO editors, while new add-ons are those posted in the last ten days.
addontype
The types of add-on to return. The default value is all, but you may specify extension, theme, plugin, directory, or searchengine.
number
The maximum number of results to return; the default value is 3. This value is capped at 10; if you specify a higher value than 10, no more than ten results are returned.
list_os
The operating system for which compatible add-ons should be returned. By default, this is all. You may also specify winnt, darwin, or linux.
list_version
The application version with which the returned add-ons must be compatible.

Example

https://services.addons.mozilla.org/en-US/firefox/api/1.3/list/new/

Returns a list of new add-ons. See the output from this request.

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>
<p><a class="link-https" href="https://services.addons.mozilla.org/en-US/firefox/api/1.3/addon/1865" title="https://services.addons.mozilla.org/en-US/firefox/api/1.3/addon/1865">See the output from this request</a>.</p>
<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>
</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". <a class="link-https" href="https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/popup" title="https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/popup">See the output from this request</a>.</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". <a class="link-https" href="https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/nasa/theme" title="https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/nasa/theme">See the output from this request</a>.</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>
<p><a class="link-https" href="https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/blue/all/10/WINNT/3" title="https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/blue/all/10/WINNT/3">See the output from this request</a>.</p><h3>list</h3>
<p>Returns a randomly ordered and selected list of add-ons.</p>
<h4>Prototype</h4>
<p><code><span class="nowiki">https://services.addons.mozilla.org/api/[version]/list/[optional:listtype]/[optional:addontype]/[optional:number]/[optional:list_os]/[optional:list_version]</span></code></p>
<h4>Parameters</h4>
<dl> <dt>listtype</dt> <dd>The type of list to return. The default is <code>recommended</code>; the only other possible value is <code>new</code>. Recommended add-ons are those recommended by AMO editors, while new add-ons are those posted in the last ten days.</dd> <dt>addontype</dt> <dd>The types of add-on to return. The default value is <code>all</code>, but you may specify <code>extension</code>, <code>theme</code>, <code>plugin</code>, <code>directory</code>, or <code>searchengine</code>.</dd> <dt>number</dt> <dd>The maximum number of results to return; the default value is 3. This value is capped at 10; if you specify a higher value than 10, no more than ten results are returned.</dd> <dt>list_os</dt> <dd>The operating system for which compatible add-ons should be returned. By default, this is <code>all</code>. You may also specify <code>winnt</code>, <code>darwin</code>, or <code>linux</code>.</dd> <dt>list_version</dt> <dd>The application version with which the returned add-ons must be compatible.</dd>
</dl>
<dl> <h4>Example</h4> <pre><span class="plain">https://services.addons.mozilla.org/en-US/firefox/api/1.3/list/new/</span>
</pre> <p>Returns a list of new add-ons. <a class="link-https" href="https://services.addons.mozilla.org/en-US/firefox/api/1.3/list/new/" title="https://services.addons.mozilla.org/en-US/firefox/api/1.3/list/new/">See the output from this request</a>.</p><h3>cumulative_downloads</h3>
<p>This API call is currently disabled.</p>
<h3>update_pings</h3>
<p>This API call is currently disabled.</p></dl>
Revert to this revision