# /rates Endpoint

> Fetch a full exchange-rate snapshot for a date, or rebase it to any base currency, with carry-forward and as-of behavior explained.

Canonical: https://currency-core.com/docs/rates-endpoint/
Updated: 2026-11-10
Published: 2026-06-04

---
## Endpoints

```
GET https://api.currency-core.com/v1/rates
GET https://api.currency-core.com/v1/rates/:base
```

`/v1/rates` returns the full snapshot with **USD** as the base. `/v1/rates/:base` returns the same snapshot re-expressed against any base currency, which is useful when your product thinks in EUR, INR, or another currency. Neither endpoint converts a specific amount. For that, use [`/v1/convert`](/docs/convert-endpoint/).

Both endpoints require an API key.

## Parameters

| Parameter | In | Type | Required | Default | Notes |
|---|---|---|---|---|---|
| `base` | path | string | Yes (on `/rates/:base`) | `USD` | Three-letter ISO 4217 code, e.g. `EUR`. The base itself is always `1` in the response. |
| `date` | query | string | No | Latest available date | `YYYY-MM-DD` (UTC). Must be a real calendar date. A date with no snapshot resolves to the most recent earlier one. |

## Plan and history window

`/v1/rates` is available on every plan. The `date` lookback follows your plan: the Free plan can request the last 30 days, while Starter and above can request full history. A Free request outside that window returns `403 forbidden`.

Live keys require a paid plan. Use a test key while integrating on the Free plan.

## Response

`/v1/rates` returns a USD-base map:

```json
{
  "date": "2026-11-09",
  "base": "USD",
  "rates": {
    "USD": 1,
    "EUR": 0.9214,
    "INR": 84.07,
    "GBP": 0.835
  }
}
```

`/v1/rates/EUR` rebases the same data. Every value is **units of that currency per 1 unit of the base**, and the base is exactly `1`:

```json
{
  "base": "EUR",
  "date": "2026-11-10",
  "rates": {
    "EUR": 1,
    "USD": 1.0861,
    "INR": 91.62,
    "GBP": 0.835
  }
}
```

Rebasing is exact: `units-per-base = (units-per-USD) / (base-units-per-USD)`.

### Response fields

| Field | Type | Description |
|---|---|---|
| `base` | string | Base currency the map is expressed against. `USD` on `/rates`, or the requested code on `/rates/:base`. |
| `date` | string | The rate date actually used (`YYYY-MM-DD`, UTC). |
| `rates` | object | Map of currency code to units of that currency per 1 unit of `base`. The base itself is `1`. |
| `requestedDate` | string | The date you asked for. Present **only** when it differs from `date`, because the requested date had no snapshot and an earlier one was used. |
| `asOf` | object | Currencies whose rate was carried forward, mapped to the date that rate came from. Present **only** when at least one rate was carried forward. |

## Historical dates and carry-forward

The snapshot is never empty for an in-range date. Two fallbacks fill gaps, and both are reported so you know what you received:

- **Whole date missing** (weekend, holiday, or another non-trading day): the response serves the most recent earlier snapshot. `date` is the date actually used, and `requestedDate` echoes what you asked for. `requestedDate` is present only when the two differ.
- **One currency missing on an otherwise present date** (for example, a currency not yet listed or temporarily unquoted): its most recent prior rate is carried forward. Those currencies appear in `asOf`, mapping the code to the date the value is from. `asOf` is present only when at least one rate was carried forward.

```json
{
  "date": "2026-11-06",
  "requestedDate": "2026-11-08",
  "base": "USD",
  "rates": { "USD": 1, "EUR": 0.92, "INR": 84.07, "CLP": 947.6 },
  "asOf": { "CLP": "2026-11-05" }
}
```

Here `2026-11-08` (a Sunday) resolved back to Friday `2026-11-06`, and `CLP` carried its last value from `2026-11-05`.

## Reading the rates

- A higher number means one unit of the base buys more of that currency. On `/v1/rates/EUR`, `rates.USD = 1.0861` means one euro buys 1.0861 US dollars.
- The map is not a set of quotes against every other pair. Cross rates follow from the shared base, so `A/B = rate[A] / rate[B]`.
- Carry-forward values are real prior quotes, not interpolated values. Use `asOf` when you need to know the exact age of a value.

## Choosing a base

Pick the base your product already displays. A EUR-based app should call `/v1/rates/EUR` rather than fetching the USD map and rebasing on every render. For a one-off comparison, remember that changing the base does not change the underlying quotes, only the denominator.

## Example requests

<CodeTabs>
<Fragment slot="curl">

```bash
curl "https://api.currency-core.com/v1/rates/EUR?date=2026-11-10" \
  -H "Authorization: Bearer cc_live_your_key"
```

</Fragment>
<Fragment slot="js">

```js
const res = await fetch("https://api.currency-core.com/v1/rates/EUR?date=2026-11-10", {
  headers: { Authorization: "Bearer cc_live_your_key" },
});
const { rates } = await res.json();
console.log(rates.USD); // USD per 1 EUR
```

</Fragment>
<Fragment slot="python">

```python

res = requests.get(
    "https://api.currency-core.com/v1/rates/EUR",
    params={"date": "2026-11-10"},
    headers={"Authorization": "Bearer cc_live_your_key"},
)
print(res.json()["rates"]["USD"])
```

</Fragment>
<Fragment slot="go">

```go
req, _ := http.NewRequest("GET",
	"https://api.currency-core.com/v1/rates/EUR?date=2026-11-10", nil)
req.Header.Set("Authorization", "Bearer cc_live_your_key")

res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()

var data struct {
	Rates map[string]float64 `json:"rates"`
}
json.NewDecoder(res.Body).Decode(&data)
fmt.Println(data.Rates["USD"])
```

</Fragment>
<Fragment slot="java">

```java
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.currency-core.com/v1/rates/EUR?date=2026-11-10"))
    .header("Authorization", "Bearer cc_live_your_key")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

</Fragment>
<Fragment slot="php">

```php
<?php
$ch = curl_init("https://api.currency-core.com/v1/rates/EUR?date=2026-11-10");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer cc_live_your_key"]);
echo curl_exec($ch);
curl_close($ch);
```

</Fragment>
</CodeTabs>

## Errors

| Status | Code | When |
|---|---|---|
| `400` | `invalid_input` | `date` is not a real `YYYY-MM-DD` date, or `:base` is not a 3-letter code. |
| `400` | `unknown_currency` | The requested base is not present in the snapshot. |
| `401` | `unauthorized` | The API key is missing or invalid. |
| `403` | `forbidden` | The `date` is outside the Free plan window, the key is disabled, or billing is past due. |
| `404` | `rate_not_found` | No rate data exists on or before the requested date. |
| `429` | `rate_limited` | The per-minute rate limit was exceeded. Honor `Retry-After`. |

## Limits and related

- One snapshot per request. The response contains every currency in that snapshot.
- `date` is a single day, not a range. For a range, use [`/v1/history`](/docs/history-endpoint/).
- Free plan: 30-day `date` window; Starter and above: full history.
- Each request consumes one monthly request and one per-minute rate-limit unit.

Related pages:

- [`/v1/convert`](/docs/convert-endpoint/) to convert an amount
- [`/v1/history`](/docs/history-endpoint/) for a date range
- [`/v1/currencies`](/docs/currencies/) for supported codes
- [Pricing](/pricing/) for plan quotas
- [Rate limits](/docs/authentication/) for per-minute limits
