openapi: 3.1.0 info: title: Wikimedia Enterprise API spec articles structured-contents API 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 security: - bearerAuth: [] tags: - 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/ paths: /v2/structured-contents/{name}: summary: Structured Contents Article Lookup (Beta) description: Lookup for the structured representation of the Article. get: tags: - structured-contents parameters: - in: path name: name description: Article name. required: true schema: type: string minLength: 1 - in: query name: limit description: Limit of articles to return. schema: type: integer default: 3 - in: query name: fields description: Select which fields to receive in your response, using JSON dot notation. schema: type: array items: type: string example: name - in: query name: filters description: Select which projects and languages to receive in your response. schema: type: array items: $ref: '#/components/schemas/filter' responses: 200: description: OK content: application/json: schema: type: array format: json items: $ref: '#/components/schemas/structured-content' application/x-ndjson: schema: type: string format: ndjson example: '[{"identifier":0,"name":"string","in_language":{"identifier":"string"},"is_part_of":{"identifier":"string"},"infoboxes":[],"main_entity":{"identifier":"string","url":"string"},{"name":"Abstract","type":"section","has_parts":[{"type":"paragraph","value":"string","links":[{"url":"string","text":"string"},{"url":"string","text":"string"}]},{ "type": "table", "table_references": [{ "identifier": "string", "confidence_score": 1}]},{"name":"string","type":"section","has_parts":[{"type":"list","has_parts":[{"type":"list_item","value":"string"},{"type":"list_item","value":"string","links":[{"url":"string","text":"string"}]}]}]}]}}] [{"identifier":0,"name":"string","in_language":{"identifier":"string"},"is_part_of":{"identifier":"string"},"infoboxes":[],"main_entity":{"identifier":"string","url":"string"},{"name":"Abstract","type":"section","has_parts":[{"type":"paragraph","value":"string","links":[{"url":"string","text":"string"},{"url":"string","text":"string"}]},{ "type": "table", "table_references": [{ "identifier": "string", "confidence_score": 1}]},{"name":"string","type":"section","has_parts":[{"type":"list","has_parts":[{"type":"list_item","value":"string"},{"type":"list_item","value":"string","links":[{"url":"string","text":"string"}]}]}]}]}}] ' 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: tags: - structured-contents parameters: - in: path name: name description: Article name. required: true 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 filters: type: array description: Select which projects and languages to receive in your response. items: $ref: '#/components/schemas/filter' example: '[{"field": "in_language.identifier","value": "en"}]' limit: type: integer description: Limit of articles to return. default: 3 responses: 200: description: OK content: application/json: schema: type: array format: json items: $ref: '#/components/schemas/structured-content' application/x-ndjson: schema: type: string format: ndjson example: '[{"identifier":0,"name":"string","in_language":{"identifier":"string"},"is_part_of":{"identifier":"string"},"infoboxes":[],"main_entity":{"identifier":"string","url":"string"},{"name":"Abstract","type":"section","has_parts":[{"type":"paragraph","value":"string","links":[{"url":"string","text":"string"},{"url":"string","text":"string"}]},{ "type": "table", "table_references": [{ "identifier": "string", "confidence_score": 1}]},{"name":"string","type":"section","has_parts":[{"type":"list","has_parts":[{"type":"list_item","value":"string"},{"type":"list_item","value":"string","links":[{"url":"string","text":"string"}]}]}]}]}}] [{"identifier":0,"name":"string","in_language":{"identifier":"string"},"is_part_of":{"identifier":"string"},"infoboxes":[],"main_entity":{"identifier":"string","url":"string"},{"name":"Abstract","type":"section","has_parts":[{"type":"paragraph","value":"string","links":[{"url":"string","text":"string"},{"url":"string","text":"string"}]},{ "type": "table", "table_references": [{ "identifier": "string", "confidence_score": 1}]},{"name":"string","type":"section","has_parts":[{"type":"list","has_parts":[{"type":"list_item","value":"string"},{"type":"list_item","value":"string","links":[{"url":"string","text":"string"}]}]}]}]}}] ' 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: license: type: object properties: identifier: type: string example: CC-BY-SA-4.0 name: type: string example: Creative Commons Attribution-ShareAlike License 4.0 url: type: string example: https://creativecommons.org/licenses/by-sa/4.0/ project: type: object properties: identifier: type: string example: enwiki code: type: string example: wiki name: type: string example: Wikipedia url: type: string example: https://en.wikipedia.org in_language: $ref: '#/components/schemas/language' revertrisk: properties: prediction: type: boolean probability: properties: 'false': type: number 'true': type: number type: object type: object link: type: object properties: url: type: string text: type: string images: type: array items: $ref: '#/components/schemas/image' editor: properties: date_started: type: string edit_count: type: integer groups: items: type: string type: array identifier: type: integer is_anonymous: type: boolean is_bot: type: boolean name: type: string type: object referenceneed: properties: reference_need_score: type: number type: object citation: type: object properties: identifier: type: string group: type: string text: type: string reference: type: object properties: identifier: type: string group: type: string type: type: string metadata: type: object text: type: object properties: value: type: string links: type: array items: $ref: '#/components/schemas/link' source: type: object properties: value: type: string links: type: array items: $ref: '#/components/schemas/link' parent_reference: type: string scores: properties: revertrisk: $ref: '#/components/schemas/revertrisk' referencerisk: $ref: '#/components/schemas/referencerisk' referenceneed: $ref: '#/components/schemas/referenceneed' type: object structured-content: properties: name: type: string identifier: type: integer abstract: type: string description: type: string url: type: string date_created: type: string date_modified: type: string infoboxes: type: array items: $ref: '#/components/schemas/part' sections: type: array items: $ref: '#/components/schemas/part' main_entity: $ref: '#/components/schemas/entity' additional_entities: type: array items: $ref: '#/components/schemas/entity' image: $ref: '#/components/schemas/image' version: $ref: '#/components/schemas/version' is_part_of: $ref: '#/components/schemas/project' in_language: $ref: '#/components/schemas/language' license: $ref: '#/components/schemas/license' references: $ref: '#/components/schemas/reference' tables: $ref: '#/components/schemas/table' type: object part: type: object properties: name: type: string type: type: string value: type: string values: type: array items: type: string has_parts: type: array items: type: object images: type: array items: $ref: '#/components/schemas/image' links: type: array items: $ref: '#/components/schemas/link' citations: type: array items: $ref: '#/components/schemas/citation' maintenance_tags: properties: citation_needed_count: type: integer pov_count: type: integer clarification_needed_count: type: integer update_count: type: integer type: object table: type: object properties: identifier: type: string headers: type: array items: type: array items: type: object properties: value: type: string rows: type: array items: type: array items: type: object properties: value: type: string confidence_score: type: number minimum: 0 maximum: 1 entity: type: object properties: identifier: type: string url: type: string version: properties: comment: type: string editor: $ref: '#/components/schemas/editor' identifier: type: integer is_flagged_stable: type: boolean is_minor_edit: type: boolean noindex: type: boolean scores: $ref: '#/components/schemas/scores' maintenance_tags: $ref: '#/components/schemas/maintenance_tags' tags: items: type: string type: array type: object filter: type: object properties: field: type: string value: type: string image: type: object properties: content_url: description: Image URL format: uri type: string example: https://upload.wikimedia.org/wikipedia/en/thumb/0/03/Flag_of_Italy.svg/40px-Flag_of_Italy.svg.png identifier: type: string format: uuid description: Unique identifier for the image example: 6c71e85942c77b40266b6d6150405719897682f4b56989100f7c5de97fa631d0 name: type: string description: Filename of the image example: ./File:Flag_of_Italy.svg width: description: image width in pixels type: integer example: 156 height: description: image height in pixels type: integer example: 255 thumbnail: $ref: '#/components/schemas/thumbnail' caption: type: string description: caption describing the image example: Flag of Italy alternative_text: type: string description: Alternative text description of the image for accessibility example: a flag divided in three vertical sections colored green, white, and red from left to right encoding_format: type: string format: mime_type description: MIME type or encoding format of the image, constructed from the url example: image/png media_type: type: string enum: unknown, bitmap, drawing, audio, video, multimedia, office, text, executable, archive description: Mediawiki media type of the image example: drawing error: type: object properties: message: type: string status: type: integer language: type: object properties: identifier: type: string example: en name: type: string example: English alternate_name: type: string example: English direction: type: string example: ltr thumbnail: type: object properties: contentUrl: type: string format: uri description: Thumbnail URL width: description: Thumbnail width in pixels type: integer example: 156 height: description: Thumbnail height in pixels type: integer example: 255 referencerisk: properties: reference_risk_score: type: number type: object securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT