openapi: 3.1.0
info:
title: Wikimedia Enterprise API spec
description: |
OpenAPI 3.0 specification for the Metadata, On-demand, Snapshot, and Realtime Batch API(s) of WME.
While we provide this swagger spec for quick reference, our official documentation is located on our website:
- [Official Documentation](https://enterprise.wikimedia.com/docs/)
- [Data Dictionary & Schema](https://enterprise.wikimedia.com/docs/data-dictionary/)
version: 2.0.0
servers:
- url: https://api.enterprise.wikimedia.com
tags:
- name: codes
description: Metadata
externalDocs:
description: enterprise docs - metadata
url: https://enterprise.wikimedia.com/docs/metadata/
- name: languages
description: Metadata
externalDocs:
description: enterprise docs - metadata
url: https://enterprise.wikimedia.com/docs/metadata/
- name: projects
description: Metadata
externalDocs:
description: enterprise docs - metadata
url: https://enterprise.wikimedia.com/docs/metadata/
- name: namespaces
description: Metadata
externalDocs:
description: enterprise docs - metadata
url: https://enterprise.wikimedia.com/docs/metadata/
- name: snapshots
description: Snapshot API
externalDocs:
description: enterprise docs - snapshot api
url: https://enterprise.wikimedia.com/docs/snapshot/
- name: structured-snapshots
description: (BETA) Structured Contents Snapshot API
externalDocs:
description: enterprise docs - structured snapshot api
url: https://enterprise.wikimedia.com/docs/snapshot/
- name: articles
description: On-demand API
externalDocs:
description: enterprise docs - on-demand api
url: https://enterprise.wikimedia.com/docs/on-demand/
- name: structured-contents
description: (Beta) Structured Contents On-demand API
externalDocs:
description: enterprise docs - on-demand api
url: https://enterprise.wikimedia.com/docs/on-demand/
- name: batches
description: Realtime Batch API
externalDocs:
description: enterprise docs - realtime api
url: https://enterprise.wikimedia.com/docs/realtime/
security:
- bearerAuth: []
paths:
#-------------------------
# Codes
#-------------------------
/v2/codes:
summary: &codes_summary Project Codes Available
description: &codes_description >
Lists available project codes (types). Includes project code (type) identifier, name and description.
get:
tags:
- codes
parameters:
- &fields_query
in: query
name: fields
description: &fields_description Select which fields to receive in your response, using JSON dot notation.
schema:
type: array
items:
type: string
example: name
- &filters_query
in: query
name: filters
description: &filters_description Select which projects and languages to receive in your response.
schema:
type: array
items:
$ref: "#/components/schemas/filter"
responses: &codes_responses
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/code"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"identifier":"string","name":"string","description":"string"}
{"identifier":"string","name":"string","description":"string"}
401: &unauthorized_error
description: Unauthorized
content:
application/json:
schema:
$ref: "#/components/schemas/error"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"message":"string","status": 401}
404: ¬_found_error
description: Not Found
content:
application/json:
schema:
$ref: "#/components/schemas/error"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"message":"string","status": 404}
403: &forbidden_error
description: Forbidden
content:
application/json:
schema:
$ref: "#/components/schemas/error"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"message":"string","status": 403}
422: &unprocessable_entity_error
description: Unprocessable Entity
content:
application/json:
schema:
$ref: "#/components/schemas/error"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"message":"string","status":422}
500: &internal_server_error
description: Internal Server Error, Retry Request
content:
application/json:
schema:
$ref: "#/components/schemas/error"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"message":"string","status":500}
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- codes
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: &fields_body
type: array
example: '["name","identifier"]' #using single quotes to prevent escaping issues
description: *fields_description
items:
type: string
filters:
type: &filters_body_type array
description: *filters_description
items: &filters_body_items
$ref: "#/components/schemas/filter"
example: '[{"field": "identifier", "value": "wiki"}]' #same as above line 178, encasing in single quotes to fix encoding errors when not escaping backslashes and newlines
responses: *codes_responses
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v2/codes/{identifier}:
summary: &code_summary Project Code Info
description: &code_description Information on a specific project code (type). Includes identifier, name and description.
get:
tags:
- codes
parameters:
- &code_identifier_param
in: path
name: identifier
description: Identifier of the code.
required: true
schema:
type: string
minLength: 1
- *fields_query
responses: &code_response
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/code"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"identifier":"string","name": "string","description": "string"}
401: *unauthorized_error
403: *forbidden_error
404: *not_found_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- codes
parameters:
- *code_identifier_param
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: *fields_body
responses: *code_response
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
#-------------------------
# Languages
#-------------------------
/v2/languages:
summary: &languages_summary Languages Available
description: &languages_description >
Lists of available languages. Includes language identifier, name, direction and other relevant metadata.
get:
tags:
- languages
parameters:
- *fields_query
- *filters_query
responses: &languages_responses
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/language"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"identifier": "string","name": "string","alternate_name": "string","direction": "string"}
{"identifier": "string","name": "string","alternate_name": "string","direction": "string"}
401: *unauthorized_error
403: *forbidden_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- languages
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: *fields_body
filters:
type: *filters_body_type
description: *filters_description
items: *filters_body_items
example: '[{"field": "identifier","value": "en"}]'
responses: *languages_responses
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v2/languages/{identifier}:
summary: &language_summary Language Info
description: &language_description Information on specific language. Includes identifier, name, direction and other relevant metadata.
get:
tags:
- languages
parameters:
- &language_identifier
in: path
name: identifier
required: true
description: Identifier of the language.
schema:
type: string
minLength: 1
- *fields_query
responses: &language_responses
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/language"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"identifier": "string","name": "string","alternate_name": "string","direction": "string"}
401: *unauthorized_error
403: *forbidden_error
404: *not_found_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- languages
parameters:
- *language_identifier
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: *fields_body
responses: *language_responses
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
#-------------------------
# Projects
#-------------------------
/v2/projects:
summary: &projects_summary Projects Available
description: &projects_description List of available projects. Includes project identifier, name, language and other relevant metadata.
get:
tags:
- projects
parameters:
- *fields_query
- *filters_query
responses: &projects_responses
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/project"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"identifier":"string","code":"string","name":"string","alternate_name":"string","in_language":{"identifier":"string"}}
{"identifier":"string","code":"string","name":"string","alternate_name":"string","in_language":{"identifier":"string"}}
401: *unauthorized_error
403: *forbidden_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- projects
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: *fields_body
filters:
type: *filters_body_type
description: *filters_description
items: *filters_body_items
example: '[{"field": "identifier","value": "enwiki"}]'
responses: *projects_responses
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v2/projects/{identifier}:
summary: &project_summary Project Info
description: &project_description Information on specific project. Includes identifier, name, language and other relevant metadata.
get:
tags:
- projects
parameters:
- &project_identifier_param
in: path
name: identifier
description: Project identifier.
required: true
schema:
type: string
minLength: 1
- *fields_query
responses: &project_responses
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/project"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"identifier":"string","code":"string","name":"string","alternate_name":"string","in_language":{"identifier":"string"}}
401: *unauthorized_error
403: *forbidden_error
404: *not_found_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- projects
parameters:
- *project_identifier_param
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: *fields_body
responses: *project_responses
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
#-------------------------
# Namespaces
#-------------------------
/v2/namespaces:
summary: &namespaces_summary Namespaces Available
description: &namespaces_description List of available namespaces. Includes name, identifier and description.
get:
tags:
- namespaces
parameters:
- *fields_query
- *filters_query
responses: &namespaces_responses
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/namespace"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"identifier": 0,"name": "string","description": "string"}
{"identifier": 0,"name": "string","description": "string"}
401: *unauthorized_error
403: *forbidden_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- namespaces
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: *fields_body
filters:
type: *filters_body_type
description: *filters_description
items: *filters_body_items
example: '[{"field": "identifier","value": 0}]'
responses: *namespaces_responses
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v2/namespaces/{identifier}:
summary: &namespace_summary Namespace Info
description: &namespace_description Information on specific namespace. Includes name, identifier and description.
get:
tags:
- namespaces
parameters:
- &namespace_identifier_param
in: path
name: identifier
description: Namespace identifier.
required: true
schema:
type: integer
- *fields_query
responses: &namespace_responses
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/namespace"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"identifier":0,"name":"string","description":"string"}
401: *unauthorized_error
403: *forbidden_error
404: *not_found_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- namespaces
parameters:
- *namespace_identifier_param
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: *fields_body
responses: *namespace_responses
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
#-------------------------
# Batches
#-------------------------
/v2/batches/{date}/{hour}:
summary: &batches_summary Hourly Batch Files Available
description: &batches_description Returns a list of available Realtime (Batch) bundles by date and hour (00, 01, ..., 23). Includes identifiers, file sizes and other relevant metadata.
get:
tags:
- batches
parameters:
- &batches_date_param
in: path
name: date
required: true
schema:
type: string
minLength: 1
default: "2023-02-28"
- &batches_hour_param
in: path
name: hour
required: true
schema:
type: string
minLength: 1
default: "00"
- *fields_query
- *filters_query
responses: &batches_responses
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/batch"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"identifier": "string","code": "string","name": "string","version": "string","is_part_of":{"identifier":"string"},"namespace":{"identifier":0},"in_language":{"identifier":"string"}}
{"identifier": "string","code": "string","name": "string","version": "string","is_part_of":{"identifier":"string"},"namespace":{"identifier":0},"in_language":{"identifier":"string"}}
401: *unauthorized_error
403: *forbidden_error
404: *not_found_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- batches
parameters:
- *batches_date_param
- *batches_hour_param
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: *fields_body
filters:
type: *filters_body_type
description: *filters_description
items: *filters_body_items
example: '[{"field": "namespace.identifier","value": 0}]'
responses: *batches_responses
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v2/batches/{date}/{hour}/{identifier}:
summary: &batch_summary Hourly Batch File Info
description: &batch_description Information on specific hourly batch. Includes identifier, file size and other relevant metadata.
get:
tags:
- batches
parameters:
- *batches_date_param
- *batches_hour_param
- &batch_identifier_param
in: path
name: identifier
required: true
description: Batch identifier.
schema:
type: string
minLength: 1
- *fields_query
responses: &batch_responses
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/batch"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
{"identifier": "string","code": "string","name": "string","version": "string","is_part_of":{"identifier":"string"},"namespace":{"identifier":0},"in_language":{"identifier":"string"}}
401: *unauthorized_error
403: *forbidden_error
404: *not_found_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- batches
parameters:
- *batches_date_param
- *batches_hour_param
- *batch_identifier_param
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: *fields_body
responses: *batch_responses
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v2/batches/{date}/{hour}/{identifier}/download:
summary: Hourly Batch File Download
description: Downloadable bundle of updated articles by project, namespace, date, and hour. Generated hourly starting at 00:00 UTC each day.
head:
summary: Wikimedia Enterprise Project Updates (Batch) Headers
description: Set of headers that describe the hourly download.
tags:
- batches
parameters:
- *batches_date_param
- *batches_hour_param
- *batch_identifier_param
responses:
200:
description: OK
headers:
Accept-Ranges:
schema:
type: string
description: HTTP response header is a marker used by the server to advertise its support for partial requests.
Last-Modified:
schema:
type: string
description: Response HTTP header contains a date and time when the origin server believes the resource was last modified.
Content-Length:
schema:
type: string
description: Header indicates the size of the message body, in bytes, sent to the recipient.
ETag:
schema:
type: string
description: Entity tag - HTTP response header is an identifier for a specific version of a resource.
Content-Disposition:
schema:
type: string
description: Header indicating if the content is expected to be displayed in the browser or as an attachment, that is downloaded and saved locally.
Content-Encoding:
schema:
type: string
description: Lists any encodings that have been applied to the representation (message payload), and in what order.
Content-Type:
schema:
type: string
description: Indicates the original media type of the resource (prior to any content encoding applied for sending).
Expires:
schema:
type: string
description: Contains the date/time after which the response is considered expired.
401: *unauthorized_error
403: *forbidden_error
404: *not_found_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
get:
tags:
- batches
parameters:
- *batches_date_param
- *batches_hour_param
- *batch_identifier_param
- &range_header_param
in: header
name: Range
description: The Range HTTP request header indicates the part of a document that the server should return.
schema:
type: string
responses:
200:
description: OK
content:
application/gzip:
schema:
type: string
format: binary
401: *unauthorized_error
403: *forbidden_error
404: *not_found_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
#-------------------------
# Snapshots
#-------------------------
/v2/snapshots:
summary: &snapshots_summary Snapshots Available
description: &snapshots_description Returns a list of available project snapshots by namespace. Includes identifiers, file sizes and other relevant metadata.
get:
tags:
- snapshots
parameters:
- *fields_query
- *filters_query
responses: &snapshots_responses
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/snapshot"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
[{"identifier": "string","version": "string","date_modified": "string","is_part_of": {"identifier": "string"},"in_language": {"identifier": "string"},"namespace": {"identifier": integer},"size":
{"value": float,"unit_text": "string"},"chunks": ["string"]}]
401: *unauthorized_error
403: *forbidden_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- snapshots
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: *fields_body
filters:
type: *filters_body_type
description: *filters_description
items: *filters_body_items
example: |
[{"field": "namespace.identifier", "value": 0}]
responses: *snapshots_responses
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v2/snapshots/{identifier}:
summary: &snapshot_summary Snapshot Info
description: &snapshot_description Information on a specific Snapshot bundle. Includes identifiers, file sizes and other relevant metadata.
get:
tags:
- snapshots
parameters:
- &snapshots_identifier_param
in: path
name: identifier
description: "Snapshot identifier looks like `<language><project_name>_namespace_<number>`, examples: `dewiki_namespace_14` downloads categories used in de.wikipedia.org, `enwiki_namespace_0` downloads
articles used in en.wikipedia.org, `frwikivoyage_namespace_10` downloads wikitext templates used in fr.wikivoyage.org. See our Metadata Endpoints for language, projects, and namespaces available
for configuration."
required: true
schema:
type: string
minLength: 1
- *fields_query
responses: &snapshot_responses
200:
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/snapshot"
application/x-ndjson:
schema:
type: string
format: ndjson
example: >
[{"identifier": "string","version": "string","date_modified": "string","is_part_of": {"identifier": "string"},"in_language": {"identifier": "string"},"namespace": {"identifier": integer},"size":
{"value": float,"unit_text": "string"},"chunks": ["string"]}]
401: *unauthorized_error
403: *forbidden_error
404: *not_found_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
post:
tags:
- snapshots
parameters:
- *snapshots_identifier_param
requestBody:
content:
application/json:
schema:
type: object
properties:
fields: *fields_body
responses: *snapshot_responses
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v2/snapshots/{identifier}/download:
summary: &snapshot_download_summary Snapshot Download
description: &snapshots_download_description Downloadable bundle of all current revisions in a specified project and namespace. Updated daily at 12:00 UTC.
head:
summary: Wikimedia Enterprise Project Snapshot Headers
description: Set of headers that describe the snapshot download.
tags:
- snapshots
parameters:
- *snapshots_identifier_param
responses: &head_snapshot_responses
200:
description: OK
headers:
Accept-Ranges:
schema:
type: string
description: HTTP response header is a marker used by the server to advertise its support for partial requests.
Last-Modified:
schema:
type: string
description: Response HTTP header contains a date and time when the origin server believes the resource was last modified.
Content-Length:
schema:
type: string
description: Header indicates the size of the message body, in bytes, sent to the recipient.
ETag:
schema:
type: string
description: Entity tag - HTTP response header is an identifier for a specific version of a resource.
Content-Disposition:
schema:
type: string
description: Header indicating if the content is expected to be displayed in the browser or as an attachment, that is downloaded and saved locally.
Content-Encoding:
schema:
type: string
description: Lists any encodings that have been applied to the representation (message payload), and in what order.
Content-Type:
schema:
type: string
description: Indicates the original media type of the resource (prior to any content encoding applied for sending).
Expires:
schema:
type: string
description: Contains the date/time after which the response is considered expired.
401: *unauthorized_error
403: *forbidden_error
404: *not_found_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
get:
tags:
- snapshots
parameters:
- *snapshots_identifier_param
- *range_header_param
responses: &get_snapshot_responses
200:
description: OK
content:
application/gzip:
schema:
type: string
format: binary
401: *unauthorized_error
403: *forbidden_error
404: *not_found_error
422: *unprocessable_entity_error
500: *internal_server_error
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/v2/snapshots/{snapshot_identifier}/chunks:
summary: &chunks_summary Snapshot Chunks Available
description: &chunks_description
# --- truncated at 32 KB (76 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/wikipedia/refs/heads/main/openapi/wikipedia-wikimedia-enterprise-openapi.yaml