FXRatesAPI Time-Series API

Daily exchange rates across a date range.

OpenAPI Specification

fxratesapi-time-series-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: FXRates Convert Time-Series API
  description: 'FXRatesAPI is a foreign exchange rates REST API serving real-time and historical currency exchange rates for 185+ fiat currencies plus major cryptocurrencies and precious metals. All endpoints return JSON over HTTPS from the base host https://api.fxratesapi.com. A limited tier is usable without an API key; a paid API key (passed as the api_key query parameter or an Authorization Bearer header) raises quotas, increases update frequency, and unlocks base-currency switching.


    Endpoint paths, methods, and parameters below are grounded in live probes of the API on 2026-07-12. Response schemas are modeled from the observed JSON payloads rather than a provider-published machine-readable schema, and only parameters confirmed during probing are asserted; additional optional parameters may exist.'
  version: '1.0'
  contact:
    name: FXRatesAPI
    url: https://fxratesapi.com
  termsOfService: https://fxratesapi.com/legal/terms-conditions
servers:
- url: https://api.fxratesapi.com
  description: FXRatesAPI production
security:
- {}
- apiKeyQuery: []
- bearerAuth: []
tags:
- name: Time-Series
  description: Daily exchange rates across a date range.
paths:
  /timeseries:
    get:
      operationId: getTimeSeriesRates
      tags:
      - Time-Series
      summary: Get time-series exchange rates
      description: Returns daily exchange rates for each date across the requested range.
      parameters:
      - name: start_date
        in: query
        required: true
        description: Range start date in YYYY-MM-DD format.
        schema:
          type: string
          format: date
          example: '2026-01-01'
      - name: end_date
        in: query
        required: true
        description: Range end date in YYYY-MM-DD format.
        schema:
          type: string
          format: date
          example: '2026-01-05'
      - name: base
        in: query
        required: false
        description: Base currency code (ISO 4217). Defaults to USD.
        schema:
          type: string
          default: USD
      - name: currencies
        in: query
        required: false
        description: Comma-separated list of currency codes to return.
        schema:
          type: string
          example: EUR
      - name: api_key
        in: query
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Date-keyed exchange rates across the range.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimeSeriesResponse'
        '400':
          $ref: '#/components/responses/Error'
components:
  schemas:
    TimeSeriesResponse:
      type: object
      description: Modeled from the observed /timeseries JSON payload.
      properties:
        success:
          type: boolean
          example: true
        base:
          type: string
          example: USD
        start_date:
          type: string
          format: date-time
          example: '2026-01-01T00:00:00.000Z'
        end_date:
          type: string
          format: date-time
          example: '2026-01-05T00:00:00.000Z'
        rates:
          type: object
          description: Map of date-time to a map of currency code and rate.
          additionalProperties:
            type: object
            additionalProperties:
              type: number
          example:
            '2026-01-04T23:59:00.000Z':
              EUR: 0.854400106
    ErrorResponse:
      type: object
      description: Modeled from observed error payloads. FXRatesAPI returns success=false with either a nested error object ({message}) or a flat error string plus a description field, depending on the endpoint and failure mode.
      properties:
        success:
          type: boolean
          example: false
        error:
          oneOf:
          - type: string
            example: missing_from_currency
          - type: object
            properties:
              message:
                type: string
                example: Endpoint Not Found
        description:
          type: string
          example: The from currency is required for the convert endpoint.
  responses:
    Error:
      description: Error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    apiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: API key passed as the api_key query parameter.
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key passed as an Authorization: Bearer <API_KEY> header.'