Wikivoyage Pages API

Travel article metadata, HTML, source, create, update

OpenAPI Specification

wikivoyage-pages-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Wikivoyage MediaWiki Action Authentication Pages 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: Pages
  description: Travel article metadata, HTML, source, create, update
paths:
  /page/{title}:
    get:
      operationId: getPage
      summary: Wikivoyage Core REST Get Travel Article Source and Metadata
      description: Retrieve a Wikivoyage travel article including its wikitext source and metadata. Returns the article's current revision along with page ID, title, license, and a link to the rendered HTML version.
      tags:
      - Pages
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      parameters:
      - name: title
        in: path
        required: true
        schema:
          type: string
        description: URL-encoded travel article title
        example: Paris
      - name: redirect
        in: query
        schema:
          type: string
          enum:
          - 'true'
          - 'false'
          - 'no'
        description: Whether to resolve redirects
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      operationId: updatePage
      summary: Wikivoyage Core REST Update or Create a Travel Article
      description: Update an existing Wikivoyage travel article, or create one if it does not exist. Uses optimistic concurrency via latest.id to prevent edit conflicts.
      tags:
      - Pages
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      parameters:
      - name: title
        in: path
        required: true
        schema:
          type: string
        description: URL-encoded travel article title
        example: Paris
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePageRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
      - BearerAuth: []
  /page/{title}/bare:
    get:
      operationId: getPageBare
      summary: Wikivoyage Core REST Get Travel Article Metadata Without Content
      description: Retrieve metadata about a travel article including a link to its rendered HTML, without fetching the full content.
      tags:
      - Pages
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      parameters:
      - name: title
        in: path
        required: true
        schema:
          type: string
        description: URL-encoded travel article title
        example: Paris
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /page/{title}/html:
    get:
      operationId: getPageHtml
      summary: Wikivoyage Core REST Get Travel Article as HTML
      description: Retrieve the rendered HTML for a Wikivoyage travel article destination page.
      tags:
      - Pages
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      parameters:
      - name: title
        in: path
        required: true
        schema:
          type: string
        description: URL-encoded travel article title
        example: Paris
      responses:
        '200':
          description: Rendered HTML travel article
          content:
            text/html:
              schema:
                type: string
  /page/{title}/with_html:
    get:
      operationId: getPageWithHtml
      summary: Wikivoyage Core REST Get Travel Article Metadata and HTML
      description: Retrieve travel article metadata together with rendered HTML in a single response. Useful for building travel apps that need both structured metadata and rendered content.
      tags:
      - Pages
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      parameters:
      - name: title
        in: path
        required: true
        schema:
          type: string
        description: URL-encoded travel article title
        example: Paris
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /page:
    post:
      operationId: createPage
      summary: Wikivoyage Core REST Create a New Travel Article
      description: Create a new Wikivoyage travel guide article. Requires OAuth bearer token.
      tags:
      - Pages
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePageRequest'
      responses:
        '201':
          description: Travel article created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page'
      security:
      - BearerAuth: []
components:
  schemas:
    CreatePageRequest:
      type: object
      required:
      - source
      - title
      - comment
      properties:
        source:
          type: string
          description: Wikitext source for the new travel article
          example: '''''''Paris'''''' is the capital city of [[France]].'
        title:
          type: string
          description: New travel article title
          example: Paris/Montmartre
        comment:
          type: string
          description: Edit summary
          example: Creating new district article for Montmartre
        content_model:
          type: string
          example: wikitext
        token:
          type: string
          description: CSRF token from Action API
    UpdatePageRequest:
      type: object
      required:
      - source
      - comment
      properties:
        source:
          type: string
          description: Updated wikitext source for the travel article
        comment:
          type: string
          description: Edit summary describing the travel information update
        content_model:
          type: string
          example: wikitext
        latest:
          type: object
          properties:
            id:
              type: integer
              description: Latest revision ID for optimistic concurrency
        token:
          type: string
          description: CSRF token from Action API
    Error:
      type: object
      properties:
        errorKey:
          type: string
        messageTranslations:
          type: object
    Page:
      type: object
      description: A Wikivoyage travel article page object.
      properties:
        id:
          type: integer
          example: 12345
          description: Page ID
        key:
          type: string
          example: Paris
          description: Page DB key (URL form)
        title:
          type: string
          example: Paris
          description: Display title of travel destination
        latest:
          type: object
          properties:
            id:
              type: integer
              example: 5234567
              description: Revision ID
            timestamp:
              type: string
              format: date-time
              example: '2026-06-13T10:00:00Z'
        content_model:
          type: string
          example: wikitext
        license:
          type: object
          properties:
            url:
              type: string
              format: uri
              example: https://creativecommons.org/licenses/by-sa/4.0/
            title:
              type: string
              example: Creative Commons Attribution-Share Alike 4.0
        html_url:
          type: string
          format: uri
        source:
          type: string
          description: Travel article wikitext source
        html:
          type: string
          description: Rendered HTML of travel article
  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