# /convert Endpoint

> Complete reference for the currency conversion endpoint, including PPP adjustment, response fields, errors, and the triangulation formula.

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

---
## Endpoint

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

## Plan and limits

`/v1/convert` is available on every plan. Two limits matter while integrating:

- **Free plan date window:** `date` can only reach back 30 days. Older dates return `403 forbidden`. Starter and above get full history.
- **Live keys are paid-only:** a Free organization uses a test key. Live keys require a paid plan.

Each call accepts up to **25** targets in `to`. One call consumes one metered request regardless of how many targets it contains. `amount` must be greater than `0` and at most `1e15`. A missing `amount` defaults to `1`.

## Query parameters

| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| `from` | string | Yes | none | Source currency (ISO 4217), e.g. `USD`. When `ppp=true`, add a country as `currency:country` (e.g. `USD:USA`) if the currency is used in more than one country; common currencies resolve automatically. |
| `to` | string | Yes | none | One or more target currencies, comma-separated. Each item is a bare currency (`INR`) or, when `ppp=true`, a `currency:country` pair (`INR:IND`). Max 25. |
| `amount` | number | No | `1` | Amount to convert. Must be a finite positive number up to `1e15`. Defaults to `1`, so the response is the plain pair rate. |
| `date` | string | No | Latest available | Rate date in `YYYY-MM-DD`, interpreted as a **UTC** date. Must not be in the future. History reaches back to 1949 for the longest-running pairs, and coverage varies by currency. The **Free plan is limited to the last 30 days** and returns `403` for older dates. A non-trading day resolves to the most recent earlier snapshot (see `requestedDate`/`asOf` below). |
| `ppp` | boolean | No | `false` | When `true`, apply a PPP adjustment. Most currencies resolve to a default country; currencies used in several countries need an explicit `currency:country` pair. `1`, `true`, `yes`, and `on` are treated as true. |

All dates are **UTC**. The `date` you pass is treated as a UTC calendar date, and
when omitted the latest available UTC rate date is used, so results don't shift
with the caller's local timezone. **Future dates are rejected** with
`400 invalid_input` (there are no rates ahead of today).

The **PPP year follows the date's year** (e.g. `date=2021-06-01` uses 2021 PPP
factors). When `date` is omitted, the latest **actual** (non-projected) PPP year
is used. A back-dated request only uses **actual** (non-projected) PPP data, see
[Data availability](#data-availability--limits) below.

Country codes are ISO/IMF **alpha-3** (e.g. `USA`, `IND`, `DEU`). Look them up
via the [/countries](/docs/countries/) endpoint.

### Multiple target currencies

`to` accepts a comma-separated list, so one call can fan out to many currencies:

```
?from=USD&amount=100&to=INR,EUR,JPY
```

### PPP: country auto-resolution

When `ppp=true`, the API automatically resolves the country for most currencies using a canonical default, so you do not need to pass `currency:country` for common cases:

```
# Simple, country resolved automatically (USD→USA, INR→IND, EUR→DEU)
?from=USD&amount=100&ppp=true&to=INR,EUR
```

For currencies used in many countries without a single clear home (e.g. XCD covering 8 Caribbean islands), the API cannot pick one automatically and will return a per-target error asking you to specify:

```
# Explicit, required for ambiguous currencies, or to target a specific country
?from=USD:USA&amount=100&ppp=true&to=INR:IND,EUR:DEU,EUR:FRA
```

This is also how you target the **same currency across multiple countries** (each country has a different PPP factor):

```
?from=USD:USA&amount=100&ppp=true&to=EUR:DEU,EUR:FRA,EUR:ITA
```

The currency in each explicit pair must be an **official currency of that country** (the country's PPP factor is denominated in that currency), so `INR:IND` is valid but `EUR:IND` is not. Pairs are validated **per target**: a bad pair only fails that target's PPP (see [Per-target PPP errors](#per-target-ppp-errors) below), not the whole request. Use [/countries](/docs/countries/) to see each country's `currencies`.

## Response

The response always returns a `results` array, one entry per requested target.
When PPP is not requested, the `fromCountry`, `toCountry`, and `ppp` fields are
omitted entirely:

```json
{
  "from": "USD",
  "amount": 100,
  "date": "2026-11-10",
  "results": [
    { "to": "INR", "result": 8345.00, "rate": 83.45 },
    { "to": "EUR", "result": 92.30,   "rate": 0.923 }
  ]
}
```

With PPP enabled, `result` is **still the plain FX conversion**; the
**PPP-adjusted amount lives in `ppp.result`**. PPP is a **price-level conversion**
of your `amount`, bridged through the international dollar:

```
ppp.result = amount × (toFactor / fromFactor)
```

It deliberately does **not** use the nominal FX rate. PPP *replaces* the market
rate, it doesn't compound it. So `$100` in the US (factor `1.0`) into India
(factor `20.4`) is `100 × (20.4 / 1.0) ≈ ₹2,040` ("what $100 of US goods costs in
India"), independent of the ~₹83/$ market rate. Each `ppp` block also reports the
`year` and `source` of the factors. The source country appears once at the top
level as `fromCountry`, and each result carries its `toCountry` and `ppp` block
(note `EUR` appears twice, once per country):

```json
{
  "from": "USD",
  "fromCountry": "USA",
  "amount": 100,
  "date": "2026-11-10",
  "results": [
    { "to": "INR", "toCountry": "IND", "result": 8345.00, "rate": 83.45, "ppp": { "fromFactor": 1.0, "toFactor": 20.4, "result": 2040.00, "year": 2024, "source": "IMF World Economic Outlook" } },
    { "to": "EUR", "toCountry": "DEU", "result": 92.30,   "rate": 0.923, "ppp": { "fromFactor": 1.0, "toFactor": 0.72, "result": 72.00,   "year": 2024, "source": "IMF World Economic Outlook" } },
    { "to": "EUR", "toCountry": "FRA", "result": 92.30,   "rate": 0.923, "ppp": { "fromFactor": 1.0, "toFactor": 0.664, "result": 66.40,   "year": 2024, "source": "IMF World Economic Outlook" } }
  ]
}
```

### Response fields

| Field | Type | Description |
|---|---|---|
| `from` | string | The source currency you requested. |
| `fromCountry` | string | Source country (alpha-3). Present **only** when PPP was requested; shared by all results. |
| `amount` | number | The input amount, echoed back. |
| `date` | string | The rate date actually used (`YYYY-MM-DD`, UTC). On a non-trading day this is the most recent earlier snapshot. |
| `requestedDate` | string | The date you asked for. Present **only** when it differs from `date` (the requested date had no snapshot, so an earlier one was used). |
| `asOf` | object | Currencies among `from`/targets whose rate was carried forward → the date it's from. Present **only** when at least one rate was carried forward. |
| `message` | string | Present **only** when no FX data exists at or before `date` (then `results` is empty). |
| `results` | array | One entry per requested target, see below. |
| `results[].to` | string | The target currency. |
| `results[].toCountry` | string | Target country (alpha-3). Present **only** when PPP was requested. |
| `results[].result` | number | **Plain FX** conversion, never PPP-adjusted. |
| `results[].rate` | number | Effective FX rate applied (`result / amount`). |
| `results[].ppp` | object | The PPP detail. Present **only** when PPP was requested. It is a **union**: either the success shape (`fromFactor`, `toFactor`, `result`, `year`, `source`) **or** an error shape (`error`), never both. |
| `results[].ppp.fromFactor` | number | Source country's PPP conversion factor (local units per international $). Present on success; absent when `ppp.error` is set. |
| `results[].ppp.toFactor` | number | Target country's PPP conversion factor (local units per international $). Present on success; absent when `ppp.error` is set. |
| `results[].ppp.result` | number | PPP-adjusted amount: `amount × (toFactor / fromFactor)`, a price-level conversion via the international dollar, **independent of the FX rate**. Present on success; absent when `ppp.error` is set. |
| `results[].ppp.year` | number | Year of the PPP conversion factors used. Present on success. |
| `results[].ppp.source` | string | Provider of the PPP factors (`IMF World Economic Outlook`). Present on success. |
| `results[].ppp.error` | string | Set **instead of** the factors when this target's PPP couldn't be applied. The FX fields (`result`, `rate`) are still returned, and the response is still **HTTP 200**. |

### Per-target PPP errors

PPP is resolved **per target**. If one target's PPP can't be applied, only
**that** target's `ppp` becomes `{ "error": ... }`, the others still get
factors, and the **FX fields (`result`, `rate`) are always returned for every
target**. The response stays **HTTP 200** even when some targets carry a
`ppp.error`. (If the `from` pair itself is bad, every target's `ppp` is an error,
but FX is still returned for each.)

Each `currency:country` pair must be **consistent**: the currency must be an
**official currency of that country** (the country's PPP factor is denominated in
that currency). `ppp.error` carries one of:

| `ppp.error` value | When |
|---|---|
| `Invalid country code: <C>` | `<C>` is not a known alpha-3 country code. |
| `<CUR> is not an official currency of <C>` | The currency and country do not match (for example, `EUR:IND`). |
| `No PPP data available for <C>` | The country is valid but has no PPP factor for the requested year. |
| `<CUR> is used in multiple countries` | The message begins with this when the currency has several home countries and no canonical default. It asks you to pass an explicit `CUR:COUNTRY` pair. |

Example, two targets where the second's currency does not match its country, so only its `ppp` is an error:

```json
{
  "from": "USD",
  "fromCountry": "USA",
  "amount": 100,
  "date": "2026-11-10",
  "results": [
    { "to": "INR", "toCountry": "IND", "result": 8345.00, "rate": 83.45, "ppp": { "fromFactor": 1.0, "toFactor": 20.4, "result": 2040.00, "year": 2024, "source": "IMF World Economic Outlook" } },
    { "to": "EUR", "toCountry": "IND", "result": 92.30,   "rate": 0.923, "ppp": { "error": "EUR is not an official currency of IND" } }
  ]
}
```

## Data availability & limits

These responses return **HTTP 200** (the request succeeded). Missing PPP data is
reported in the relevant `ppp` block; a missing FX snapshot adds a top-level
`message`.

**PPP data not available for the year** (PPP coverage starts in 1980), the FX
conversion is still returned; each affected target's `ppp` carries an `error`
instead of factors. When the source country has no PPP data, that source error
applies to every target:

```json
{
  "from": "USD",
  "fromCountry": "USA",
  "amount": 100,
  "date": "1979-01-02",
  "results": [
    { "to": "INR", "toCountry": "IND", "result": 820.00, "rate": 8.20, "ppp": { "error": "No PPP data available for USA" } }
  ]
}
```

**No FX data for the date**, on a paid plan `results` is empty and a top-level
`message` explains it. (On the Free plan, dates older than 30 days are rejected
with `403` before conversion runs.)

```json
{
  "from": "USD",
  "amount": 100,
  "date": "1948-01-01",
  "results": [],
  "message": "Conversion data is not available for 1948-01-01."
}
```

### How this counts against your limits

- **Monthly usage limit:** only **successful** requests (HTTP 2xx) are counted,
  including the two availability messages above. Requests that **error** (4xx or
  5xx, invalid input, unknown currency, a missing PPP country, rate limit, or
  quota exceeded) are **not** counted toward your monthly limit.
- **Rate limit:** applies to **every** request regardless of its status, so
  retries and errored calls still consume your per-window rate budget.

## Errors

| Status | Code | When |
|---|---|---|
| `400` | `invalid_input` | `from` or `to` is missing; `amount` is non-numeric, zero, negative, or above `1e15`; `date` is not a real date or is in the future; or more than 25 targets. |
| `400` | `unknown_currency` | The `from` currency, or any target currency, is unknown or has no quote 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. |
| `429` | `rate_limited` | The per-minute rate limit was exceeded. Honor `Retry-After`. |

A bad `currency:country` PPP pair is **not** a request error. It comes back as a per-target `ppp.error` with HTTP `200`, while the FX result is still returned.

## Triangulation formula

CurrencyCore stores all rates as **units of currency per 1 USD** (i.e., USD is the base).
Converting from any currency A to any currency B uses USD as the intermediary:

```
result = (amount / fromRate) * toRate
```

Where:
- `fromRate` = units of currency A per 1 USD
- `toRate` = units of currency B per 1 USD

**Example:** 100 GBP → INR where GBP rate = `0.79`, INR rate = `83.45`

```
result = (100 / 0.79) * 83.45 = 10563.29 INR
```

## PPP adjustment formula

When `ppp=true`, `result` is still the plain FX conversion. The PPP-adjusted
amount is returned **separately** as `ppp.result`, so you get both numbers:

```
result     = (amount / fromRate) * toRate          // plain FX, always present
ppp.result = amount * (toFactor / fromFactor)       // PPP-adjusted, only when ppp=true
```

Where `fromFactor` and `toFactor` are the PPP conversion factors for the source
and target countries. `ppp.result` is a **price-level conversion of `amount`**;
it is **not** multiplied by the FX `result`. This separation lets you show the
market price and the purchasing-power-adjusted price side by side.

## Example requests

**Simple conversion:**

<CodeTabs>
<Fragment slot="curl">

```bash
curl "https://api.currency-core.com/v1/convert?from=EUR&to=JPY&amount=50" \
  -H "Authorization: Bearer cc_live_your_key"
```

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

```js
const res = await fetch(
  "https://api.currency-core.com/v1/convert?from=EUR&to=JPY&amount=50",
  { headers: { Authorization: "Bearer cc_live_your_key" } },
);
const data = await res.json();
console.log(data.results[0].result);
```

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

```python

res = requests.get(
    "https://api.currency-core.com/v1/convert",
    params={"from": "EUR", "to": "JPY", "amount": 50},
    headers={"Authorization": "Bearer cc_live_your_key"},
)
print(res.json()["results"][0]["result"])
```

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

```go
req, _ := http.NewRequest("GET",
	"https://api.currency-core.com/v1/convert?from=EUR&to=JPY&amount=50", nil)
req.Header.Set("Authorization", "Bearer cc_live_your_key")

res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
```

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

```java
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.currency-core.com/v1/convert?from=EUR&to=JPY&amount=50"))
    .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/convert?from=EUR&to=JPY&amount=50");
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>

**Historical rate:**

```bash
curl "https://api.currency-core.com/v1/convert?from=USD&to=GBP&amount=1000&date=2023-01-15" \
  -H "Authorization: Bearer cc_live_your_key"
```

**Multiple target currencies:**

```bash
curl "https://api.currency-core.com/v1/convert?from=USD&to=INR,EUR,JPY&amount=100" \
  -H "Authorization: Bearer cc_live_your_key"
```

**With PPP adjustment (one country):**

```bash
curl "https://api.currency-core.com/v1/convert?from=USD:USA&to=INR:IND&amount=100&ppp=true" \
  -H "Authorization: Bearer cc_live_your_key"
```

**PPP across multiple countries (same currency, different PPP):**

```bash
curl "https://api.currency-core.com/v1/convert?from=USD:USA&amount=100&ppp=true&to=INR:IND,EUR:DEU,EUR:FRA" \
  -H "Authorization: Bearer cc_live_your_key"
```

## Related

- [`/v1/rates`](/docs/rates-endpoint/) for a full snapshot instead of one amount
- [`/v1/history`](/docs/history-endpoint/) for a date range
- [`/v1/ppp`](/docs/ppp-endpoint/) for the raw PPP factor
- [`/v1/countries`](/docs/countries/) for country codes and official currencies
- [Currency converter](/tools/currency-converter/) for a no-code check
- [Pricing](/pricing/) for plan quotas and the Free date window
- [Rate limits](/docs/authentication/) for per-minute limits
