# Historical market rates for a currency pair

**GET /api/historical-rates**

Time series of mid-market rates for one pair over a preset period. `1d` returns hourly points; `7d` and `30d` daily points; `1y` weekly-sampled points. Requires an API key (Bearer header) or a logged-in session.


## Servers
- Production: https://allratestoday.com (Production)


## Authentication methods
- Bearer auth
- Session cookie


## Parameters


### Query parameters

- **source** (string)
  Source currency code (ISO 4217)

- **target** (string)
  Target currency code (ISO 4217)

- **period** (string)
  Time window

- **format** (string)
  Response format (default json). csv is UTF-8 with a BOM; xlsx is a real Excel workbook with typed dates and numbers; xml mirrors the JSON fields.



## Responses
### 200
Historical series (oldest first)

#### Body: application/json (object)
- **source** (string)

- **target** (string)

- **data** (array[object])

- **source_api** (string)

- **period** (string)


### 400
Invalid or missing parameters

#### Body: application/json (object)
- **error** (string)
  Error message

- **hint** (string)
  Optional remediation hint


### 401
Authentication required — provide an API key via `Authorization: Bearer art_live_...` (free keys at https://allratestoday.com/register)

#### Body: application/json (object)
- **error** (string)
  Error message

- **hint** (string)
  Optional remediation hint


### 429
Monthly request limit exceeded (X-Monthly-Limit / X-Monthly-Used / X-Monthly-Resets headers included)

#### Body: application/json (object)
- **error** (string)

- **used** (integer)

- **limit** (integer)

- **plan** (string)

- **resets_at** (string(date-time))

- **upgrade_url** (string)


### 500
Server or upstream error

#### Body: application/json (object)
- **error** (string)
  Error message

- **hint** (string)
  Optional remediation hint



[Powered by Bump.sh](https://bump.sh)
