# 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`](https://docs.cspr.cloud/1.3.x/documentation/overview/pagination)[`<Rate>`](https://docs.cspr.cloud/1.3.x/rest-api/cspr-rate)

## 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
}
```
