openapi: "3.0.2"
info:
  title: "ExchangeRate-API"
  description: "Fetch the latest currency exchange rates via API. ExchangeRate-API is free and unlimited."
  version: "4"
  termsOfService: https://www.exchangerate-api.com/terms
servers:
  - url: https://api.exchangerate-api.com/v4
    description: "No authentication endpoint. Returns latest exchange rates and some metadata."
paths:
  /latest/{base_currency}:
    get:
      summary: "Returns latest exchange rates in parameter-supplied base currency."
      parameters:
      - name: base_currency
        in: path
        description: "**Base Currency**. *Example: USD*. You an use any of the ISO 4217 currency codes we support. See https://www.exchangerate-api.com/docs/supported-currencies"
        schema:
          type: string
        required: true
      responses:
        '200':
          description: "Successful response"
          content:
            application/json:
              schema:
                type: object
                properties:
                  base:
                    type: string
                    description: "The currency code you supplied as base in your request"
                    example: USD
                  date:
                    type: string
                    description: "The date these exchange rates are for"
                  time_last_updated:
                    type: integer
                    description: "The epoch time this set of exchange rates was generated"
                    example: 1556293443
                  rates:
                    type: object
                    description: "Each supported currency code in terms of the base currency"
                    additionalProperties:
                      type: number
                      format: double
        '404':
          description: Currency code not supported
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                  error_type:
                    type: string
externalDocs:
  description: API Documentation
  url: https://www.exchangerate-api.com/docs/documentation
