Fixer Conversion API

On-demand currency amount conversion.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

fixer-conversion-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Fixer Conversion API
  description: 'Fixer is a lightweight JSON API for real-time and historical foreign exchange

    rates and currency conversion. Sourced primarily from the European Central Bank

    and 15+ other exchange rate data providers, Fixer supports 170+ world currencies.


    The API is delivered via the APILayer marketplace. All requests authenticate via

    an `apikey` HTTP header. The free tier is limited to 100 requests per month and

    is HTTP-only; HTTPS encryption and source-currency switching become available on

    the Basic plan and above.

    '
  version: 1.0.0
  contact:
    name: Fixer Support
    url: https://fixer.io/contact
  license:
    name: Commercial
    url: https://fixer.io/terms
  termsOfService: https://fixer.io/terms
  x-provider: fixer
  x-parent: apilayer
servers:
- url: https://api.apilayer.com/fixer
  description: APILayer-hosted production endpoint (current)
- url: http://data.fixer.io/api
  description: Legacy data.fixer.io endpoint (HTTP, free tier)
- url: https://data.fixer.io/api
  description: Legacy data.fixer.io endpoint (HTTPS, paid tiers)
security:
- ApiKeyAuth: []
tags:
- name: Conversion
  description: On-demand currency amount conversion.
paths:
  /convert:
    get:
      operationId: convertCurrency
      summary: Convert Currency Amount
      description: 'Converts an amount from one currency to another using real-time or historical

        rates. Available on Basic plan and above.

        '
      tags:
      - Conversion
      parameters:
      - name: from
        in: query
        required: true
        description: Three-letter source currency code (ISO 4217).
        schema:
          type: string
          example: GBP
      - name: to
        in: query
        required: true
        description: Three-letter target currency code (ISO 4217).
        schema:
          type: string
          example: JPY
      - name: amount
        in: query
        required: true
        description: Amount to convert.
        schema:
          type: number
          example: 25
      - name: date
        in: query
        required: false
        description: Optional historical date (YYYY-MM-DD) to use for the conversion rate.
        schema:
          type: string
          format: date
          example: '2018-02-22'
      responses:
        '200':
          description: Converted amount and conversion metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvertResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  responses:
    RateLimited:
      description: Monthly request quota exhausted or per-minute rate limit hit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid `apikey` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: The requested feature is not included in the current subscription plan.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    ErrorResponse:
      type: object
      required:
      - success
      - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: integer
              example: 104
            type:
              type: string
              example: monthly_limit_reached
            info:
              type: string
              example: Your monthly API request volume has been reached. Please upgrade your plan.
    ConvertResponse:
      type: object
      required:
      - success
      - query
      - info
      - result
      properties:
        success:
          type: boolean
          example: true
        query:
          type: object
          properties:
            from:
              type: string
              example: GBP
            to:
              type: string
              example: JPY
            amount:
              type: number
              example: 25
        info:
          type: object
          properties:
            timestamp:
              type: integer
              format: int64
              example: 1519328414
            rate:
              type: number
              example: 148.972231
        historical:
          type: boolean
          example: false
        date:
          type: string
          format: date
          example: '2018-02-22'
        result:
          type: number
          example: 3724.305775
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
      description: APILayer API key provisioned at https://apilayer.com/marketplace/fixer-api.