Wikisource Math API

formula rendering

Operations 3

POST /media/math/check/{type} Check and normalize a TeX formula #
GET /media/math/formula/{hash} Get a previously-stored formula #
GET /media/math/render/{format}/{hash} Get rendered formula in the given format #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/wikisource-math-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

wikisource-math-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.0.0
  title: Wikimedia REST Math API
  description: This API provides cacheable and straightforward access to Wikimedia content and data, in machine-readable formats.
  termsOfService: https://wikimediafoundation.org/wiki/Terms_of_Use
  contact:
    name: the Wikimedia Services team
    url: http://mediawiki.org/wiki/Wikimedia_REST_API
  license:
    name: Apache2
    url: http://www.apache.org/licenses/LICENSE-2.0
servers:
- url: /api/rest_v1
tags:
- name: Math
  description: formula rendering
paths:
  /media/math/check/{type}:
    post:
      deprecated: true
      tags:
      - Math
      summary: Check and normalize a TeX formula
      description: 'Checks the supplied TeX formula for correctness and returns the

        normalised formula representation as well as information about

        identifiers. Available types are tex and inline-tex. The response

        contains the `x-resource-location` header which can be used to retrieve

        the render of the checked formula in one of the supported rendering

        formats. Just append the value of the header to `/media/math/{format}/`

        and perform a GET request against that URL.


        **NOTE**: the use of this endpoint is *strongly discouraged*. Instead, use the identical endpoint of the (canonical) Math API on the `wikimedia.org` domain.


        Stability: deprecated.'
      parameters:
      - name: type
        in: path
        description: The input type of the given formula; can be tex or inline-tex
        required: true
        schema:
          type: string
          enum:
          - tex
          - inline-tex
          - chem
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
              - q
              properties:
                q:
                  type: string
                  description: The formula to check
        required: true
      responses:
        '200':
          description: Information about the checked formula
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid type
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/problem'
        default:
          description: Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/problem'
      x-monitor: true
      x-amples:
      - title: Mathoid - check test formula
        request:
          params:
            domain: wikimedia.org
            type: tex
          body:
            q: E=mc^{2}
        response:
          status: 200
          headers:
            content-type: /^application\/json/
            x-resource-location: /.+/
            cache-control: no-cache
          body:
            success: true
            checked: /.+/
      operationId: postMediaMathCheckByType
      x-operation-id-source: derived
  /media/math/formula/{hash}:
    get:
      deprecated: true
      tags:
      - Math
      summary: Get a previously-stored formula
      description: 'Returns the previously-stored formula via `/media/math/check/{type}` for

        the given hash.


        **NOTE**: the use of this endpoint is *strongly discouraged*. Instead, use the identical endpoint of the (canonical) Math API on the `wikimedia.org` domain.


        Stability: deprecated.'
      parameters:
      - name: hash
        in: path
        description: The hash string of the previous POST data
        required: true
        schema:
          minLength: 1
          type: string
      responses:
        '200':
          description: Information about the checked formula
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Data for the given hash cannot be found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/problem'
        default:
          description: Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/problem'
      x-monitor: false
      operationId: getMediaMathFormulaByHash
      x-operation-id-source: derived
  /media/math/render/{format}/{hash}:
    get:
      deprecated: true
      tags:
      - Math
      summary: Get rendered formula in the given format
      description: 'Given a request hash, renders a TeX formula into its mathematic

        representation in the given format. When a request is issued to the

        `/media/math/check/{format}` POST endpoint, the response contains the

        `x-resource-location` header denoting the hash ID of the POST data. Once

        obtained, this endpoint has to be used to obtain the actual render.


        **NOTE**: the use of this endpoint is *strongly discouraged*. Instead, use the identical endpoint of the (canonical) Math API on the `wikimedia.org` domain.


        Stability: deprecated.'
      parameters:
      - name: format
        in: path
        description: The output format; can be svg or mml
        required: true
        schema:
          type: string
          enum:
          - svg
          - mml
          - png
      - name: hash
        in: path
        description: The hash string of the previous POST data
        required: true
        schema:
          minLength: 1
          type: string
      responses:
        '200':
          description: The rendered formula
          content:
            image/svg+xml:
              schema:
                type: string
            application/mathml+xml:
              schema:
                type: string
        '404':
          description: Unknown format or hash ID
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/problem'
        default:
          description: Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/problem'
      x-monitor: false
      operationId: getMediaMathRenderByFormatByHash
      x-operation-id-source: derived
components:
  schemas:
    problem:
      required:
      - type
      type: object
      properties:
        type:
          type: string
        title:
          type: string
        detail:
          type: string
        instance:
          type: string
x-host-basePath: /api/rest_v1
x-default-params: {}