Revision 130847 of addons.mozilla.org (AMO) API Developers' Guide

  • Revision slug: addons.mozilla.org_(AMO)_API_Developers'_Guide
  • Revision title: addons.mozilla.org (AMO) API Developers' Guide
  • Revision id: 130847
  • Created:
  • Creator: laurathomson
  • Is current revision? No
  • Comment 4 words added, 6 words removed
Tags: 

Revision Content

Introduction

The AMO API provides an interface to AMO for your web or other applications.  The API supports REST and responses are returned in XML format.

Currently there are two components to the API:

The generic AMO API
This is the set of API calls used by the Firefox Add-ons manager.  It is currently read only.  It allows you to retrieve data about a single addon, groups of addons, or to search addons.  This API does notrequire authentication or an API key for use.
The Bandwagon API
The Bandwagon API allows you to interact with Add-ons Collections.  This is a read/write API.  It requires authentication using your existing AMO account.

Terms of Use

[link]

The generic AMO API

URL Format

API calls are served via
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 unexepcted behavior, so be sure to specify the current API version. The current API version is 1.3.

All API calls only return public addons at present.

Available Methods

addon

Prototype
https://services.addons.mozilla.org/api/[version]/addon/[id]
Purpose
Returns details of the add-on identified by [id].
Parameters
id
the id of the desired add-on, as per AMO
Example invocation
Requesting https://services.addons.mozilla.org/...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 addons 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, e.g.
<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', ''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/...3/search/popup
Search for add-ons matching "popup"

https://services.addons.mozilla.org/...rch/nasa/theme
Search for themes matching "nasa"

https://services.addons.mozilla.org/...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:

Example return data:

cumulative_downloads

This API call is currently disabled.

update_pings

This API call is currently disabled.

Revision Source

<h2>Introduction</h2>
<p>The AMO API provides an interface to AMO for your web or other applications.  The API supports REST and responses are returned in XML format.</p>
<p>Currently there are two components to the API:</p>
<dl> <dt>The generic AMO API</dt> <dd>This is the set of API calls used by the Firefox Add-ons manager.  It is currently read only.  It allows you to retrieve data about a single addon, groups of addons, or to search addons.  This API does notrequire authentication or an API key for use.</dd> <dt>The Bandwagon API</dt> <dd>The Bandwagon API allows you to interact with Add-ons Collections.  This is a read/write API.  It requires authentication using your existing AMO account.</dd>
</dl>
<h2>Terms of Use</h2>
<p>[link]</p>
<h2>The generic AMO API</h2>
<h3>URL Format</h3>
<p>API calls are served via<br>
<a class=" link-https" href="https://services.addons.mozilla.org/api/" rel="freelink">https://services.addons.mozilla.org/api/</a></p>
<p>You may localize the returned content by adding a locale string to this URL as follows:<br>
<a class=" external" href="http://services.addons.mozilla.org/" rel="freelink">http://services.addons.mozilla.org/</a>[locale]/api</p>
<p>For example<br>
<a class=" link-https" href="https://services.addons.mozilla.org/en-US/api" rel="freelink">https://services.addons.mozilla.org/en-US/api</a><br>
<a class=" link-https" href="https://services.addons.mozilla.org/de/api" rel="freelink">https://services.addons.mozilla.org/de/api</a></p>
<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 unexepcted 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 addons at present.</p>
<h3>Available Methods</h3>
<h4>addon</h4>
<dl> <dt>Prototype</dt> <dd><a class=" link-https" href="https://services.addons.mozilla.org/api/" rel="freelink">https://services.addons.mozilla.org/api/</a>[version]/addon/[id]</dd> <dt>Purpose</dt> <dd>Returns details of the add-on identified by [id].</dd> <dt>Parameters</dt> <dd> <dl> <dt>id</dt> <dd>the id of the desired add-on, as per AMO</dd> </dl> </dd> <dt>Example invocation</dt> <dd>Requesting <a class=" link-https" href="https://services.addons.mozilla.org/en-US/firefox/api/1.3/addon/1865" rel="freelink">https://services.addons.mozilla.org/...1.3/addon/1865</a><br> returns the information for addon 1865, Adblock Plus</dd> <dt>Example return data:</dt> <dd> <pre>        [sample]
      </pre> </dd>
</dl><h4>search</h4>
<dl> <dt>Prototype</dt> <dd><a class=" link-https" href="https://services.addons.mozilla.org/api/" rel="freelink">https://services.addons.mozilla.org/api/</a>[version]/search/[searchterm]/[optional:searchtype]/[optional:maxresults]/[optional:search_os /[optional:search_version]</dd> <dt>Purpose</dt> <dd>Returns addons 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, e.g.<br> &lt;searchresults total_results="196"&gt;<br> Within the searchresults 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', ''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><a class=" link-https" href="https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/popup" rel="freelink">https://services.addons.mozilla.org/...3/search/popup</a><br> Search for add-ons matching "popup"<br> <br> <a class=" link-https" href="https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/nasa/theme" rel="freelink">https://services.addons.mozilla.org/...rch/nasa/theme</a><br> Search for themes matching "nasa"<br> <br> <a class=" link-https" href="https://services.addons.mozilla.org/en-US/firefox/api/1.3/search/blue/all/10/WINNT/3" rel="freelink">https://services.addons.mozilla.org/...all/10/WINNT/3</a><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><h4>list</h4> <p>Prototype:<br> <a class=" link-https" href="https://services.addons.mozilla.org/api/" rel="freelink">https://services.addons.mozilla.org/api/</a>[version]/list/[optional:listtype]/[optional:addontype]/[optional:number]/[optional:list_os]/[optional:list_version]<br> <br> Purpose:<br> Returns a random order and selection list of addons.<br> Note that a maximum of 10 results will be returned.<br> <br> Parameters:<br> 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.<br> addontype -  Type of add os to return. Default is 'all'.  Possible values are 'all', 'extension', 'theme', 'plugin', 'dictionary', 'searchengine'.<br> number - The maximum number of results to return.  Default is 3.<br> list_os - Return addons matching the specified OS.  Possible values are 'all', 'winnt', 'darwin', 'linux'.<br> list_version - Return results that match the specified application version.<br> <br> Example invocations:<br> <br> Example return data:</p> <h4>cumulative_downloads</h4> <p>This API call is currently disabled.</p> <h4>update_pings</h4> <p>This API call is currently disabled.</p>
Revert to this revision