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/graphoid.yaml options: '{{options.graphoid}}' - path: v1/random.yaml options: '{{merge({"random_cache_control": "s-maxage=2, max-age=1"}, options.mobileapps)}}' - path: v1/common_schemas.yaml # Doesn't really matter where to mount it. /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/lists.js options: '{{options.lists}}' 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)}}' /events: x-modules: - path: sys/events.js options: '{{merge({"skip_updates": options.skip_updates}, options.events)}}' options: '{{options}}'