# Get historical currency rates

Get a paginated list of historical currency rates for the given time range.

```
GET /currencies/{currency_id}/rates
```

## Query params

| Query param | Description                                                                         |
| ----------- | ----------------------------------------------------------------------------------- |
| `from`      | Start of the range in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_4217) format |
| `to`        | End of the range in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_4217) format   |

## Sorting

| Property     | Description             |
| ------------ | ----------------------- |
| `tracked_at` | Sort rates by timestamp |

Default sorting is `created ASC`

## Optional properties

None

## Response

[`PaginatedResponse`](/1.5.x/documentation/overview/pagination.md)[`<Rate>`](/1.5.x/rest-api/cspr-rate.md)

## Example

```bash
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/currencies/1/rates' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
```

```json
{
  "data": [
    {
      "currency_id": 1,
      "amount": 1.32545,
      "created": "2021-05-12T00:00:00Z"
    },
    {
      "currency_id": 1,
      "amount": 1.16265,
      "created": "2021-05-12T01:00:00Z"
    },
    ...
    {
      "currency_id": 1,
      "amount": 1.25135,
      "created": "2021-05-12T09:00:00Z"
    }
  ],
  "item_count": 1258084,
  "page_count": 125809
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cspr.cloud/1.5.x/rest-api/cspr-rate/get-historical-currency-rates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
