# /history Endpoint

> Fetch a dense day-by-day time series for one currency, with interval averaging, carry-forward gaps, and plan history limits.

Canonical: https://currency-core.com/docs/history-endpoint/
Updated: 2026-11-12
Published: 2026-06-16

---
## Endpoint

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

Returns a daily time series for **one** currency against a base, as a dense date-to-rate map with one entry per calendar day in the range. For a single date's full snapshot use [`/v1/rates`](/docs/rates-endpoint/); to convert a specific amount use [`/v1/convert`](/docs/convert-endpoint/).

For trends, comparisons, and movers, see [`/v1/history/analysis`](/docs/history-analysis-endpoint/).

## Plan requirement

`/v1/history` is available on **every plan**. The lookback window depends on your plan:

| Plan | History window |
|---|---|
| **Free** | Last 30 days |
| **Starter and above** | Full history (GBP/USD and USD/INR parity from 1949; other pairs start later) |

A Free key requesting a `from` older than 30 days receives **HTTP 403 `forbidden`**:

```json
{
  "error": {
    "code": "forbidden",
    "message": "Your plan limits historical data to the last 30 days. Upgrade to Starter or higher for full history access."
  }
}
```

Live keys require a paid plan. The **Growth plan or higher** requirement applies only to the analytics endpoint, [`/v1/history/analysis`](/docs/history-analysis-endpoint/).

## Query parameters

| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| `currency` | string | Yes | none | A **single** 3-letter ISO 4217 code, e.g. `INR`. One currency per call; call again for more. |
| `from` | string | No | `to` minus 7 days | Start date `YYYY-MM-DD` (UTC, inclusive). Must be a real calendar date. Values before 1949-12-30 clamp to that date. |
| `to` | string | No | Today (UTC) | End date `YYYY-MM-DD` (UTC, inclusive). A future date clamps to today. |
| `base` | string | No | `USD` | Base currency (3-letter ISO 4217). |
| `interval` | string | No | `daily` | `daily`, `weekly`, `monthly`, or `yearly`. Coarser intervals average the daily rates per bucket. |

All dates are **UTC** calendar dates, so results do not shift with the caller's local timezone. When `from` and `to` are both omitted you get the trailing **8 days** (today and the 7 days before it).

## Response

`rates` is a **dense** map: every calendar day in `[from, to]` is present, including weekends, holidays, and non-trading days. Each value is **units of `currency` per 1 `base`**. Gaps are filled by carrying the most recent earlier rate forward, and today is included from the current rate snapshot.

```json
{
  "currency": "INR",
  "base": "USD",
  "interval": "daily",
  "from": "2024-06-09",
  "to": "2024-06-16",
  "rates": {
    "2024-06-09": 83.10,
    "2024-06-10": 83.14,
    "2024-06-11": 83.21,
    "2024-06-12": 83.18,
    "2024-06-13": 83.18,
    "2024-06-14": 83.18,
    "2024-06-15": 83.30,
    "2024-06-16": 83.42
  }
}
```

Here `2024-06-09` is a Sunday, so it carries the previous Friday's rate forward, and the series resumes on Monday `2024-06-10`.

### Response fields

| Field | Type | Description |
|---|---|---|
| `currency` | string | The currency you requested, echoed back in uppercase. |
| `base` | string | The base currency used (defaults to `USD`). |
| `interval` | string | The aggregation interval applied (`daily`, `weekly`, `monthly`, or `yearly`). |
| `from` | string | Start date of the range actually returned (`YYYY-MM-DD`, UTC). |
| `to` | string | End date of the range actually returned (`YYYY-MM-DD`, UTC). |
| `rates` | object | For `daily`, a dense `date` to `rate` map. For coarser intervals, a `period` to average-rate map. Each rate is units of `currency` per 1 `base`. |

## Aggregation

By default (`interval=daily`) you get one entry per calendar day. Pass `weekly`, `monthly`, or `yearly` to **average** the daily rates within each bucket, which is useful for charts and long ranges. Partial buckets at the edges of the range average only the days that fall inside `[from, to]`. Bucket keys:

| `interval` | Key format | Example key |
|---|---|---|
| `daily` | `YYYY-MM-DD` (the day) | `2024-06-16` |
| `weekly` | `YYYY-MM-DD` (the week's Monday, UTC) | `2024-06-10` |
| `monthly` | `YYYY-MM` (the month) | `2024-06` |
| `yearly` | `YYYY` (the year) | `2024` |

```bash
curl "https://api.currency-core.com/v1/history?currency=INR&from=2024-01-01&to=2024-02-29&interval=monthly" \
  -H "Authorization: Bearer cc_live_your_key"
```

```json
{
  "currency": "INR",
  "base": "USD",
  "interval": "monthly",
  "from": "2024-01-01",
  "to": "2024-02-29",
  "rates": { "2024-01": 82.97, "2024-02": 83.04 }
}
```

## Data coverage

History starts at 1949-12-30. A currency that did not exist yet, or was not quoted on a date, has no entry before its first quote; the response does not invent one. For dates after that first quote, gaps are carried forward, so the series stays dense. If you need to know whether a specific day was a real quote or a carried value, compare the value with the prior day or use [`/v1/rates`](/docs/rates-endpoint/), which reports `asOf`.

## Reading the series

- The series is quoted as **units of `currency` per 1 `base`**. For `currency=INR&base=USD`, a rising number means the rupee weakened against the dollar; a falling number means it strengthened.
- Because gaps are carried forward, flat runs are expected on weekends and holidays. They are not missing data.
- A coarser interval is an average of the daily values in that bucket, not an end-of-period snapshot.

## Example requests

A one-week series for INR against USD:

<CodeTabs>
<Fragment slot="curl">

```bash
curl "https://api.currency-core.com/v1/history?currency=INR&from=2024-06-09&to=2024-06-16&base=USD" \
  -H "Authorization: Bearer cc_live_your_key"
```

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

```js
const res = await fetch(
  "https://api.currency-core.com/v1/history?currency=INR&from=2024-06-09&to=2024-06-16&base=USD",
  { headers: { Authorization: "Bearer cc_live_your_key" } },
);
const { rates } = await res.json();
console.log(rates["2024-06-16"]); // INR per 1 USD
```

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

```python

res = requests.get(
    "https://api.currency-core.com/v1/history",
    params={"currency": "INR", "from": "2024-06-09", "to": "2024-06-16", "base": "USD"},
    headers={"Authorization": "Bearer cc_live_your_key"},
)
print(res.json()["rates"]["2024-06-16"])
```

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

```go
req, _ := http.NewRequest("GET",
	"https://api.currency-core.com/v1/history?currency=INR&from=2024-06-09&to=2024-06-16&base=USD", 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["2024-06-16"])
```

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

```java
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.currency-core.com/v1/history?currency=INR&from=2024-06-09&to=2024-06-16&base=USD"))
    .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/history?currency=INR&from=2024-06-09&to=2024-06-16&base=USD");
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>

**Trailing 8 days (defaults), rebased to EUR:**

```bash
curl "https://api.currency-core.com/v1/history?currency=INR&base=EUR" \
  -H "Authorization: Bearer cc_live_your_key"
```

## Errors

| Status | Code | When |
|---|---|---|
| `400` | `invalid_input` | `currency` is missing or not a 3-letter code, `base` is not a 3-letter code, `interval` is invalid, a date is not a real `YYYY-MM-DD`, or `from` is after `to`. |
| `400` | `unknown_currency` | `base` is unknown or has no history in the window. |
| `401` | `unauthorized` | The API key is missing or invalid. |
| `403` | `forbidden` | A Free key requested a `from` older than the 30-day Free window, the key is disabled, or billing is past due. |
| `404` | `unknown_currency` | `currency` has no history available. |
| `429` | `rate_limited` | The per-minute rate limit was exceeded. Honor `Retry-After`. |

## Limits and related

- One currency per request. For several series, make one request per currency.
- Free plan is limited to the last 30 days; Starter and above get full history.
- No maximum span is enforced on this endpoint; cost does not scale with the requested window because history is read as one stored series and sliced in memory.
- Each request consumes one monthly request and one per-minute rate-limit unit.

Related pages:

- [`/v1/history/analysis`](/docs/history-analysis-endpoint/) for change, strength, and stats
- [`/v1/rates`](/docs/rates-endpoint/) for a single-date snapshot
- [`/v1/convert`](/docs/convert-endpoint/) for an amount conversion
- [Pricing](/pricing/) for plan history windows
- [Rate limits](/docs/authentication/) for per-minute limits
