Wikimedia REST API
Appearance
Wikimedia的REST API提供对机器可读格式的Wikimedia内容和元数据的访问。 专注于大容量用例,它与Wikimedia的全球分布式缓存基础设施紧密集成。 因此,API用户可以从降低的延迟和高请求量的支持中受益。
REST API及其文档可用于该位置/api/rest_v1/的所有主要Wikimedia项目。 例如,对于英文Wikipedia,它在https://en.wikipedia.org/api/rest_v1/。
虽然大多数项目提供的功能与英文Wikipedia上的非常匹配,但也有一些值得注意的例外:
- wikimedia.org offers cross-project information like page view metrics.
- en.wiktionary.org offers an experimental definition end point, exposing Wiktionary information as structured data. 對其他語言的支援正在討論。
版本控制
REST API遵循 本API版本方針.
条款及细则
- By using the REST API, you agree to Wikimedia's general Terms of Use and Privacy Policy.
- To avoid impacting other API users, limit your clients to no more than 200 requests/sec to this API overall. Many entry points additionally specify and enforce more restrictive rate limits.
- We ask you to set a unique
User-Agent
orApi-User-Agent
header that allows us to contact you quickly. Email addresses or URLs of contact pages work well.
其他API
For the REST API included with MediaWiki 1.35 and later, see the MediaWiki Core REST API.
API | 可用情况 | 根URL | 示例 |
---|---|---|---|
MediaWiki Action API | 随附于MediaWiki
启用于维基媒体项目 |
/api.php | https://en.wikipedia.org/w/api.php?action=query&prop=info&titles=Earth |
MediaWiki REST API | 随附于MediaWiki 1.35+
启用于维基媒体项目 |
/rest.php | https://en.wikipedia.org/w/rest.php/v1/page/Earth |
Wikimedia REST API | 不随附于MediaWiki
仅能用于维基媒体项目 |
/api/rest | https://en.wikipedia.org/api/rest_v1/page/title/Earth |
有关维基媒体项目的商业规模API,请参阅Wikimedia Enterprise |
参阅
- RESTBase,目前已過時,是REST API使用的技術
- Blog post announcing the 1.0 release. Describes several important production use cases, discusses how the REST API fits into Wikimedia's larger technical strategy, and provides pointers to some implementation details.
- The API is implemented using Node.js. This blog post describes our experience upgrading the REST API and other services to Node 6.
- Wikimedia平台團隊,REST API的產品負責團隊。
- Core Platform Team/Initiatives/API Gateway(2020年)