> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# currencylayer

> Live and historical foreign exchange rates for 170+ currencies and precious metals, with conversion, time frames and rate changes.

![](https://mintcdn.com/webrouter/Wx0iBZkUGX_VAFTN/logo/data-apis/currencylayer.webp?fit=max\&auto=format\&n=Wx0iBZkUGX_VAFTN\&q=85\&s=6d8178f0a2b75b6e2771c7488ae10a77)

[Web Catalog · Finance](https://docs.webrouter.net/data-apis.md?category=finance)

Needs&#x20;

`CURRENCYLAYER_API_KEY`

Endpoints

5

Auth

Key in query

[Vendor docs](https://docs.apilayer.com/currencylayer/docs/api-documentation)

&#x20;·&#x20;

[Pricing](https://currencylayer.com/pricing)

## Setup

| Variable | | What it is |
| - | - | - |
| `CURRENCYLAYER_API_KEY` | required | A currencylayer API access key (account dashboard). Sent as the access\_key query parameter. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* The default source currency is USD; switching it needs the Basic plan or higher.
* Errors come back as JSON with success false and an error object (code, type, info); check success, not only the HTTP status.
* Plan gates: convert Basic+, timeframe Enterprise+, change Enterprise+, spread Enterprise+.

## Endpoints

GET

Get live exchange rates

Latest quotes for every currency (or the ones asked for) against the source currency.

[Open](#currencylayer-live)

GET

Get exchange rates for a past date

End-of-day quotes for one date, back to 1999 for most currencies.

[Open](#currencylayer-historical)

GET

Convert an amount between currencies

Converts an amount at the live rate, or at a past date's rate, returning the rate used.

[Open](#currencylayer-convert)

GET

Get daily rates over a date range

Daily quotes between two dates, at most 365 days apart.

[Open](#currencylayer-timeframe)

GET

Get rate changes between two dates

Start rate, end rate, absolute and percent change per currency.

[Open](#currencylayer-change)

### Get live exchange rates

GET

`/live`

`currencylayer.live`

Latest quotes for every currency (or the ones asked for) against the source currency.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`source`</td><td>string</td><td>query</td><td>Source (base) currency, 3-letter code; default USD. Basic plan and higher. Example `EUR`</td></tr>
    <tr><td>`currencies`</td><td>string</td><td>query</td><td>Comma-separated 3-letter codes to limit the quotes returned. Example `EUR,GBP,JPY`</td></tr>
    <tr><td>`spread`</td><td>integer</td><td>query</td><td>1 adds bid and ask to each quote. Enterprise plan or higher. One of `0`, `1`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.apilayer.com/currencylayer/docs/api-documentation) · Same job: [exchangerate.host](https://docs.webrouter.net/data-apis/exchangerate-host.md#exchangerate-host-live), [Fixer](https://docs.webrouter.net/data-apis/fixer.md#fixer-latest), [OANDA](https://docs.webrouter.net/data-apis/oanda.md#oanda-pricing-get), [Open Exchange Rates](https://docs.webrouter.net/data-apis/open-exchange-rates.md#open-exchange-rates-latest), [US Treasury Fiscal Data](https://docs.webrouter.net/data-apis/treasury-fiscal-data.md#treasury-fiscal-data-rates-of-exchange), [Wise](https://docs.webrouter.net/data-apis/wise.md#wise-rates-get)

```python Python theme={null}
router.call_data_api("currencylayer.live", {'source': 'EUR', 'currencies': 'EUR,GBP,JPY'})
```

```text MCP theme={null}
call_data_api(endpoint="currencylayer.live", params={"source": "EUR", "currencies": "EUR,GBP,JPY"})
```

> [!NOTE]
>
> * Refreshed daily on Free, hourly on Basic, every 10 minutes on Enterprise and every 60 seconds on Enterprise+.
> * Quotes are keyed by the joined pair, e.g. USDEUR.

### Get exchange rates for a past date

GET

`/historical`

`currencylayer.historical`

End-of-day quotes for one date, back to 1999 for most currencies.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`date` required</td><td>string</td><td>query</td><td>Date, YYYY-MM-DD. Example `2024-01-31`</td></tr>
    <tr><td>`source`</td><td>string</td><td>query</td><td>Source (base) currency, 3-letter code; default USD. Basic plan and higher. Example `EUR`</td></tr>
    <tr><td>`currencies`</td><td>string</td><td>query</td><td>Comma-separated 3-letter codes to limit the quotes returned. Example `EUR,GBP,JPY`</td></tr>
    <tr><td>`spread`</td><td>integer</td><td>query</td><td>1 adds bid and ask to each quote. Enterprise plan or higher. One of `0`, `1`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.apilayer.com/currencylayer/docs/api-documentation) · Same job: [exchangerate.host](https://docs.webrouter.net/data-apis/exchangerate-host.md#exchangerate-host-live), [Fixer](https://docs.webrouter.net/data-apis/fixer.md#fixer-latest), [OANDA](https://docs.webrouter.net/data-apis/oanda.md#oanda-pricing-get), [Open Exchange Rates](https://docs.webrouter.net/data-apis/open-exchange-rates.md#open-exchange-rates-latest), [US Treasury Fiscal Data](https://docs.webrouter.net/data-apis/treasury-fiscal-data.md#treasury-fiscal-data-rates-of-exchange), [Wise](https://docs.webrouter.net/data-apis/wise.md#wise-rates-get)

```python Python theme={null}
router.call_data_api("currencylayer.historical", {'date': '2024-01-31', 'source': 'EUR', 'currencies': 'EUR,GBP,JPY'})
```

```text MCP theme={null}
call_data_api(endpoint="currencylayer.historical", params={"date": "2024-01-31", "source": "EUR", "currencies": "EUR,GBP,JPY"})
```

> [!NOTE]
>
> * A date before a currency was added fails the whole call with currency\_not\_available\_on\_date.

### Convert an amount between currencies

GET

`/convert`

`currencylayer.convert`

Converts an amount at the live rate, or at a past date's rate, returning the rate used.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`from` required</td><td>string</td><td>query</td><td>Currency to convert from. Example `USD`</td></tr>
    <tr><td>`to` required</td><td>string</td><td>query</td><td>Currency to convert to. Example `GBP`</td></tr>
    <tr><td>`amount` required</td><td>number</td><td>query</td><td>Amount to convert. Example `10`</td></tr>
    <tr><td>`date`</td><td>string</td><td>query</td><td>Use this date's rates, YYYY-MM-DD. Example `2024-01-31`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.apilayer.com/currencylayer/docs/api-documentation) · Same job: [exchangerate.host](https://docs.webrouter.net/data-apis/exchangerate-host.md#exchangerate-host-live), [Fixer](https://docs.webrouter.net/data-apis/fixer.md#fixer-latest), [OANDA](https://docs.webrouter.net/data-apis/oanda.md#oanda-pricing-get), [Open Exchange Rates](https://docs.webrouter.net/data-apis/open-exchange-rates.md#open-exchange-rates-latest), [US Treasury Fiscal Data](https://docs.webrouter.net/data-apis/treasury-fiscal-data.md#treasury-fiscal-data-rates-of-exchange), [Wise](https://docs.webrouter.net/data-apis/wise.md#wise-rates-get)

```python Python theme={null}
router.call_data_api("currencylayer.convert", {'from': 'USD', 'to': 'GBP', 'amount': 10, 'date': '2024-01-31'})
```

```text MCP theme={null}
call_data_api(endpoint="currencylayer.convert", params={"from": "USD", "to": "GBP", "amount": 10, "date": "2024-01-31"})
```

> [!NOTE]
>
> * Basic plan and higher.

### Get daily rates over a date range

GET

`/timeframe`

`currencylayer.timeframe`

Daily quotes between two dates, at most 365 days apart.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`start_date` required</td><td>string</td><td>query</td><td>First date, YYYY-MM-DD. Example `2024-01-01`</td></tr>
    <tr><td>`end_date` required</td><td>string</td><td>query</td><td>Last date, YYYY-MM-DD. Example `2024-01-31`</td></tr>
    <tr><td>`source`</td><td>string</td><td>query</td><td>Source (base) currency, 3-letter code; default USD. Basic plan and higher. Example `EUR`</td></tr>
    <tr><td>`currencies`</td><td>string</td><td>query</td><td>Comma-separated 3-letter codes to limit the quotes returned. Example `EUR,GBP,JPY`</td></tr>
    <tr><td>`spread`</td><td>integer</td><td>query</td><td>1 adds bid and ask to each quote. Enterprise plan or higher. One of `0`, `1`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.apilayer.com/currencylayer/docs/api-documentation) · Same job: [exchangerate.host](https://docs.webrouter.net/data-apis/exchangerate-host.md#exchangerate-host-live), [Fixer](https://docs.webrouter.net/data-apis/fixer.md#fixer-latest), [OANDA](https://docs.webrouter.net/data-apis/oanda.md#oanda-pricing-get), [Open Exchange Rates](https://docs.webrouter.net/data-apis/open-exchange-rates.md#open-exchange-rates-latest), [US Treasury Fiscal Data](https://docs.webrouter.net/data-apis/treasury-fiscal-data.md#treasury-fiscal-data-rates-of-exchange), [Wise](https://docs.webrouter.net/data-apis/wise.md#wise-rates-get)

```python Python theme={null}
router.call_data_api("currencylayer.timeframe", {'start_date': '2024-01-01', 'end_date': '2024-01-31', 'source': 'EUR', 'currencies': 'EUR,GBP,JPY'})
```

```text MCP theme={null}
call_data_api(endpoint="currencylayer.timeframe", params={"start_date": "2024-01-01", "end_date": "2024-01-31", "source": "EUR", "currencies": "EUR,GBP,JPY"})
```

> [!NOTE]
>
> * Enterprise plan and higher.
> * Limit currencies: an unfiltered year of every currency is very large.

### Get rate changes between two dates

GET

`/change`

`currencylayer.change`

Start rate, end rate, absolute and percent change per currency.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`start_date`</td><td>string</td><td>query</td><td>First date, YYYY-MM-DD. Without dates, yesterday's close is compared with the latest rate. Example `2024-01-01`</td></tr>
    <tr><td>`end_date`</td><td>string</td><td>query</td><td>Last date, YYYY-MM-DD. Example `2024-01-31`</td></tr>
    <tr><td>`source`</td><td>string</td><td>query</td><td>Source (base) currency, 3-letter code; default USD. Basic plan and higher. Example `EUR`</td></tr>
    <tr><td>`currencies`</td><td>string</td><td>query</td><td>Comma-separated 3-letter codes to limit the quotes returned. Example `EUR,GBP,JPY`</td></tr>
  </tbody>
</table>

[Vendor docs](https://docs.apilayer.com/currencylayer/docs/api-documentation) · Same job: [exchangerate.host](https://docs.webrouter.net/data-apis/exchangerate-host.md#exchangerate-host-live), [Fixer](https://docs.webrouter.net/data-apis/fixer.md#fixer-latest), [OANDA](https://docs.webrouter.net/data-apis/oanda.md#oanda-pricing-get), [Open Exchange Rates](https://docs.webrouter.net/data-apis/open-exchange-rates.md#open-exchange-rates-latest), [US Treasury Fiscal Data](https://docs.webrouter.net/data-apis/treasury-fiscal-data.md#treasury-fiscal-data-rates-of-exchange), [Wise](https://docs.webrouter.net/data-apis/wise.md#wise-rates-get)

```python Python theme={null}
router.call_data_api("currencylayer.change", {'start_date': '2024-01-01', 'end_date': '2024-01-31', 'source': 'EUR', 'currencies': 'EUR,GBP,JPY'})
```

```text MCP theme={null}
call_data_api(endpoint="currencylayer.change", params={"start_date": "2024-01-01", "end_date": "2024-01-31", "source": "EUR", "currencies": "EUR,GBP,JPY"})
```

> [!NOTE]
>
> * Enterprise+ plan and higher.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.