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

# Tassi di cambio storici

> Tassi di cambio per una data specifica.

> [!NOTE]
>
> L’endpoint è in beta chiusa. L’accesso e le date disponibili dipendono dall’abilitazione e dai dati memorizzati.

```bash theme={"system"}
curl 'https://exchange-rates.cleariflow.com/v1/historical/?api_key=YOUR_API_KEY&base=USD&date=2024-01-01&target=EUR,JPY'
```

**api\_key** `String` *required*

Chiave API di Exchange Rates.

**base** `String` *required*

Valuta di base come codice ISO 4217.

**date** `String` *required*

Data nel formato YYYY-MM-DD.

**target** `String`

Valute di destinazione facoltative come codici ISO 4217 separati da virgole. Se omesse, vengono restituiti tutti i tassi disponibili.

La risposta contiene la valuta di base, la data e i tassi disponibili.

```json theme={"system"}
{
  "base": "USD",
  "date": "2024-01-01",
  "exchange_rates": {
    "EUR": 0.912742,
    "JPY": 142.095655
  }
}
```


## OpenAPI

````yaml openapi/exchange-rates.json GET /v1/historical/
openapi: 3.0.3
info:
  title: Exchange Rates API
  description: >-
    A fast, lightweight, modern, and RESTful JSON API for looking up the latest
    exchange rates for 80+ currencies, getting historical exchange rates, and
    converting an arbitrary amount from one currency to another.
  version: 1.0.0
  contact:
    name: Cleariflow
    url: https://cleariflow.com
servers:
  - url: https://exchange-rates.cleariflow.com
    description: Production server
security: []
tags:
  - name: Live Rates
    description: Get the most recent exchange rates
  - name: Convert
    description: Convert amounts between currencies
  - name: Historical
    description: Get historical exchange rates for specific dates
  - name: Symbols
    description: Get available currency symbols and descriptions
paths:
  /v1/historical/:
    get:
      tags:
        - Historical
      summary: Get historical exchange rates
      description: >-
        Functions almost exactly like the live endpoint, except it requires a
        date parameter and returns the exchange rates for that specific date for
        a given set of currencies. If no target parameter is specified, then all
        available currencies are returned.
      operationId: getHistoricalRates
      parameters:
        - $ref: '#/components/parameters/apiKey'
        - $ref: '#/components/parameters/baseCurrency'
        - $ref: '#/components/parameters/targetCurrency'
        - name: date
          in: query
          required: true
          schema:
            type: string
            format: date
          description: >-
            The historical date you'd like to get rates from, in the format of
            YYYY-MM-DD
          example: '2024-01-01'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricalResponse'
        '400':
          description: Bad request - validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests - rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    apiKey:
      name: api_key
      in: query
      required: true
      schema:
        type: string
      description: Your unique API key for authentication
      example: your_api_key_here
    baseCurrency:
      name: base
      in: query
      required: false
      schema:
        type: string
        default: EUR
      description: >-
        The base currency used to get the latest exchange rate(s) for. Uses the
        ISO 4217 currency standard
      example: EUR
    targetCurrency:
      name: target
      in: query
      required: false
      schema:
        type: string
      description: >-
        The target currency or currencies to get the exchange rate of versus the
        base currency. Multiple currencies should be separated by commas. If not
        specified, all available currencies will be returned.
      example: USD,CAD,AUD
  schemas:
    HistoricalResponse:
      type: object
      properties:
        base:
          type: string
          description: The base currency used to get the exchange rates
          example: EUR
        date:
          type: string
          format: date
          description: The date the currencies were pulled from
          example: '2024-01-01'
        exchange_rates:
          type: object
          additionalProperties:
            type: number
          description: >-
            A JSON Object containing each of the target currency as the key and
            its exchange rate versus the base currency as that key's value
          example:
            EUR: 1
            USD: 0.85
            GBP: 0.75
      required:
        - base
        - date
        - exchange_rates
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: A human-readable error message
              example: Validation error
            code:
              type: string
              description: A machine-readable error code
              example: validation_error
            details:
              type: object
              description: Additional error details, if available
              example:
                base:
                  - 'Invalid base currency provided: USD1'
          required:
            - message
            - code
      required:
        - error

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.