### Request Example with since_per_partition (cURL) Source: https://enterprise.wikimedia.com/docs/best-practices This example demonstrates how to construct a cURL request to the Wikimedia Enterprise Realtime API, utilizing the `since_per_partition` parameter to specify consumption start times for each partition. It requires an ACCESS_TOKEN and filters data for the 'enwiki' project. ```bash curl --location 'https://realtime.enterprise.wikimedia.com/v2/articles' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ACCESS_TOKEN' \ --data '{ \ "filters": [ \ { \ "field": "is_part_of.identifier", "value": "enwiki" \ } \ ], \ "parts": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], \ "since_per_partition": { \ "0": "2023-06-05T12:00:00Z", \ "1": "2023-06-05T12:00:00Z", \ "2": "2023-06-05T12:00:00Z", \ "[...]": "" \ } \ }' ``` -------------------------------- ### POST Request Body Example - JSON Source: https://enterprise.wikimedia.com/docs/on-demand Example JSON for the request body of a POST article lookup. It demonstrates how to specify desired fields, filters (like language), and a limit for the returned articles. ```JSON { "fields": [ "name", "identifier" ], "filters": [ { "field": "in_language.identifier", "value": "en" } ], "limit": 3 } ``` -------------------------------- ### Example Citations Structure (JSON) Source: https://enterprise.wikimedia.com/docs/data-dictionary Provides an example of the citation objects found within article sections. Each citation has a required identifier and text, and an optional group. ```json [ { "identifier": "cite_note-3", "text": "[3]" } ] ``` -------------------------------- ### GET /v2/articles with since_per_partition Source: https://enterprise.wikimedia.com/docs/best-practices This endpoint allows fetching articles with the ability to specify different starting timestamps for each partition using the `since_per_partition` parameter. This is recommended for minimizing duplicate event retrieval when reconnecting. ```APIDOC ## GET /v2/articles ### Description Retrieves articles with the option to specify historical data start points per partition. This is particularly useful for resuming data consumption after a disconnection, ensuring data integrity by minimizing duplicates. ### Method GET ### Endpoint /v2/articles ### Parameters #### Query Parameters - **parts** (array[integer]) - Required - An array of partition integers to consume data from. Example: `[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` - **since_per_partition** (object) - Optional - A JSON object where keys are partition integers (as strings) and values are RFC3339 formatted timestamps. This specifies the starting point for consuming events in each corresponding partition. Example: `{"0": "2023-06-05T12:00:00Z", "1": "2023-06-05T12:00:00Z"}` #### Request Body This endpoint uses query parameters and headers, not a request body. ### Request Example ```curl curl --location 'https://realtime.enterprise.wikimedia.com/v2/articles?parts=0,1,2,3,4,5,6,7,8,9' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '{ "filters": [ { "field": "is_part_of.identifier", "value": "enwiki" } ], "since_per_partition": { "0": "2023-06-05T12:00:00Z", "1": "2023-06-05T12:00:00Z", "2": "2023-06-05T12:00:00Z" } }' ``` ### Response #### Success Response (200) - **data** (array) - A list of article events matching the filters and partition criteria. - **next_batch_token** (string) - A token to fetch the next batch of results. #### Response Example ```json { "data": [ { "event": { "type": "article", "title": "Example Article Title", "namespace": 0, "wikitext": "...", "timestamp": "2023-10-27T10:00:00Z", "url": "https://en.wikipedia.org/wiki/Example_Article_Title" }, "partition": 0 } ], "next_batch_token": "some_token" } ``` ``` -------------------------------- ### Example Infobox Data Structure (JSON) Source: https://enterprise.wikimedia.com/docs/data-dictionary Demonstrates the recursive tree-like data structure for parsed infobox parts. It includes fields like name, type, value, and nested parts. ```json [ { "name": "Automatic taxobox", "type": "infobox", "has_parts": [ { "name": "Kingdom:", "type": "field", "value": "Animalia", "links": [ { "url": "https://en.wikipedia.org/wiki/Animal", "text": "Animalia" } ] }, { "name": "Phylum:", "type": "field", "value": "Chordata", "links": [ { "url": "https://en.wikipedia.org/wiki/Chordate", "text": "Chordata" } ] } ] } ] ``` -------------------------------- ### Example Article Sections Structure (JSON) Source: https://enterprise.wikimedia.com/docs/data-dictionary Illustrates the structure of parsed article sections, including nested sections, paragraphs, values, links, and citations. It shows how HTML sections are represented. ```json [ { "name": "Personal life", "type": "section", "has_parts": [ { "name": "Relationships", "type": "section", "has_parts": [ { "type": "paragraph", "value": "Baker's first marriage was...", "links": [...], "citations": [ { "identifier": "cite_note-78", "text": "[78]" } ] }, { "type": "table", "table_references": [ { "identifier": "taxonomy.taxonomy_list_table1", "confidence_score": 0.910254864452067476 } ] } ] } ] } ] ``` -------------------------------- ### Available Hourly Batches (GET) Source: https://enterprise.wikimedia.com/docs/realtime Retrieves a list of available Realtime (Batch) bundles by date and hour. This includes identifiers, file sizes, and other relevant metadata. ```APIDOC ## GET /v2/batches/{date}/{hour} ### Description Returns a list of available Realtime (Batch) bundles by date and hour (00, 01, …, 23). Includes identifiers, file sizes and other relevant metadata. ### Method GET ### Endpoint https://api.enterprise.wikimedia.com/v2/batches/{date}/{hour} ### Parameters #### Path Parameters - **date** (string) - Required - The date for which to retrieve batches. - **hour** (string) - Required - The hour (00-23) for which to retrieve batches. #### Query Parameters - **fields** (array) - Optional - Select which fields to receive in your response. - **filters** (array) - Optional - Select which projects and languages to receive in your response. ### Response #### Success Response (200) - **identifier** (string) - Unique identifier for the batch. - **name** (string) - Name of the batch. - **version** (string) - Version of the batch data. - **in_language** (object) - Information about the language of the content. - **identifier** (string) - Language identifier. - **name** (string) - Language name. - **alternate_name** (string) - Alternate name for the language. - **direction** (string) - Text direction (e.g., 'ltr', 'rtl'). - **is_part_of** (object) - Information about the dataset this batch is part of. - **identifier** (string) - Dataset identifier. - **code** (string) - Dataset code. - **name** (string) - Dataset name. - **url** (string) - URL to the dataset. - **in_language** (object) - Information about the language of the dataset. - **identifier** (string) - Language identifier. - **name** (string) - Language name. - **alternate_name** (string) - Alternate name for the language. - **direction** (string) - Text direction. - **namespace** (object) - Information about the namespace the data belongs to. - **identifier** (number) - Namespace identifier. - **name** (string) - Namespace name. - **description** (string) - Description of the namespace. - **size** (object) - Size of the batch file. - **unit_text** (string) - Unit of the size (e.g., 'MB', 'GB'). - **value** (number) - Numerical value of the size. #### Error Responses - **401 (Unauthorized)**: Authentication failed. - **403 (Forbidden)**: Insufficient permissions. - **404 (Not Found)**: The requested resource was not found. - **422 (Unprocessable Entity)**: The request was invalid. - **500 (Internal Server Error)**: Server error, please retry. #### Response Example (200 OK) ```json [ { "identifier": "string", "name": "string", "version": "string", "in_language": { "identifier": "string", "name": "string", "alternate_name": "string", "direction": "string" }, "is_part_of": { "identifier": "string", "code": "string", "name": "string", "url": "string", "in_language": { "identifier": "string", "name": "string", "alternate_name": "string", "direction": "string" } }, "namespace": { "identifier": 0, "name": "string", "description": "string" }, "size": { "unit_text": "string", "value": 0 } } ] ``` ``` -------------------------------- ### Get Single Project (GET) Source: https://enterprise.wikimedia.com/docs/metadata Fetches detailed information for a specific project using its unique identifier. Allows selecting specific fields for the response. Handles various HTTP status codes for success and errors, including 'Not Found'. ```http GET https://api.enterprise.wikimedia.com/v2/projects/{identifier}?fields[]=name ``` -------------------------------- ### GET /v2/batches/{date}/{hour}/{identifier}/download Source: https://enterprise.wikimedia.com/docs/realtime Downloads a batch of updated articles for a specific project, namespace, date, and hour. The batch is generated hourly. ```APIDOC ## GET /v2/batches/{date}/{hour}/{identifier}/download ### Description Downloads a downloadable bundle of updated articles by project, namespace, date, and hour. Generated hourly starting at 00:00 UTC each day. ### Method GET ### Endpoint https://api.enterprise.wikimedia.com/v2/batches/{date}/{hour}/{identifier}/download ### Parameters #### Path Parameters - **date** (string) - Required - The date for the batch. - **hour** (string) - Required - The hour for the batch. - **identifier** (string) - Required - Batch identifier. #### Header Parameters - **Range** (string) - Optional - The Range HTTP request header indicates the part of a document that the server should return. ### Response #### Success Response (200) - **Content** (application/gzip) - The gzipped batch file. #### Error Responses - **401 (Unauthorized)** - **message** (string) - Error message. - **status** (integer) - HTTP status code. - **403 (Forbidden)** - **message** (string) - Error message. - **status** (integer) - HTTP status code. - **404 (Not Found)** - **message** (string) - Error message. - **status** (integer) - HTTP status code. - **422 (Unprocessable Entity)** - **message** (string) - Error message. - **status** (integer) - HTTP status code. - **500 (Internal Server Error)** - **message** (string) - Error message. - **status** (integer) - HTTP status code. #### Response Example (Success) ``` (binary data - gzip compressed file) ``` #### Response Example (Error 401) ```json { "message": "string", "status": 401 } ``` ``` -------------------------------- ### Get Single Project Code by Identifier (GET) Source: https://enterprise.wikimedia.com/docs/metadata Retrieves information for a specific project code (project type) using its unique identifier. This endpoint allows fetching details like name and description for a single project. It supports optional field selection for the response. ```http GET https://api.enterprise.wikimedia.com/v2/codes/{identifier} Parameters: - `identifier` (string, required): Identifier of the code. - `fields` (array, optional): Select which fields to receive in your response. ``` -------------------------------- ### Example Protection Data Structure Source: https://enterprise.wikimedia.com/docs/data-dictionary Demonstrates the structure of the 'protection' array, which lists community-specific protections and restrictions on an article. Each object specifies the type of protection, the required editor level, and the expiry duration. ```json [ { "type": "edit", "level": "autoconfirmed", "expiry": "infinity" }, { "type": "move", "level": "autoconfirmed", "expiry": "infinity" } ] ``` -------------------------------- ### Example Version Tags Data Structure Source: https://enterprise.wikimedia.com/docs/data-dictionary Illustrates the format of the 'tags' array within the 'version' object. This array contains strings representing tags attached to a specific revision, often indicating campaign participation or edit types. ```json { "mobile edit", "mobile app edit", "android app edit" } ``` -------------------------------- ### Check Available Hourly Batches Source: https://enterprise.wikimedia.com/docs/best-practices Before downloading a Batch, check if that Batch is available using this method. This example shows how to check for available hourly batches on a specific date and time. ```APIDOC ## POST /v2/batches/{date}/{hour} ### Description Checks for the availability of hourly batches for a given date and hour. ### Method POST ### Endpoint `/v2/batches/{date}/{hour}` ### Parameters #### Path Parameters - **date** (string) - Required - The date in 'YYYY-MM-DD' format. - **hour** (string) - Required - The hour in 'HH' format (00-23). #### Query Parameters None #### Request Body None ### Request Example ```curl curl --location --request POST 'https://api.enterprise.wikimedia.com/v2/batches/2025-08-26/00' \ --header 'Authorization: Bearer ACCESS_TOKEN' ``` ### Response #### Success Response (200) - **batches** (array) - A list of available batch identifiers. #### Response Example ```json { "batches": [ "batch_id_1", "batch_id_2" ] } ``` ``` -------------------------------- ### Retrieve Hourly Batches (GET) Source: https://enterprise.wikimedia.com/docs/realtime Fetches a list of available Realtime (Batch) bundles for a specific date and hour. Supports filtering by fields and projects/languages. The response includes identifiers, file sizes, and other relevant metadata for each batch. ```HTTP GET https://api.enterprise.wikimedia.com/v2/batches/{date}/{hour} ``` -------------------------------- ### GET /v2/batches/{date}/{hour}/{identifier} Source: https://enterprise.wikimedia.com/docs/realtime Retrieves metadata for a specific hourly batch, including identifier, file size, and other relevant details. You can also specify which fields to include in the response. ```APIDOC ## GET /v2/batches/{date}/{hour}/{identifier} ### Description Information on specific hourly batch. Includes identifier, file size and other relevant metadata. ### Method GET ### Endpoint https://api.enterprise.wikimedia.com/v2/batches/{date}/{hour}/{identifier} ### Parameters #### Path Parameters - **date** (string) - Required - **hour** (string) - Required - **identifier** (string) - Required - Batch identifier. #### Query Parameters - **fields** (array) - Optional - Select which fields to receive in your response. ### Response #### Success Response (200) - **identifier** (string) - **name** (string) - **version** (string) - **in_language** (object) - **identifier** (string) - **name** (string) - **alternate_name** (string) - **direction** (string) - **is_part_of** (object) - **identifier** (string) - **code** (string) - **name** (string) - **url** (string) - **in_language** (object) - **identifier** (string) - **name** (string) - **alternate_name** (string) - **direction** (string) - **namespace** (object) - **identifier** (number) - **name** (string) - **description** (string) - **size** (object) - **unit_text** (string) - **value** (number) #### Response Example ```json { "identifier": "string", "name": "string", "version": "string", "in_language": { "identifier": "string", "name": "string", "alternate_name": "string", "direction": "string" }, "is_part_of": { "identifier": "string", "code": "string", "name": "string", "url": "string", "in_language": { "identifier": "string", "name": "string", "alternate_name": "string", "direction": "string" } }, "namespace": { "identifier": "number", "name": "string", "description": "string" }, "size": { "unit_text": "string", "value": "number" } } ``` #### Error Responses - **401 (Unauthorized)**: Invalid credentials. - **403 (Forbidden)**: Insufficient permissions. - **404 (Not Found)**: The specified batch was not found. - **422 (Unprocessable Entity)**: Invalid request format. - **500 (Internal Server Error, Retry Request)**: Server error, please retry. ``` -------------------------------- ### Get a Snapshot API Source: https://enterprise.wikimedia.com/docs/index Downloads a compressed HTML dump of all articles for a specified project. The snapshot identifier is constructed using language, project name, and namespace information. ```APIDOC ## GET /v2/snapshots/{snapshot_identifier}/download ### Description Downloads a compressed file (HTML dump) containing all articles for a given project. The response is saved to a specified output file. ### Method GET ### Endpoint https://api.enterprise.wikimedia.com/v2/snapshots/{snapshot_identifier}/download ### Parameters #### Path Parameters - **snapshot_identifier** (string) - Required - The identifier for the snapshot, typically formatted as `_namespace_` (e.g., "enwiki_namespace_0"). #### Query Parameters None #### Request Body None ### Request Example ```bash curl -H "Authorization: Bearer ACCESS_TOKEN" -L https://api.enterprise.wikimedia.com/v2/snapshots/enwiki_namespace_0/download --output enwiki.tar.gz ``` ### Response #### Success Response (200) A compressed file (e.g., `.tar.gz`) containing the snapshot data. The content of the uncompressed file is NDJSON, with each line representing a single article. #### Response Example (Binary data representing a compressed file. Uncompressed content example below) ```json { "title": "NASA", "text": "The National Aeronautics and Space Administration (NASA) is an independent agency of the U.S. federal government responsible for the civil space program, as well as aeronautics and space research.\n...", "redirect": false, "namespace": 0, "timestamp": "2023-01-01T12:00:00Z", "..." } ``` ``` -------------------------------- ### Article Response Structure - JSON Source: https://enterprise.wikimedia.com/docs/on-demand Example JSON structure for a successful article lookup (200 OK) from the Enterprise Wikimedia API. It details various fields such as article body, metadata, and version information. ```JSON [ { "event": { "identifier": "string", "type": "string", "date_created": "string" }, "additional_entities": "array", "article_body": { "html": "string", "wikitext": "string" }, "has_parts": "array", "categories": "array", "date_modified": "string", "identifier": "integer", "in_language": { "identifier": "string", "name": "string", "alternate_name": "string", "direction": "string" }, "is_part_of": { "identifier": "string", "code": "string", "name": "string", "url": "string", "in_language": { "identifier": "string", "name": "string", "alternate_name": "string", "direction": "string" } }, "license": "array", "main_entity": { "identifier": "string", "url": "string" }, "name": "string", "abstract": "string", "namespace": { "identifier": "number", "name": "string", "description": "string" }, "protection": "array", "redirects": "array", "templates": "array", "url": "string", "version": { "comment": "string", "editor": { "date_started": "string", "edit_count": "integer", "groups": "array", "identifier": "integer", "is_anonymous": "boolean", "is_bot": "boolean", "name": "string" }, "identifier": "integer", "is_flagged_stable": "boolean", "is_minor_edit": "boolean", "noindex": "boolean", "scores": { "revertrisk": { "prediction": "boolean", "probability": "object" }, "referencerisk": { "reference_risk_score": "number" }, "referenceneed": { "reference_need_score": "number" } }, "maintenance_tags": { "citation_needed_count": "integer", "pov_count": "integer", "clarification_needed_count": "integer", "update_count": "integer" }, "tags": "array" }, "visibility": { "comment": "boolean", "text": "boolean", "user": "boolean" } } ] ``` -------------------------------- ### On-demand Get Article API Source: https://enterprise.wikimedia.com/docs/index Retrieves a specific article (page) on demand from a given project. The response format is similar to the Snapshot API but provides the live version of the article. ```APIDOC ## POST /v2/articles/{article_title} ### Description Fetches the live version of a specific article from a project. This endpoint allows for individual article queries, providing up-to-date content. ### Method POST ### Endpoint https://api.enterprise.wikimedia.com/v2/articles/{article_title} ### Parameters #### Path Parameters - **article_title** (string) - Required - The title of the article to retrieve (e.g., "NASA"). #### Query Parameters None #### Request Body - **filters** (array) - Optional - An array of filter objects to narrow down the search. Each object should have: - **field** (string) - The field to filter on (e.g., "is_part_of.identifier"). - **value** (string) - The value to match for the filter. - **limit** (integer) - Optional - The maximum number of results to return. Defaults to 1 if not specified. ### Request Example ```json { "filters": [ { "field": "is_part_of.identifier", "value": "enwiki" } ], "limit": 1 } ``` ```bash curl -X 'POST' \ 'https://api.enterprise.wikimedia.com/v2/articles/NASA' \ -H 'accept: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ \ "filters": [ \ { \ "field": "is_part_of.identifier", \ "value": "enwiki" \ } \ ], \ "limit": 1 \ }' ``` ### Response #### Success Response (200) - **articles** (array) - An array containing the requested article(s) in JSON format. Each article object includes fields like: - **title** (string) - The title of the article. - **text** (string) - The content of the article. - **namespace** (integer) - The namespace of the article. - **timestamp** (string) - The last modification timestamp. - ... (other article-specific fields) #### Response Example ```json { "articles": [ { "title": "NASA", "text": "The National Aeronautics and Space Administration (NASA) is an independent agency of the U.S. federal government responsible for the civil space program, as well as aeronautics and space research.\n...", "namespace": 0, "timestamp": "2023-10-27T10:00:00Z", "is_part_of": { "identifier": "enwiki" }, "..." } ] } ``` ``` -------------------------------- ### POST /v2/articles/{article_title} Source: https://enterprise.wikimedia.com/docs/filtering Fetch article data, filtering results by language using the `filters` parameter in the request body. This example shows how to get data specifically for French articles. ```APIDOC ## POST /v2/articles/{article_title} ### Description This endpoint retrieves data for a specific article. It allows filtering the results by specifying criteria in the `filters` parameter within the JSON request body, such as filtering by language. ### Method POST ### Endpoint /v2/articles/{article_title} ### Parameters #### Path Parameters - **article_title** (string) - Required - The title of the article to retrieve. #### Request Body - **filters** (array) - Optional - An array of filter objects. Each object must contain a `field` and a `value`. Example: `[{"field":"in_language.identifier", "value": "fr"}]` to filter for French articles. ### Request Example ```bash curl --location 'https://api.enterprise.wikimedia.com/v2/articles/Marie_Curie' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ACCESS_TOKEN' \ --data '{ "filters": [ { "field":"in_language.identifier", "value": "fr" } ] }' ``` ### Response #### Success Response (200) - **title** (string) - The title of the article. - **language** (string) - The language identifier of the article. #### Response Example ```json { "title": "Marie Curie", "language": "fr" } ``` ``` -------------------------------- ### Get Single Article (NASA) via On-demand API (cURL) Source: https://enterprise.wikimedia.com/docs/index This cURL command demonstrates how to fetch a single article, using 'NASA' in English Wikipedia as an example, via the On-demand API. It sends a POST request with authorization and specifies filters for the project. The response is a JSON object containing the live version of the article. ```curl curl -X 'POST' \ 'https://api.enterprise.wikimedia.com/v2/articles/NASA' \ -H 'accept: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "filters": [ { "field": "is_part_of.identifier", "value": "enwiki" } ], "limit": 1 }' ``` -------------------------------- ### Download Full Snapshot Bundle via cURL Source: https://enterprise.wikimedia.com/docs/best-practices This cURL example demonstrates how to download an entire snapshot bundle. The endpoint includes the date and the snapshot identifier. This method is suitable for downloading large projects, although chunking is recommended for very large datasets. ```cURL curl --location 'https://api.enterprise.wikimedia.com/v2/hourlys/2022-08-14/dewiki_namespace_0/download' \ --header 'Authorization: Bearer ACCESS_TOKEN' ``` -------------------------------- ### List Snapshot Chunks (GET Request) Source: https://enterprise.wikimedia.com/docs/snapshot Retrieves a list of available chunks for a specific snapshot identifier. This GET request supports filtering by fields and projects/languages. It returns detailed metadata about the snapshot and its chunks. Dependencies include the `snapshot_identifier` path parameter. ```http GET https://api.enterprise.wikimedia.com/v2/snapshots/{snapshot_identifier}/chunks Parameters: Path: snapshot_identifier (string, required): e.g., `dewiki_namespace_14` Query: fields (array, optional): Select fields to receive. filters (array, optional): Select projects and languages. ``` -------------------------------- ### Get All Project Codes (GET) Source: https://enterprise.wikimedia.com/docs/metadata Retrieves a list of all available project codes (project types) from the Wikimedia Enterprise API. Supports filtering by fields and specific projects/languages via query parameters. The response includes project identifier, name, and description. ```http GET https://api.enterprise.wikimedia.com/v2/codes Parameters: - `fields` (array, optional): Select which fields to receive in your response. - `filters` (array, optional): Select which projects and languages to receive in your response. ``` -------------------------------- ### GET /v2/structured-contents/{name} Source: https://enterprise.wikimedia.com/docs/on-demand Retrieves the structured representation of a specific article by its name. ```APIDOC ## GET /v2/structured-contents/{name} ### Description Lookup for the structured representation of the Article. ### Method GET ### Endpoint https://api.enterprise.wikimedia.com/v2/structured-contents/{name} ### Parameters #### Path Parameters - **name** (string) - Required - Article name. #### Query Parameters - **limit** (integer) - Optional - Limit of articles to return. - **fields** (array) - Optional - Select which fields to receive in your response. - **filters** (array) - Optional - Select which projects and languages to receive in your response. ### Request Example ```json { "name": "ExampleArticle" } ``` ### Response #### Success Response (200) - **name** (string) - The name of the article. - **identifier** (integer) - A unique identifier for the article. - **abstract** (string) - A brief summary of the article. - **description** (string) - A more detailed description of the article. - **url** (string) - The URL of the article. - **date_created** (string) - The date the article was created. - **date_modified** (string) - The date the article was last modified. - **infoboxes** (array) - A list of infobox data associated with the article. - **sections** (array) - A list of sections within the article. - **main_entity** (object) - Information about the main entity discussed in the article. - **identifier** (string) - Identifier of the main entity. - **url** (string) - URL of the main entity. - **additional_entities** (array) - A list of additional entities mentioned in the article. - **image** (object) - Information about the primary image of the article. - **content_url** (string) - URL of the image content. - **width** (string) - Width of the image. - **height** (string) - Height of the image. - **caption** (string) - Caption for the image. - **alternative_text** (string) - Alternative text for the image. - **version** (object) - Details about the current version of the article. - **comment** (string) - Comment associated with the version. - **editor** (object) - Information about the editor of this version. - **date_started** (string) - The date the editor started. - **edit_count** (integer) - The total number of edits made by the editor. - **groups** (array) - Groups the editor belongs to. - **identifier** (integer) - Unique identifier for the editor. - **is_anonymous** (boolean) - Indicates if the editor is anonymous. - **is_bot** (boolean) - Indicates if the editor is a bot. - **name** (string) - The name of the editor. - **identifier** (integer) - Unique identifier for the version. - **is_flagged_stable** (boolean) - Indicates if the version is flagged as stable. - **is_minor_edit** (boolean) - Indicates if this was a minor edit. - **noindex** (boolean) - Indicates if the page should not be indexed. - **scores** (object) - Various risk and relevance scores for the version. - **revertrisk** (object) - Revert risk assessment. - **prediction** (boolean) - Prediction of revert risk. - **probability** (object) - Probability details. - **referencerisk** (object) - Reference risk assessment. - **reference_risk_score** (number) - Score for reference risk. - **referenceneed** (object) - Reference need assessment. - **reference_need_score** (number) - Score for reference need. - **maintenance_tags** (object) - Maintenance tags applied to the article. - **citation_needed_count** (integer) - Number of "citation needed" tags. - **pov_count** (integer) - Number of "point of view" tags. - **clarification_needed_count** (integer) - Number of "clarification needed" tags. - **update_count** (integer) - Number of "update needed" tags. - **tags** (array) - Other tags associated with the version. - **is_part_of** (object) - Information about the larger work this article is part of. - **identifier** (string) - Identifier of the parent work. - **code** (string) - Code for the parent work. - **name** (string) - Name of the parent work. - **url** (string) - URL of the parent work. - **in_language** (object) - Language details of the parent work. - **identifier** (string) - Language code. - **name** (string) - Full language name. - **alternate_name** (string) - Alternate name for the language. - **direction** (string) - Text direction (e.g., LTR, RTL). - **in_language** (object) - Language details of the article. - **identifier** (string) - Language code. - **name** (string) - Full language name. - **alternate_name** (string) - Alternate name for the language. - **direction** (string) - Text direction (e.g., LTR, RTL). - **license** (object) - Licensing information for the article content. - **identifier** (string) - License identifier. - **name** (string) - Name of the license. - **url** (string) - URL for license details. - **references** (object) - Information about references used in the article. - **identifier** (string) - Identifier for the reference. - **group** (string) - Group the reference belongs to. - **type** (string) - Type of reference. - **metadata** (object) - Metadata associated with the reference. - **text** (object) - Text content of the reference. - **source** (object) - Source information for the reference. - **tables** (object) - Information about tables within the article. - **identifier** (string) - Identifier for the table. - **headers** (array) - Table headers. - **rows** (array) - Table rows. - **confidence_score** (number) - Confidence score for the table data. #### Response Example (200 OK) ```json [ { "name": "string", "identifier": "integer", "abstract": "string", "description": "string", "url": "string", "date_created": "string", "date_modified": "string", "infoboxes": [], "sections": [], "main_entity": { "identifier": "string", "url": "string" }, "additional_entities": [], "image": { "content_url": "string", "width": "string", "height": "string", "caption": "string", "alternative_text": "string" }, "version": { "comment": "string", "editor": { "date_started": "string", "edit_count": "integer", "groups": [], "identifier": "integer", "is_anonymous": false, "is_bot": false, "name": "string" }, "identifier": "integer", "is_flagged_stable": false, "is_minor_edit": false, "noindex": false, "scores": { "revertrisk": { "prediction": false, "probability": {} }, "referencerisk": { "reference_risk_score": 0.5 }, "referenceneed": { "reference_need_score": 0.5 } }, "maintenance_tags": { "citation_needed_count": 0, "pov_count": 0, "clarification_needed_count": 0, "update_count": 0 }, "tags": [] }, "is_part_of": { "identifier": "string", "code": "string", "name": "string", "url": "string", "in_language": { "identifier": "string", "name": "string", "alternate_name": "string", "direction": "string" } }, "in_language": { "identifier": "string", "name": "string", "alternate_name": "string", "direction": "string" }, "license": { "identifier": "string", "name": "string", "url": "string" }, "references": { "identifier": "string", "group": "string", "type": "string", "metadata": {}, "text": {}, "source": {} }, "tables": { "identifier": "string", "headers": [], "rows": [], "confidence_score": 0.5 } } ] ``` #### Error Responses - **401 Unauthorized**: Returned when authentication is missing or invalid. - **403 Forbidden**: Returned when the user does not have permission to access the resource. - **404 Not Found**: Returned when the specified article does not exist. - **422 Unprocessable Entity**: Returned when the request parameters are invalid. - **500 Internal Server Error**: Returned when the server encounters an unexpected error. ``` -------------------------------- ### Get All Project Codes with Filters (POST) Source: https://enterprise.wikimedia.com/docs/metadata Submits a POST request to the Wikimedia Enterprise API to retrieve project codes with specified filters. This endpoint allows for dynamic filtering of results based on provided fields and filter criteria in the request body. The response structure is similar to the GET request. ```http POST https://api.enterprise.wikimedia.com/v2/codes Request Body: ```json { "fields": [ "name", "identifier" ], "filters": [ { "field": "identifier", "value": "wiki" } ] } ``` ``` -------------------------------- ### HEAD /v2/batches/{date}/{hour}/{identifier}/download Source: https://enterprise.wikimedia.com/docs/realtime Retrieves the headers that describe the hourly download batch. Useful for checking metadata without downloading the entire file. ```APIDOC ## HEAD /v2/batches/{date}/{hour}/{identifier}/download ### Description Retrieves a set of headers that describe the hourly download batch. This is useful for inspecting metadata before downloading the full content. ### Method HEAD ### Endpoint https://api.enterprise.wikimedia.com/v2/batches/{date}/{hour}/{identifier}/download ### Parameters #### Path Parameters - **date** (string) - Required - The date for the batch. - **hour** (string) - Required - The hour for the batch. - **identifier** (string) - Required - Batch identifier. ### Response #### Success Response (200) - **Headers** - Contains metadata about the batch file, such as Content-Type, Content-Length, etc. #### Error Responses - **401 (Unauthorized)** - **message** (string) - Error message. - **status** (integer) - HTTP status code. - **403 (Forbidden)** - **message** (string) - Error message. - **status** (integer) - HTTP status code. - **404 (Not Found)** - **message** (string) - Error message. - **status** (integer) - HTTP status code. - **422 (Unprocessable Entity)** - **message** (string) - Error message. - **status** (integer) - HTTP status code. - **500 (Internal Server Error)** - **message** (string) - Error message. - **status** (integer) - HTTP status code. #### Response Example (Success) ``` (HTTP Headers) ``` #### Response Example (Error 401) ```json { "message": "string", "status": 401 } ``` ```