Skip to content

Wikimedia API

by wikimedia.org

API keyMedia
Open documentation ↗

Overview

This API provides cacheable and straightforward access to Wikimedia content and data, in machine-readable formats. ### Global Rules - Limit your clients to no more than 200 requests/s to this API. Each API endpoint's documentation may detail more specific usage limits. - Set a unique `User-Agent` or `Api-User-Agent` header that allows us to contact you quickly. Email addresses or URLs of contact pages work well. By using this API, you agree to Wikimedia's [Terms of Use](https://wikimediafoundation.org/wiki/Terms_of_Use) and [Privacy Policy](https://wikimediafoundation.org/wiki/Privacy_policy). Unless otherwise specified in the endpoint documentation below, content accessed via this API is licensed under the [CC-BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) and [GFDL](https://www.gnu.org/copyleft/fdl.html) licenses, and you irrevocably agree to release modifications or additions made through this API under these licenses. See https://www.mediawiki.org/wiki/REST_API for background and details. ### Endpoint documentation Please consult each endpoint's documentation for details on: - Licensing information for the specific type of content and data served via the endpoint. - Stability markers to inform you about development status and change policy, according to [our API version policy](https://www.mediawiki.org/wiki/API_versioning). - Endpoint specific usage limits.

Wikimedia is a media API from wikimedia.org. Requests are authenticated with an API key. It is served over plain HTTP. Its OpenAPI description documents 35 endpoints.

At a glance

Authentication
API key
HTTPS
No
CORS
Unknown
Category
Media
Base URL
https://wikimedia.org/api/rest_v1
Version
1.0.0
Endpoints
35
Spec updated
2019-01-03

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://wikimedia.org/api/rest_v1/feed/availability" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
const response = await fetch("https://wikimedia.org/api/rest_v1/feed/availability", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://wikimedia.org/api/rest_v1/feed/availability",
    headers={
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/feed/availabilityGets availability of featured feed content for the apps by wiki domain.
POST/media/math/check/{type}Check and normalize a TeX formula.
GET/media/math/formula/{hash}Get a previously-stored formula
GET/media/math/render/{format}/{hash}Get rendered formula in the given format.
GET/metrics/bytes-difference/absolute/aggregate/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}Get the sum of absolute value of text bytes difference between current edit and previous one.
GET/metrics/bytes-difference/absolute/per-page/{project}/{page-title}/{editor-type}/{granularity}/{start}/{end}Get the sum of absolute text bytes difference per page.
GET/metrics/bytes-difference/net/aggregate/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}Get the sum of net text bytes difference between current edit and previous one.
GET/metrics/bytes-difference/net/per-page/{project}/{page-title}/{editor-type}/{granularity}/{start}/{end}Get the sum of net text bytes difference per page.
GET/metrics/edited-pages/aggregate/{project}/{editor-type}/{page-type}/{activity-level}/{granularity}/{start}/{end}Get edited-pages counts for a project.
GET/metrics/edited-pages/new/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}Get new pages counts for a project.
GET/metrics/edited-pages/top-by-absolute-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}Get top 100 edited-pages by absolute bytes-difference.
GET/metrics/edited-pages/top-by-edits/{project}/{editor-type}/{page-type}/{year}/{month}/{day}Get top 100 edited-pages by edits count.
GET/metrics/edited-pages/top-by-net-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}Get top 100 edited-pages by net bytes-difference.
GET/metrics/editors/aggregate/{project}/{editor-type}/{page-type}/{activity-level}/{granularity}/{start}/{end}Get editors counts for a project.
GET/metrics/editors/top-by-absolute-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}Get top 100 editors by absolute bytes-difference.
GET/metrics/editors/top-by-edits/{project}/{editor-type}/{page-type}/{year}/{month}/{day}Get top 100 editors by edits count.
GET/metrics/editors/top-by-net-bytes-difference/{project}/{editor-type}/{page-type}/{year}/{month}/{day}Get top 100 editors by net bytes-difference.
GET/metrics/edits/aggregate/{project}/{editor-type}/{page-type}/{granularity}/{start}/{end}Get edits counts for a project.
GET/metrics/edits/per-page/{project}/{page-title}/{editor-type}/{granularity}/{start}/{end}Get edit counts for a page in a project.
GET/metrics/legacy/pagecounts/aggregate/{project}/{access-site}/{granularity}/{start}/{end}Given a project and a date range, returns a timeseries of pagecounts.
GET/metrics/pageviews/aggregate/{project}/{access}/{agent}/{granularity}/{start}/{end}Get pageview counts for a project.
GET/metrics/pageviews/per-article/{project}/{access}/{agent}/{article}/{granularity}/{start}/{end}Get pageview counts for a page.
GET/metrics/pageviews/top-by-country/{project}/{access}/{year}/{month}Get pageviews by country and access method.
GET/metrics/pageviews/top/{project}/{access}/{year}/{month}/{day}Get the most viewed articles for a project.
GET/metrics/registered-users/new/{project}/{granularity}/{start}/{end}Get newly registered users counts for a project.
GET/metrics/unique-devices/{project}/{access-site}/{granularity}/{start}/{end}Get unique devices count per project
POST/transform/html/from/{from_lang}/to/{to_lang}Machine-translate content
POST/transform/html/from/{from_lang}/to/{to_lang}/{provider}Machine-translate content
GET/transform/list/languagepairs/Lists the language pairs supported by the back-end
GET/transform/list/pair/{from}/{to}/Lists the tools available for a language pair
GET/transform/list/tool/{tool}Lists the tools and language pairs available for the given tool category
GET/transform/list/tool/{tool}/{from}Lists the tools and language pairs available for the given tool category
GET/transform/list/tool/{tool}/{from}/{to}Lists the tools and language pairs available for the given tool category
GET/transform/word/from/{from_lang}/to/{to_lang}/{word}Fetch the dictionary meaning of a word
GET/transform/word/from/{from_lang}/to/{to_lang}/{word}/{provider}Fetch the dictionary meaning of a word

Questions

Does the Wikimedia API need an API key?

Yes. The Wikimedia API uses API key authentication; the documentation explains how to get credentials.

Does the Wikimedia API support HTTPS?

The Wikimedia API is listed as HTTP only, so avoid sending secrets to it.

How many endpoints does the Wikimedia API have?

Its OpenAPI description lists 35 endpoints in version 1.0.0. All of them are shown on this page.

What are alternatives to the Wikimedia API?

Other Media APIs include SiriKit Cloud Media, Radio & Music Services, Spotify Web API, setlist.fm API, NBA Stats API.

Compare alternatives →

SiriKit Cloud Media

Media

Add intelligent features with Apple Intelligence, machine learning, and related technologies.

No auth6 endpoints

Radio & Music Services

Media

We encapsulate Radio & Music business logic for iPlayer Radio and BBC Music products on all platforms. We add value by reliably providing the right blend of metadata needed by clients.

No auth75 endpoints

Spotify Web API

Media

You can use Spotify's Web API to discover music and podcasts, manage your Spotify library, control audio playback, and much more. Browse our available Web API endpoints using the sidebar at left, or via the navigation bar on top of this page on smaller screens. In order to make successful Web API requests your app will need a valid access token. One can be obtained through <a href="https://developer.spotify.com/documentation/general/guides/authorization-guide/">OAuth 2.0</a>. The base URI for all Web API requests is `https://api.spotify.com/v1`. Need help? See our <a href="https://developer.spotify.com/documentation/web-api/guides/">Web API guides</a> for more information, or visit the <a href="https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer">Spotify for Developers community forum</a> to ask questions and connect with other developers.

OAuth88 endpoints

setlist.fm API

Media

<p> The setlist.fm API has been designed to give you easy access to setlist data in order to build fancy websites and other applications. Before starting to use the API, be sure to ... <ol> <li>... understand how setlist.fm works (the <a href="https://www.setlist.fm/faq">FAQ</a> and the <a href="https://www.setlist.fm/guidelines">Guidelines</a> are a good starting point),</li> <li>... read this documentation carefully and</li> <li>... <a href="https://www.setlist.fm/settings/api">apply for an API key</a> (link for logged in users only) - if you're no registered user yet, then <a href="https://www.setlist.fm/signup">register first</a> (it's free).</li> </ol> </p> <p> If this documentation isn't enough or if you've got other things you'd like to tell us about the API, visit the <a href="https://www.setlist.fm/forum/setlistfm/setlistfm-api">API Forum</a>. </p> <p> Note that the setlist.fm API is, according to the <a href="https://www.setlist.fm/help/api-terms">API terms of service</a>, only free for non-commercial projects. If you're interested in using the API for commercial purposes, <a href="https://www.setlist.fm/contact">contact us</a>. </p> <h2>About this Service</h2> <p> This service provides methods to get both setlists and components of setlists such as artists, cities, countries or venues. </p> <h2>Supported Content Types</h2> <p> The REST service currently supports XML (default) and JSON content. </p> <p> To receive a JSON response, set the <code>Accept</code> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1">header</a> to <em>application/json</em>. </p> <h2>Internationalization</h2> <p> <small>(Please note that this is an experimental feature and does not work for all cities!)</small> </p> <p> Most of the featured methods honor the <code>Accept-Language</code> <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4">header</a>. This header is used for localizing cities and countries. The default language is English (en), but you can provide any of the languages Spanish (es), French (fr), German (de), Portuguese (pt), Turkish (tr), Italian (it) or Polish (pl). </p> <p> E.g. if you search a setlist for a concert that took place in Vienna and you pass &quot;de&quot; as header, you'll get <em>&quot;Wien, &Ouml;sterreich&quot;</em> instead of <em>&quot;Vienna, Austria&quot;</em>.<br/> This also works if you use a different language than the country's native language. </p> <p> E.g. for a concert in New York, you'll get <em>&quot;Nueva York, Estados Unidos&quot;</em> instead of <em>&quot;New York, United States&quot;</em> if you pass &quot;es&quot; as language. </p> <h2>API Keys</h2> API keys (<a href="https://www.setlist.fm/settings/api">application form</a>) must be included in the request with the <code>x-api-key</code> header. <h2>Version History</h2> <table class="table table-bordered table-versions"> <thead> <tr> <th>Version</th> <th>Docs</th> <th>End of Service</th> </tr> </thead> <tbody> <tr> <td><strong>1.0</strong></td> <td><a href="/docs/1.0">Docs</a></td> <td>-</li> </tr> <tr> <td><strong>0.1</strong></td> <td></td> <td>December 31, 2017</li> </tr> </tbody> </table>

No auth15 endpoints

NBA Stats API

Media

The destination for current and historic NBA statistics.

No auth91 endpoints

APOD

Media

This endpoint structures the APOD imagery and associated metadata so that it can be repurposed for other applications. In addition, if the concept_tags parameter is set to True, then keywords derived from the image explanation are returned. These keywords could be used as auto-generated hashtags for twitter or instagram feeds; but generally help with discoverability of relevant imagery

API key1 endpoints

Listed from APIs.guru (CC0).