This page is a translated version of the page Wikimedia REST API and the translation is 67% complete.

Wikimedia的REST API提供对机器可读格式的Wikimedia内容和元数据的访问。 专注于大容量用例,它与Wikimedia的全球分布式缓存基础设施紧密集成。 因此,API用户可以从降低的延迟和高请求量的支持中受益。

REST API及其文档可用于该位置/api/rest_v1/的所有主要Wikimedia项目。 例如,对于英文Wikipedia,它在https://en.wikipedia.org/api/rest_v1/

虽然大多数项目提供的功能与英文Wikipedia上的非常匹配,但也有一些值得注意的例外:

版本控制

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 or Api-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 Availability URL base 示例
  MediaWiki Action API Included with MediaWiki

Enabled on Wikimedia projects

/api.php https://en.wikipedia.org/w/api.php?action=query&prop=info&titles=地球
  MediaWiki REST API Included with MediaWiki 1.35+

Enabled on Wikimedia projects

/rest.php https://en.wikipedia.org/w/rest.php/v1/page/地球
  Wikimedia REST API Not included with MediaWiki

Available for Wikimedia projects only

/api/rest https://en.wikipedia.org/api/rest_v1/page/title/地球
  For commercial-scale APIs for Wikimedia projects, see Wikimedia Enterprise

参阅