> ## Documentation Index
> Fetch the complete documentation index at: https://voyant.travel/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Historical rates for a date

> Return historical conversion rates for a currency on a given date. Requires scope `data:fx:read`.



## OpenAPI

````yaml /api-specs/data.json get /data/fx/v1/fx/history/{currency}/{year}/{month}/{day}
openapi: 3.1.0
info:
  title: Voyant Data API
  version: 1.0.0
  description: >-
    Public REST API for the Voyant Data product. Voyant Data is a set of
    Cloudflare Workers served behind the public gateway at
    https://api.voyant.travel. Each sub-product worker mounts internally at
    /v1/... and is exposed publicly under /data/{product}/v1/*. Sub-products:
    geo, air, fx, reviews, hotels, restaurants, experiences. Authentication is a
    bearer API token scoped per sub-product (data:{product}:read). List/search
    endpoints return { data, totalCount, nextCursor? }; single-item endpoints
    return { data }. Error bodies carry a stable code (NOT_FOUND,
    INVALID_REQUEST, INVALID_CURSOR, UPSTREAM_FAILED, INTERNAL_AUTH_REQUIRED,
    RATE_LIMITED).
servers:
  - url: https://api.voyant.travel
    description: Voyant Data public gateway
security:
  - bearerAuth: []
tags:
  - name: Geo
    description: >-
      Canonical travel geography (countries, regions, cities, ports, waterways)
      plus language and timezone reference lookups. Scope: data:geo:read
  - name: Air
    description: >-
      Aviation reference data: airports, airlines, aircraft. Scope:
      data:air:read
  - name: FX
    description: >-
      Currency exchange (exchangerate-api.com white-label) plus the ISO 4217
      currency catalog. Scope: data:fx:read
  - name: Reviews
    description: >-
      Google Reviews / Extended Reviews / Q&A and Trustpilot. Scope:
      data:reviews:read
  - name: Hotels
    description: 'Google Hotels and TripAdvisor (hotel-scoped). Scope: data:hotels:read'
  - name: Restaurants
    description: 'TripAdvisor restaurants. Scope: data:restaurants:read'
  - name: Experiences
    description: 'TripAdvisor attractions / experiences. Scope: data:experiences:read'
paths:
  /data/fx/v1/fx/history/{currency}/{year}/{month}/{day}:
    get:
      tags:
        - FX
      summary: Historical rates for a date
      description: >-
        Return historical conversion rates for a currency on a given date.
        Requires scope `data:fx:read`.
      operationId: fxHistory
      parameters:
        - name: currency
          in: path
          required: true
          schema:
            type: string
          example: USD
        - name: year
          in: path
          required: true
          schema:
            type: integer
          example: 2024
        - name: month
          in: path
          required: true
          schema:
            type: integer
          example: 1
        - name: day
          in: path
          required: true
          schema:
            type: integer
          example: 15
      responses:
        '200':
          description: Historical rates
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FxHistoryResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/UpstreamFailed'
      x-codeSamples:
        - lang: typescript
          label: SDK
          source: >-
            import { createVoyantDataClient } from "@voyant-travel/data-sdk";


            const data = createVoyantDataClient({ apiKey:
            process.env.VOYANT_API_KEY });


            const result = await data.fx.history("<currency>", 2026, 6, 23);
        - lang: bash
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.voyant.travel/data/fx/v1/fx/history/<currency>/<year>/<month>/<day> \
              --header 'Authorization: Bearer <token>'
        - lang: javascript
          label: Node
          source: >-
            const response = await
            fetch("https://api.voyant.travel/data/fx/v1/fx/history/<currency>/<year>/<month>/<day>",
            {
              method: "GET",
              headers: {
                "Authorization": "Bearer <token>"
              },
            });


            const data = await response.json();
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                "https://api.voyant.travel/data/fx/v1/fx/history/<currency>/<year>/<month>/<day>",
                headers={
                    "Authorization": "Bearer <token>"
                }
            )

            data = response.json()
components:
  schemas:
    FxHistoryResponse:
      type: object
      required:
        - result
        - baseCode
        - year
        - month
        - day
        - conversionRates
      properties:
        source:
          type: string
          enum:
            - bnr
            - voyant-data-fx
        result:
          type: string
          example: success
        baseCode:
          type: string
          example: USD
        year:
          type: integer
          example: 2024
        month:
          type: integer
          example: 1
        day:
          type: integer
          example: 15
        conversionAmount:
          type: number
        conversionRates:
          type: object
          additionalProperties:
            type: number
    Error:
      type: object
      required:
        - code
      properties:
        code:
          type: string
          enum:
            - NOT_FOUND
            - INVALID_REQUEST
            - INVALID_CURSOR
            - UPSTREAM_FAILED
            - INTERNAL_AUTH_REQUIRED
            - RATE_LIMITED
          description: Stable machine-readable error code.
        message:
          type: string
          description: Human-readable error detail.
  responses:
    Unauthorized:
      description: >-
        Missing or invalid bearer token / insufficient scope (code
        INTERNAL_AUTH_REQUIRED).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit exceeded (code RATE_LIMITED).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UpstreamFailed:
      description: Upstream provider request failed (code UPSTREAM_FAILED).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Voyant Data API token, scoped per sub-product (data:{product}:read).
        Sent as `Authorization: Bearer <token>`.

````