paths: /{api:v1}: x-modules: # swagger options, overriding the shared ones from the merged specs (?) - spec: info: version: 1.0.0 title: Wikimedia REST API description: > 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. termsOfService: https://wikimediafoundation.org/wiki/Terms_of_Use contact: name: the Wikimedia Services team url: http://mediawiki.org/wiki/REST_API license: name: Apache2 url: http://www.apache.org/licenses/LICENSE-2.0 # Override the base path for host-based (proxied) requests. In our case, # we proxy https://{domain}/api/rest_v1/ to the API. x-host-basePath: /api/rest_v1 x-route-filters: - path: lib/content_location_filter.js - path: ./lib/normalize_title_filter.js options: redirect_cache_control: '{{options.purged_cache_control}}' paths: /page: x-modules: - path: v1/content.yaml options: response_cache_control: '{{options.purged_cache_control}}' - path: v1/content_segments.yaml options: response_cache_control: '{{options.purged_cache_control}}' cx_host: '{{options.transform.cx_host}}' - path: v1/mobileapps.yaml options: '{{merge({"response_cache_control": options.purged_cache_control}, options.mobileapps)}}' - path: v1/graphoid.yaml options: '{{options.graphoid}}' - path: v1/summary.js options: '{{merge({"response_cache_control": options.purged_cache_control_client_cache}, options.summary)}}' - path: v1/media.yaml options: response_cache_control: '{{options.purged_cache_control}}' host: '{{options.mobileapps.host}}' - path: v1/related.js options: '{{options.related}}' - path: v1/random.yaml options: '{{merge({"random_cache_control": "s-maxage=2, max-age=1"}, options.mobileapps)}}' - path: v1/pdf.js options: '{{options.pdf}}' - path: v1/common_schemas.yaml # Doesn't really matter where to mount it. /feed: x-modules: - path: v1/feed.js options: '{{merge({"feed_cache_control": "s-maxage=300, max-age=60"}, options.mobileapps)}}' - path: v1/announcements.yaml options: '{{merge({"announcement_cache_control": "s-maxage=86400, max-age=86400"}, options.mobileapps)}}' - path: v1/onthisday.js options: '{{merge({"feed_cache_control": "s-maxage=300, max-age=60"}, options.mobileapps)}}' /transform: x-modules: - path: v1/transform.yaml - path: v1/transform-lang.js options: '{{options.transform}}' /media: x-modules: - path: v1/mathoid.yaml options: '{{options.mathoid}}' /data: x-modules: - path: v1/citoid.js options: '{{options.citoid}}' - path: v1/lists.js options: '{{options.lists}}' - path: v1/recommend.yaml options: '{{options.recommendation}}' options: '{{options}}' /{api:sys}: x-modules: - spec: paths: /table: &sys_table x-modules: - path: sys/table.js options: conf: '{{options.table}}' /parsoid_bucket: x-modules: - path: sys/multi_content_bucket.js options: table_name_prefix: parsoid_ng renew_expiring: true time_to_live: '{{default(options.parsoid.time_to_live, 84600)}}' delete_probability: '{{default(options.parsoid.delete_probability, 1)}}' main_content_type: name: html value_type: blob dependent_content_types: - name: data-parsoid value_type: json - name: section-offsets value_type: json /key_value: &sys_key_value x-modules: - path: sys/key_value.js /key_rev_value: x-modules: - path: sys/key_rev_value.js /page_revisions: x-modules: - path: sys/page_revisions.js /post_data: &sys_post_data x-modules: - path: sys/post_data.js /action: x-modules: - path: sys/action.js options: "{{options.action}}" /page_save: x-modules: - path: sys/page_save.js /parsoid: x-modules: - path: sys/parsoid.js options: &parsoid_options parsoidHost: '{{options.parsoid.host}}' response_cache_control: '{{options.purged_cache_control}}' grace_ttl: '{{default(options.parsoid.grace_ttl, 86400)}}' time_to_live: '{{default(options.parsoid.time_to_live, 84600)}}' # A list of pages that we don't currently want to re-render on # each edit. Most of these are huge bot-edited pages, which are # rarely viewed in any case. rerenderBlacklist: en.wikipedia.org: - 'User:B-bot/Event_log' - 'User:DeltaQuad/UAA/Wait' - 'User:JamesR/AdminStats' - 'User:Kudpung/Dashboard' # Various dashboards - 'User:Breawycker/Wikipedia' - 'User:Sonia/dashboard' - 'User:Ocaasi/dashboard' - 'User:Nolelover' - 'User:Calmer_Waters' - '/User%3ARedwolf24\//' - 'User:Technical_13/dashboard' - 'Template:Cratstats' # Cyberbot is creating 90% of null edits - '/^User:Cyberbot_I\//' - '/^User:Cyberbot_II\//' - '/^User:Cyberpower678\//' - '/^User:Darts170Darts170\//' - 'صارف:Cyberbot_I/Run/Adminstats' - 'Defnyddiwr:Cyberbot_I/Run/Adminstats' - 'User:Pentjuuu!.!/sandbox' - 'User:AllyD/CSDlog' - 'User:Peter_I._Vardy/sandbox-13' - 'User:I_dream_of_horses/CSD_log' - 'User:MJ180MJ180/sandbox' - 'Talk:United_States_presidential_election,_2016' - 'Wikipedia:Reference_desk/Humanities' - 'Wikipedia:WikiProject_Deletion_sorting/People' - 'Wikipedia:WikiProject_Deletion_sorting/United_States_of_America' - 'Wikipedia:Articles_for_creation/Redirects' - 'Wikipedia:Administrators%27_noticeboard/Incidents' /mobileapps: x-modules: - path: sys/mobileapps.js options: '{{merge({"response_cache_control": options.purged_cache_control}, options.mobileapps)}}' /mobile_bucket: x-modules: - path: sys/multi_content_bucket.js options: grace_ttl: '{{default(options.parsoid.grace_ttl, 86400)}}' delete_probability: '{{default(options.parsoid.delete_probability, 1)}}' table_name_prefix: mobile_ng main_content_type: name: lead value_type: json dependent_content_types: - name: remaining value_type: json /events: x-modules: - path: sys/events.js options: '{{merge({"skip_updates": options.skip_updates}, options.events)}}' options: '{{options}}'