Wikivoyage Files API

Media file metadata for travel images and maps

OpenAPI Specification

wikivoyage-files-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Wikivoyage MediaWiki Action Authentication Files API
  description: 'The MediaWiki Action API is the primary programmatic interface for Wikivoyage, exposed at https://en.wikivoyage.org/w/api.php. All operations dispatch via the ?action= query parameter. The API supports JSON, XML, and PHP serialization; JSON is the recommended format.


    Wikivoyage covers travel destinations worldwide and the Action API enables retrieval of travel destination articles, accommodation listings, sightseeing information, and practical travel advice. Supports both anonymous reads and authenticated writes via OAuth 2.0.


    Wikimedia Foundation API guidelines require a contactable User-Agent header, serial (not parallel) calls for bulk work, and the maxlag parameter for automated clients.'
  version: '1.47'
  x-generated-from: documentation
  x-source-url: https://www.mediawiki.org/wiki/API:Main_page
  x-last-validated: '2026-06-13'
  contact:
    name: Wikimedia Foundation
    url: https://www.mediawiki.org/wiki/API:Etiquette
  license:
    name: CC BY-SA 4.0
    url: https://creativecommons.org/licenses/by-sa/4.0/
servers:
- url: https://en.wikivoyage.org/w
  description: English Wikivoyage
- url: https://{lang}.wikivoyage.org/w
  description: Per-language Wikivoyage
  variables:
    lang:
      default: en
      description: Language code (en, de, fr, es, it, pt, ru, zh, ...)
tags:
- name: Files
  description: Media file metadata for travel images and maps
paths:
  /file/{title}:
    get:
      operationId: getFile
      summary: Wikivoyage Core REST Get Travel Image File Metadata
      description: Retrieve metadata for a media file used in Wikivoyage, including download URLs at multiple sizes. Travel images are hosted on Wikimedia Commons.
      tags:
      - Files
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      parameters:
      - name: title
        in: path
        required: true
        schema:
          type: string
        example: File:Paris_banner_Sacre-Coeur.jpg
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    File:
      type: object
      description: A travel image or map file descriptor.
      properties:
        title:
          type: string
          example: File:Paris_banner_Sacre-Coeur.jpg
        file_description_url:
          type: string
          format: uri
        latest:
          type: object
          properties:
            timestamp:
              type: string
              format: date-time
            user:
              type: object
              properties:
                id:
                  type: integer
                name:
                  type: string
        preferred:
          type: object
          properties:
            mediatype:
              type: string
              example: BITMAP
            size:
              type: integer
            width:
              type: integer
            height:
              type: integer
            url:
              type: string
              format: uri
        original:
          type: object
          properties:
            mediatype:
              type: string
            size:
              type: integer
            width:
              type: integer
            height:
              type: integer
            url:
              type: string
              format: uri
    Error:
      type: object
      properties:
        errorKey:
          type: string
        messageTranslations:
          type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 bearer token from meta.wikimedia.org
    CookieAuth:
      type: apiKey
      in: cookie
      name: wikivoyagewikiUserID
      description: Session cookie obtained via action=login or action=clientlogin