Update:Remora API Docs: Difference between revisions

No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 14: Line 14:
API calls are served via
API calls are served via


  https://services.addons.mozilla.org/api
  https://services.addons.mozilla.org/api/[version]
 
The current API version is [http://svn.mozilla.org/addons/trunk/site/app/controllers/api_controller.php 1.3].


You may localize the returned content by adding a locale string to this URL as follows:
You may localize the returned content by adding a locale string to this URL as follows:
Line 25: Line 27:
==== addon ====
==== addon ====
Invoke as:
Invoke as:
https://services.addons.mozilla.org/api/addon/[id]
https://services.addons.mozilla.org/api/[version]/addon/[id]
Returns details of an addon
Returns details of an addon


==== search  ====
==== search  ====
Invoke as:
Invoke as:
https://services.addons.mozilla.org/api/search/[searchterm]/[optional:searchtype]
https://services.addons.mozilla.org/api/[version]/search/[searchterm]/[optional:searchtype]/[optional:maxresults]


Returns addons that match the searchterm.  Uses the same search engine as  
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
the rest of the site, so only exact match is supported.  The searchtype may be
one of 'extension', 'theme', 'plugin', 'dictionary', 'searchengine'.  If
one of 'extension', 'theme', 'plugin', 'dictionary', 'searchengine'.  If
no searchtype is entered extensions and themes will be returned.
no searchtype is entered, or if searchtype 'all' is entered, extensions and themes will be returned.  The optional maxresults parameter limits the number os results returned.


==== list ====
==== list ====
Invoke as:
Invoke as:
https://services.addons.mozilla.org/api/list/[optional:listtype]/[optional:addontype]/[optional:number]
https://services.addons.mozilla.org/api/[version]/list/[optional:listtype]/[optional:addontype]/[optional:number]


Returns a [randomized] list of addons.
Returns a [randomized] list of addons.
Line 48: Line 50:
==== cumulative_downloads ====
==== cumulative_downloads ====
Invoke as:
Invoke as:
https://services.addons.mozilla.org/api/cumulative_downloads/[id]
https://services.addons.mozilla.org/api/[version]/cumulative_downloads/[id]


Retrieves cumulative downloads for the specified addon.
Retrieves cumulative downloads for the specified addon.
This call is not supported in API version 1.1, although it is implemented.


==== update_pings ====
==== update_pings ====
Invoke as:
Invoke as:
https://services.addons.mozilla.org/api/update_pings/[id]/[optional:period]/[optional:querydate]
https://services.addons.mozilla.org/api/[version]/update_pings/[id]/[optional:period]/[optional:querydate]


Returns update pings for the specified addon.
Returns update pings for the specified addon.
Period may be 'day', 'week', or 'month' and defaults to 'day'.
Period may be 'day', 'week', or 'month' and defaults to 'day'.
Querydate will be the last date in the period you wish to query.  Default is today.  Date format is YYYY-MM-DD.  Invalid dates will default to today.
Querydate will be the last date in the period you wish to query.  Default is today.  Date format is YYYY-MM-DD.  Invalid dates will default to today.
This call is not supported in API version 1.1, although it is implemented.
=== Examples ===
* [https://addons.mozilla.jp/firefox/ Mozilla Japan's add-on library] uses the API to obtain add-ons' metadata. See [[Japan/AMJ]] for details.
Confirmed users
269

edits