Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: Wikimedia Enterprise Batches API
version: 2.0.0
description: 'The Wikimedia Enterprise API provides high-volume, read-only access to Wikipedia and other supported Wikimedia projects.
This single specification covers all Wikimedia Enterprise APIs:
- **Authentication** (`auth.enterprise.wikimedia.com`) - exchange credentials for JWT access and refresh tokens.
- **Metadata, Snapshot, and On-demand** (`api.enterprise.wikimedia.com`) - reference data, bulk downloads, and single-article lookups, plus Realtime (Batch) hourly files.
- **Realtime** (`realtime.enterprise.wikimedia.com`) - streaming article and Wikidata updates.
All data endpoints are read-only. Most accept either a `GET` request or a `POST` whose JSON body carries `fields`, `filters`, and `limit` to shape the response - the `POST` form never modifies data.
Authenticated endpoints expect a `Bearer` JWT access token in the `Authorization` header. Content is Wikimedia project text, licensed CC-BY-SA-4.0.'
license:
name: CC-BY-SA-4.0
url: https://creativecommons.org/licenses/by-sa/4.0/
contact:
name: Commercial Partnerships Division
url: https://enterprise.wikimedia.com/contact/
termsOfService: https://enterprise.wikimedia.com/terms/
servers:
- url: https://api.enterprise.wikimedia.com
description: Metadata, Snapshot, and On-demand APIs, plus Realtime (Batch) files
- url: https://auth.enterprise.wikimedia.com
description: Authentication API
- url: https://realtime.enterprise.wikimedia.com
description: Realtime streaming API
security:
- bearerAuth: []
tags:
- name: Batches
description: Hourly batch files of project updates (Realtime Batch).
paths:
/v2/batches/{date}/{hour}:
summary: List all batch files for a given hour and date
servers:
- url: https://api.enterprise.wikimedia.com
description: Metadata, Snapshot, and On-demand APIs, plus Realtime (Batch) files
get:
summary: Hourly Batch Files Available
description: Returns a list of available Realtime (Batch) bundles by date and hour (00, 01, ..., 23). Includes identifiers, file sizes and other relevant metadata.
operationId: getBatchesByDateByHour
tags:
- Batches
parameters:
- in: path
name: date
required: true
schema:
type: string
minLength: 1
default: '2023-02-28'
- in: path
name: hour
required: true
schema:
type: string
minLength: 1
default: '00'
- in: query
name: fields
description: 'Select which fields to receive in your response, using JSON dot notation. Sent as one `fields` query parameter per field: `?fields=name&fields=identifier`. A comma-separated list in a single value is not supported.'
style: form
explode: true
schema:
type: array
items:
type: string
example: name
- in: query
name: filters
description: 'Select which projects and languages to receive in your response. Sent as one `filters` query parameter per filter, each a JSON object: `?filters={"field":"is_part_of.identifier","value":"enwiki"}&filters={"field":"namespace.identifier","value":0}`. Repeated filters combine as AND. A JSON array in a single value returns `422 Unprocessable Entity`.'
style: form
explode: true
schema:
type: array
items:
$ref: '#/components/schemas/filter'
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","version": "string","date_modified": "string","is_part_of": {"identifier": "string"},"in_language": {"identifier": "string"},"namespace": {"identifier": 0},"size": {"value": 20.837,"unit_text": "MB"},"record_count": 0}
{"identifier": "string","version": "string","date_modified": "string","is_part_of": {"identifier": "string"},"in_language": {"identifier": "string"},"namespace": {"identifier": 0},"size": {"value": 20.837,"unit_text": "MB"},"record_count": 0}
'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 401}
'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 403}
'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 404}
'
'422':
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':
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}
'
post:
summary: Hourly Batch Files Available
description: Returns a list of available Realtime (Batch) bundles by date and hour (00, 01, ..., 23). Includes identifiers, file sizes and other relevant metadata.
operationId: queryBatchesByDateByHour
tags:
- Batches
parameters:
- in: path
name: date
required: true
schema:
type: string
minLength: 1
default: '2023-02-28'
- in: path
name: hour
required: true
schema:
type: string
minLength: 1
default: '00'
requestBody:
content:
application/json:
schema:
type: object
properties:
fields:
type: array
example:
- name
- identifier
description: Select which fields to receive in your response, using JSON dot notation.
items:
type: string
filters:
type: array
description: Select which projects and languages to receive in your response.
items:
$ref: '#/components/schemas/filter'
example:
- field: namespace.identifier
value: '0'
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","version": "string","date_modified": "string","is_part_of": {"identifier": "string"},"in_language": {"identifier": "string"},"namespace": {"identifier": 0},"size": {"value": 20.837,"unit_text": "MB"},"record_count": 0}
{"identifier": "string","version": "string","date_modified": "string","is_part_of": {"identifier": "string"},"in_language": {"identifier": "string"},"namespace": {"identifier": 0},"size": {"value": 20.837,"unit_text": "MB"},"record_count": 0}
'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 401}
'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 403}
'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 404}
'
'422':
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':
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}
'
/v2/batches/{date}/{hour}/{identifier}:
summary: Receive info for one batch file
servers:
- url: https://api.enterprise.wikimedia.com
description: Metadata, Snapshot, and On-demand APIs, plus Realtime (Batch) files
get:
summary: Hourly Batch File Info
description: Information on specific hourly batch. Includes identifier, file size and other relevant metadata.
operationId: getBatchesByDateByHourByIdentifier
tags:
- Batches
parameters:
- in: path
name: date
required: true
schema:
type: string
minLength: 1
default: '2023-02-28'
- in: path
name: hour
required: true
schema:
type: string
minLength: 1
default: '00'
- in: path
name: identifier
required: true
description: Batch identifier.
schema:
type: string
minLength: 1
- in: query
name: fields
description: 'Select which fields to receive in your response, using JSON dot notation. Sent as one `fields` query parameter per field: `?fields=name&fields=identifier`. A comma-separated list in a single value is not supported.'
style: form
explode: true
schema:
type: array
items:
type: string
example: name
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/batch'
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": 0},"size": {"value": 20.837,"unit_text": "MB"},"record_count": 0}
'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 401}
'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 403}
'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 404}
'
'422':
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':
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}
'
post:
summary: Hourly Batch File Info
description: Information on specific hourly batch. Includes identifier, file size and other relevant metadata.
operationId: queryBatchesByDateByHourByIdentifier
tags:
- Batches
parameters:
- in: path
name: date
required: true
schema:
type: string
minLength: 1
default: '2023-02-28'
- in: path
name: hour
required: true
schema:
type: string
minLength: 1
default: '00'
- in: path
name: identifier
required: true
description: Batch identifier.
schema:
type: string
minLength: 1
requestBody:
content:
application/json:
schema:
type: object
properties:
fields:
type: array
example:
- name
- identifier
description: Select which fields to receive in your response, using JSON dot notation.
items:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/batch'
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": 0},"size": {"value": 20.837,"unit_text": "MB"},"record_count": 0}
'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 401}
'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 403}
'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 404}
'
'422':
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':
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}
'
/v2/batches/{date}/{hour}/{identifier}/download:
summary: Download one batch file
servers:
- url: https://api.enterprise.wikimedia.com
description: Metadata, Snapshot, and On-demand APIs, plus Realtime (Batch) files
head:
summary: Project Updates (Batch) Headers
description: Set of headers that describe the hourly download.
operationId: headBatchesByDateByHourByIdentifierDownload
tags:
- Batches
parameters:
- in: path
name: date
required: true
schema:
type: string
minLength: 1
default: '2023-02-28'
- in: path
name: hour
required: true
schema:
type: string
minLength: 1
default: '00'
- in: path
name: identifier
required: true
description: Batch identifier.
schema:
type: string
minLength: 1
responses:
'200':
description: OK
headers:
Accept-Ranges:
schema:
type: string
example: bytes
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
example: binary/octet-stream
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':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 401}
'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 403}
'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 404}
'
'422':
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':
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}
'
get:
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.
Responds `307 Temporary Redirect` with a presigned URL in the `Location` header, valid for 60 seconds. The file is served from that URL, not from this endpoint, so clients must follow the redirect (for example `curl --location`) and request a fresh URL for each download rather than storing one. Do not send the API bearer token to the presigned URL: the storage service rejects a request that carries both with `400 InvalidArgument`. The payload is a gzipped tar archive served as `binary/octet-stream`. Use HEAD on this path for `Content-Length`, `ETag`, `Last-Modified` and `Accept-Ranges`, and send `Range` requests to the presigned URL to resume a partial download.'
operationId: getBatchesByDateByHourByIdentifierDownload
tags:
- Batches
parameters:
- in: path
name: date
required: true
schema:
type: string
minLength: 1
default: '2023-02-28'
- in: path
name: hour
required: true
schema:
type: string
minLength: 1
default: '00'
- in: path
name: identifier
required: true
description: Batch identifier.
schema:
type: string
minLength: 1
- in: header
name: Range
description: The Range HTTP request header indicates the part of a document that the server should return. This endpoint redirects before reading it, so send `Range` to the presigned URL in the redirect instead.
schema:
type: string
responses:
'200':
description: OK, from the presigned URL after the redirect
content:
binary/octet-stream:
schema:
type: string
format: binary
description: Gzipped tar archive.
'307':
description: Temporary Redirect to a short-lived presigned download URL
headers:
Location:
schema:
type: string
format: uri
description: Presigned URL for the file, valid for 60 seconds. Follow it to download, and request a new one for each download rather than storing it.
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 401}
'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 403}
'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
application/x-ndjson:
schema:
type: string
format: ndjson
example: '{"message":"string","status": 404}
'
'422':
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':
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}
'
components:
schemas:
error:
type: object
description: Error response returned when a request fails
properties:
message:
type: string
description: Human-readable description of the error
status:
type: integer
description: HTTP status code of the error
size:
type: object
description: Size of a resource, in the unit given by `unit_text`.
properties:
unit_text:
type: string
description: '`MB` on snapshots, chunks and batches: decimal megabytes, bytes divided by 1,000,000, to three decimals. `B` on article versions: bytes of wikitext.'
value:
type: number
description: Size in the unit given by `unit_text`. For the exact byte count of a download, use the `Content-Length` header from a HEAD request on its download endpoint.
article_namespace:
type: object
description: Namespace the page belongs to
properties:
identifier:
type: number
description: Numeric identifier of the namespace. Names and descriptions are available from the Namespaces metadata endpoints
example: 0
project:
type: object
description: Wikimedia project a resource belongs to
properties:
identifier:
type: string
description: Unique identifier of the project, combining language and project code, e.g. `enwiki` for English Wikipedia
example: enwiki
code:
type: string
description: Code of the project type, e.g. `wiki` for Wikipedia projects
example: wiki
name:
type: string
description: Name of the project
example: Wikipedia
url:
type: string
format: uri
description: URL of the project
example: https://en.wikipedia.org
in_language:
$ref: '#/components/schemas/language'
description: Primary language of the project
batch:
type: object
description: Hourly batch file of article updates for a project namespace, served by the Realtime Batch endpoints
properties:
identifier:
type: string
description: Identifier of the batch, combining the project identifier and namespace, e.g. `enwiki_namespace_0`. The Wikidata batches are `wikidata_items` and `wikidata_properties`; the Wikidata batch endpoints take `items` or `properties` as their `{identifier}` path parameter, not this value
example: enwiki_namespace_0
version:
type: string
description: Content hash of the batch file. Changes whenever the batch contents change
example: a6c8f97c45e85536e5c823baff7a5eef
date_modified:
type: string
format: date-time
description: Timestamp of when the batch file was last updated
example: '2026-07-21T13:03:04.441209238Z'
in_language:
$ref: '#/components/schemas/language'
description: Language of the project the batch belongs to
is_part_of:
$ref: '#/components/schemas/project'
description: Project the batch belongs to
namespace:
$ref: '#/components/schemas/article_namespace'
description: Namespace of the articles in the batch
size:
$ref: '#/components/schemas/size'
description: Size of the batch file in decimal megabytes (`unit_text` is `MB`).
example:
value: 20.837
unit_text: MB
record_count:
type: integer
description: Number of records in the batch file
example: 3508
filter:
type: object
description: Filter condition applied to a POST request body, narrowing the response to records matching the value
properties:
field:
type: string
description: Field to filter on, in dot notation, e.g. `is_part_of.identifier`
example: is_part_of.identifier
value:
description: Value the field must equal. Use the field's own type - a number for numeric fields such as `namespace.identifier`, a string for text fields.
oneOf:
- type: string
- type: number
example: enwiki
language:
type: object
description: Language of a Wikimedia project or article
properties:
identifier:
type: string
description: Wikimedia [language code](https://www.wikidata.org/wiki/Help:Wikimedia_language_codes/lists/all) of the language
example: en
name:
type: string
description: Full name of the language
example: English
alternate_name:
type: string
description: Alternate name of the language
example: English
direction:
type:
- string
- 'null'
enum:
- ltr
- rtl
- null
description: Direction the language is written in, `ltr` (left-to-right) or `rtl` (right-to-left)
example: ltr
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
externalDocs:
description: Wikimedia Enterprise API documentation
url: https://enterprise.wikimedia.com/docs/
x-tagGroups:
- name: Authentication
tags:
- authentication
- name: Metadata
tags:
- codes
- languages
- projects
- namespaces
- name: Snapshots
tags:
- snapshots
- structured-snapshots
- wikidata-snapshots
- name: On-demand
tags:
- articles
- structured-contents
- wikidata
- name: Realtime
tags:
- realtime-articles
- batches
- realtime-wikidata
- wikidata-batches