API Access Key & Authentication
After signing up, every user is assigned a personal API Access Key - a unique "password" used to make requests to the API.
To authenticate with the Exchange Rate API, attach your access_key to the base URL:
https://api.apilayer.net/exchangerate/latest?access_key=YOUR_ACCESS_KEYDefinitions
| Term | Meaning |
|---|---|
| API Access Key | The unique key assigned to your account, used to authenticate with the API. |
| Symbol | The three-letter code of a currency, for example USD. |
| Base currency | The currency that rates are relative to. If 1 EUR = X USD, EUR is the base currency. |
| Target currency | The currency an amount is converted to. If 1 EUR = X USD, USD is the target currency. |
| Base URL | The URL all API requests start with: https://api.apilayer.net/exchangerate/ |
Make an API Request
Add the endpoint name to the base URL, then your access key and any parameters:
https://api.apilayer.net/exchangerate/latest?access_key=YOUR_ACCESS_KEY&base=EUR&symbols=USD,GBP,JPYOptional parameters available on most endpoints:
base three-letter code of the base currency
(default EUR, available on selected plans)
symbols comma-separated currency codes to return
(leave out to return all currencies)
format set to "1" for prettified JSON
(use only for debugging)
callback your JSONP callback function name
(see "JSONP Callbacks" below)API Response
All data is returned in standard JSON format. By default, rates are relative to EUR and time-stamped at the time they were collected.
{
"success": true,
"timestamp": 1790917745,
"base": "EUR",
"date": "2026-10-02",
"rates": {
"USD": 1.12537,
"GBP": 0.851832,
"JPY": 177.604168
}
}API Response Objects
| Object | Description |
|---|---|
| "success" | Returns true if the request succeeded, false if it failed. |
| "timestamp" | UNIX time stamp of when the rates were collected. |
| "base" | Three-letter code of the base currency. |
| "date" | Date the rates were collected. |
| "rates" | Exchange rates, keyed by three-letter currency code. |
Available Endpoints
- /latest - real-time exchange rates for all or selected currencies.
- /{YYYY-MM-DD} - end-of-day rates for one past date.
- /convert - convert any amount from one currency to another.
- /timeseries - daily rates between two dates.
- /fluctuation - how rates changed between two dates.
- /symbols - all supported currencies.
Depending on your subscription plan, some endpoints and options may not be available. See API Features for details and examples.
256-bit HTTPS Encryption
All plans come with 256-bit HTTPS encryption. Always use https:// when calling the API.
JSONP Callbacks
The API supports JSONP callbacks. Pass your function name in the callback parameter and the API returns the response wrapped in that function.
https://api.apilayer.net/exchangerate/latest?access_key=YOUR_ACCESS_KEY&symbols=USD,GBP&callback=MY_FUNCTIONExample response:
MY_FUNCTION({
"success": true,
"timestamp": 1790917745,
"base": "EUR",
"date": "2026-10-02",
"rates": {
"USD": 1.12537,
"GBP": 0.851832
}
})JSON Formatting
Set format=1 to get a prettified JSON response. Use this only for debugging, because it increases the response size.
API Error Codes
If a request fails, the API returns "success": false with an error code, type and message:
{
"success": false,
"error": {
"code": 104,
"type": "usage_limit_reached",
"info": "Your monthly usage limit has been reached. Please upgrade your Subscription Plan."
}
}| Code | Type | Description |
|---|---|---|
| 101 | missing_access_key / invalid_access_key | No API key or an invalid API key was supplied. |
| 102 | inactive_user | The user account is not active. |
| 103 | invalid_api_function | The requested endpoint does not exist. An unknown name such as /foo is read as a date and returns 302 instead. |
| 104 | usage_limit_reached | The monthly request limit of your plan has been reached. |
| 105 | function_access_restricted | Your plan does not support this endpoint or option. |
| 105 | base_currency_access_restricted | Your plan does not include changing base. Returned with HTTP 400. This error has no info text. |
| 106 | no_rates_available | The query did not return any results, for example a date with no data such as /1990-01-01. |
| 201 | invalid_base_currency | An invalid base currency was supplied. This error has no info text. |
| 202 | invalid_currency_codes | One or more invalid currency codes were supplied in symbols. The message says currencies=. |
| 302 | invalid_date | An invalid date was supplied. An unknown endpoint name such as /foo also returns 302. |
| 303 | currency_not_available_on_date | No data for the requested currency on that date. New currencies are only available from the date they were added. |
| 402 | invalid_from_currency | Missing or invalid from currency (same code as to). [convert] |
| 402 | invalid_to_currency | Missing or invalid to currency. [convert] |
| 403 | invalid_conversion_amount | Missing or invalid amount. [convert] |
| 501 | no_timeframe_supplied | Only one of start_date / end_date was supplied. [timeseries, fluctuation] |
| 502 | invalid_start_date | An invalid start_date was supplied. [timeseries, fluctuation] |
| 503 | invalid_end_date | An invalid end_date was supplied. [timeseries, fluctuation] |
| 504 | invalid_time_frame | start_date is after end_date. [timeseries] |
| 505 | time_frame_too_long | The time frame is longer than 365 days. [timeseries] |
A missing or invalid API key, an unknown path and other gateway errors are explained on the API Error Codes page.