Technical implementation
This section provides technical guidance to support the implementation of Wikimedia attribution in external products. It introduces the available and recommended Wikimedia API pathways that technical teams can use to retrieve essential and recommended attribution signals' metadata.
Using Wikimedia APIs to retrieve attribution metadata
Wikimedia offers a set of public and commercial APIs that can be used to fetch attribution metadata about its projects’ content. Some API solutions offer a more optimal retrieval path for specific data points than others. In each case, the recommended solutions will be documented under the Data sources section of each attribution signal page. This section includes a general overview of the Wikimedia APIs that reusers can rely on to implement both essential and recommended attribution signals.
Recommended pathways
Wikimedia Attribution API Beta
Recommended for: Wikimedia technical contributors.
The Wikimedia Attribution API offers a canonical and open retrieval path for both essential and recommended attribution. We encourage the adoption of this public solution to reusers who wish to easily and fairly credit Wikimedia content wherever it is surfaced.
The Attribution API offers endpoints able to fetch attribution information about Wikimedia projects, Wikipedia articles, and Wikimedia Commons media file pages. It is technically possible to use the Attribution API to retrieve information about any Wikimedia project page, but it is likely to return inaccurate or incomplete information due to limited support for additional page and project types. This API also relies on Wikimedia specific services and extensions, meaning it is not available for third party installations of MediaWiki.
The Attribution API is the most comprehensive source for attribution data. Through it, reusers can expose all essential attribution data points, as well as most of the recommended attribution signals in the Trust and relevance and the Ecosystem growth categories. While not every signal is implemented yet, we plan to continue investing and expanding coverage for the Attribution API in the coming months. Check the full list of attribution data that you can retrieve using the Wikimedia Attribution API.
ℹ️ Usage disclaimer: While this API is designed to make attribution easier, we cannot fully guarantee the completeness or accuracy of the data returned. Due to the human nature of Wikimedia projects, there may be cases where the available data may be incomplete or inaccurate. Content reusers are still ultimately responsible for ensuring that what is presented meets all applicable license requirements and reflects fair reuse as defined in the Wikimedia attribution framework.
Reference documentation about the Wikimedia Attribution API can be found in any wiki's REST API sandbox, such as the REST API sandbox on English Wikipedia →
Share feedback on this beta API →
Wikimedia Enterprise APIs
Recommended for:
- Commercial reusers
- Large volume reusers
- Researchers
Wikimedia's Enterprise APIs are designed for high-volume read-only access to Wikipedia and other supported Wikimedia projects. Download complete project snapshots with the Snapshot API, or retrieve specific articles with the On-demand API. The On-demand API can be particularly useful for commercial users wanting to retrieve essential attribution information for a given set of articles: On-demand and Snapshot API responses provide cover for most essential attribution signals, as well as some recommended signals. Check the full list of attribution data that you can retrieve using the Wikimedia Enterprise API.
Sign up for a Wikimedia Enterprise Account to get started with the On-demand API for free →
Additional retrieval options
MediaWiki Action API
Recommended for:
- Wikimedia technical contributors with low volume use cases
- Third-party MediaWiki users and developers
Introduced in 2007, the MediaWiki Action API is the most commonly used API for the Wikimedia community because of its broad coverage and depth of options. It serves as the primary developer interface for Wikimedia projects, enabling users to query data and execute a wide range of wiki operations programmatically. It is included out of the box with every MediaWiki installation, making it universally available across all MediaWiki-powered sites, not just Wikimedia projects. Whether for building tools, bots, or applications, the Action API is a common solution for developers and community users looking to interact with MediaWiki content and services.
Thanks to its close integration with MediaWiki, the Action API can be used to retrieve all essential attribution signals related to project pages, but offers limited coverage of recommended signals. Check the full list of attribution data that you can retrieve using the MediaWiki Action API.
MediaWiki REST API
Recommended for:
- Wikimedia technical contributors with higher volume use cases
- Third-party MediaWiki users and developers
Like the Action API, the MediaWiki REST API is included out of the box with every MediaWiki installation. It follows modern REST conventions, making it an appealing alternative for developers who are experienced with web development, but less familiar with Wikimedia project patterns. While it offers a narrower scope of functionality compared to the Action API, it is tailored to provide optimized access to page content and metadata, making it particularly well-suited for higher-volume use cases where Wikimedia's caching infrastructure provides a performance and sustainability benefit.
The MediaWiki REST API can be used to retrieve most essential signals, but only a few of the recommended metadata. For Wikimedia projects, the Analytics API may be used to supplement information for the more robust trust and relevance signals through another RESTful model. Check the full list of attribution data that you can retrieve using the MediaWiki REST API.
Wikimedia Analytics API
Recommended for:
- Wikimedia technical contributors who prefer the REST framework
- Users who may be interested in supplementing attribution data with project-level analytics
The Wikimedia Analytics API provides open access to data about Wikipedia and other Wikimedia projects. For example, you can use the API to: get the number of devices that visited Wikipedia in a given month, list the most-viewed or most-edited pages on Wikipedia, compare the number of editors that edited Wikipedia by country. The Analytics API can also be used to supplement specific trust and relevance data points that are not natively included in the MediaWiki REST API, such as the number of page views and top trending information. Check the full list of attribution data that you can retrieve using the Wikimedia Analytics API.
Signal support overview
| Attribution API | Enterprise API | MediaWiki Action API | MediaWiki REST API | Analytics API | |
|---|---|---|---|---|---|
| Essential signals | |||||
| Source | 🟢 | 🟢 | 🟢 | - | - |
| Credit | 🟢 | - | 🟢 | - | - |
| Link | 🟢 | 🟢 | 🟢 | - | - |
| Title | 🟢 | 🟢 | 🟢 | 🟢 | - |
| License | 🟢 | 🟢 | 🟢 | 🟢 | - |
| Brand mark | 🟢 | - | 🟢 | - | - |
| Modification disclaimer † | n/a | n/a | n/a | n/a | n/a |
| Trust and relevance | |||||
| Reference count | 🟢 | 🟠 [4] | 🟠 [3] | 🟠 [3] | - |
| Contributor count | - [1] | - | 🟠 [4] | 🟢 | - |
| Page views | 🟢 | - | - | - | 🟢 |
| Attribution count † | n/a | n/a | n/a | n/a | n/a |
| Trending indicator | 🟢 | - | - | - | 🟢 |
| Last update | 🟢 | 🟢 | 🟢 | 🟢 | - |
| Ecosystem growth | |||||
| Participation CTA | 🟢 [2] | - | - | - | - |
| Donation CTA | 🟢 [2] | - | - | - | - |
† – Must be determined externally by reusers; not available for retrieval.
1 – Included in interface but not yet implemented; expected delivery June 2026.
2 – Currently returns static values intended for demonstration purposes. Can be adopted to display generic actions.
3 – Rendered page HTML parsing required.
4 – Client-side counting of the returned list required.
Traffic referral
The Wikimedia attribution framework exists to facilitate reusers’ contributions to the growth of our free-knowledge ecosystem. The first key to unlocking sustainability lies in driving engagement back to sources through access links and call-to-actions displayed in external contexts. The lack of visibility of provenance, nevertheless, prevents Wikimedia from understanding how reuse contexts contribute to return visits and participation. This is why our recommendation is for supporters of the movement to preserve referral information. Where technically feasible and aligned with user privacy expectations, we encourage reusers to:
Preserve the referrer domain name in call-to-actions that link to Wikimedia pages: Remove the meta tag
content=”no-referrer”and ensure that components for link embeds to Wikipedia do not have therel=”noreferrer”attribute.Append the Wikimedia-specific
wprovparameter in call-to-action URLs. Adding this parameter helps Wikimedia teams see the provenance of those coming back to our projects and better understand engagement. Find out more information about how to define the wprov provenance value.Please review the User-agent policy and rate limits section below for additional tips in case you're doing Ajax (web) or native component development that utilizes Wikimedia APIs from your site or application. Setting the User-Agent helps with provenance as well, but equally importantly, it can also ensure that your users have a smoother experience (fewer server HTTP 429s) and that you have a way for the Wikimedia Foundation to reach out to you in case our systems observe unusual traffic patterns.
User-agent policy and rate limits
Overview
Wikimedia APIs rely on shared infrastructure. To ensure the availability of resources and protect fair access for all clients, API requests are subject to Wikimedia’s User-Agent policy and Rate limits. Reusers who want to reduce the risk of hitting rate limits when using APIs to obtain attribution metadata should:
Include a meaningful User-Agent header, specifying the contact information, such as an email or full URL. This helps the Wikimedia Foundation to understand where traffic is coming from and to contact users if we detect unusual request patterns. For example:
MyProductsName/1.0 (https://myproductsname.example.com/; info@myproductsname.example.com).Avoid unnecessary or repeated requests. Limiting the number of concurrent requests to 3 or fewer is recommended.
Respect the
Retry-Afterheader provided when429or503responses are returned
Setting the User-Agent header by platform
In products that make API requests from browser-based JavaScript, the browser controls the standard User-Agent header. In such cases, it is recommended to include an Api-User-Agent HTTP header that identifies the application and, where possible, specify the https:// root URL of the product’s domain and contact information. For example:
MyProductsName/1.0 (https://myproductsname.example.com/; info@myproductsname.example.com)Note that this is just what a good User-Agent might look like if you have control over the User-Agent value.
If the JavaScript runs outside the context of a web browser, such as inside an app's webview, the product’s User-Agent can sometimes be hardcoded instead of needing to use the Api-User-Agent header; check your platform's SDK documentation for more information (cf. Apple and Android setters).
For native applications that call Wikimedia APIs directly with an HTTPS SDK connection, the standard User-Agent header can be set using the descriptive format exemplified above. For SDKs that don’t allow setting User-Agent, Api-User-Agent should be used.
Authentication access and OAuth
If you are building an application where your server makes requests on its own (not on the behalf of users), follow the guidance in OAuth/Owner-only consumers.
If you are building an application where your server makes requests to Wikimedia APIs on behalf of end users, please see the documentation on OAuth/For Developers. Note that OAuth 1.0a requires returning cookies to the Wikimedia servers on a per-user basis. For OAuth 2.0 such cookie management is not typically required (your application should honor the webview or web browser behavior as the user authorizes your application with the Wikimedia server, though).
If you are interested in operating a bot that helps the Wikimedia projects, see the documentation in Manual:Bots. Bot passwords additionally require maintaining a cookie for the bot and ensuring the bot handles cookie refreshes gracefully.
High-volume and commercial access
The practices recommended above help provide a smoother experience for end audiences while making reusers’ traffic easier to support for Wikimedia. If you require sustained high-volume commercial access, please note that:
Wikimedia Enterprise APIs are available with free access for all users up to certain speed and volume limits.
Commercial-grade rates are offered for reusers who need higher speed volumes or SLA requirements.
