Currency Data API

Currency Data API

Reliable Exchange Rates & Currency Conversion for your Business.
Free Plan $0.00 Monthly Subscribe
100 Requests / Monthly
Free for Lifetime
No Credit Card Required
MOST POPULAR
Starter Plan $14.99 Monthly Subscribe
10,000 Requests / Monthly
Standard Support
Reliable Forex Rates
Advanced Data Coverage
Real-time Updates
Advanced Features
Pro Plan $59.99 Monthly Subscribe
100,000 Requests / Monthly
Standard Support
Reliable Forex Rates
Advanced Data Coverage
Real-time Updates
Advanced Features
Enterprise Plan $99.99 Monthly Subscribe
500,000 Requests / Monthly
Standard Support
Reliable Forex Rates
Advanced Data Coverage
Real-time Updates
Advanced Features
Custom Plan Volume Monthly Contact Us
Any requests volume you need
Reliable Forex Rates
Advanced Data Coverage
Real-time Updates
Advanced Features

Currency Data API provides a simple REST API with real-time and historical exchange rates for 168 world currencies, delivering currency pairs in universally usable JSON format - compatible with any of your applications.

Spot exchange rate data is retrieved from several major forex data providers in real-time, validated, processed and delivered hourly, every 10 minutes, or even within the 60-second market window.

Providing the most representative forex market value available ("midpoint" value) for every API request, the Currency Data API API powers currency converters, mobile applications, financial software components and back-office systems all around the world.

Available Endpoints

  • /list Returns all available currencies.
  • /live Get the most recent exchange rate data.
  • /convert Convert one currency to another.
  • /historical Get historical rates for a specific day.
  • /timeframe Request exchange rates for a specific period of time.
  • /change Request any currency's change parameters (margin, percentage).

Supported Symbols

The Currency Data API comes with a constantly updated endpoint returning all available currencies. To access this list, make a request to the API's list endpoint.


{
  "success": true,
  "symbols": {
    "AED": "United Arab Emirates Dirham",
    "AFN": "Afghan Afghani",
    "ALL": "Albanian Lek",
    "AMD": "Armenian Dram",
    [...] 
    }
}

Tips

To reduce bandwidth you can limit the number of output currencies to a specific set of your choice on most API endpoints. To do so, simply append the Fixer API's symbols parameter to your API request and set it to one or more comma-separated currency codes.


curl --request GET 'https://api.apilayer.com/currency_data/live?base=USD&symbols=EUR,GBP' \
--header 'apikey: YOUR API KEY'

It is also possible to convert currencies using historical exchange rate data. To do this, please also use the API's date parameter and set it to your preferred date. (format YYYY-MM-DD)


curl --request GET 'https://api.apilayer.com/currency_data/convert?base=USD&symbols=EUR,GBP,JPY&amount=5&date=2018-01-01' \
--header 'apikey: YOUR API KEY'

Currency Data API Reference

This API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Just Getting Started?

Check out our development quickstart guide.

Authentication

Currency Data API uses API keys to authenticate requests. You can view and manage your API keys in the Accounts page.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

All requests made to the API must hold a custom HTTP header named "apikey". Implementation differs with each programming language. Below are some samples.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Endpoints

Change endpoint, you may request the change (both margin and percentage) of one or more currencies, relative to a Source Currency, within a specific time-frame (optional).

Parameters

end_date (required)

The end date of your preferred timeframe.

Location: Query, Data Type: string

start_date (required)

The start date of your preferred timeframe.

Location: Query, Data Type: string

currencies (optional)

Enter a list of comma-separated currency codes to limit output currencies.

Location: Query, Data Type: string

source (optional)

Enter the three-letter currency code of your preferred source currency.

Location: Query, Data Type: string

** A word enclosed with curly brackets "{ }" in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

Using the convert endpoint, you may request the currencylayer API to perform a Single currency conversion on your behalf.

Parameters

amount (required)

The amount to be converted.

Location: Query, Data Type: string

from (required)

The three-letter currency code of the currency you would like to convert from.

Location: Query, Data Type: string

to (required)

The three-letter currency code of the currency you would like to convert to.

Location: Query, Data Type: string

date (optional)

Specify a date (format YYYY-MM-DD) to use historical rates for this conversion.

Location: Query, Data Type: string

** A word enclosed with curly brackets "{ }" in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

Historical exchange rate data for every past day all the way back to the year of 1999.

Parameters

date (required)

Specify a date for which to request historical rates. (Format: YYYY-MM-DD)

Location: Query, Data Type: string

currencies (optional)

Specify a comma-separated list of currency codes to limit your API response to specific currencies.

Location: Query, Data Type: string

source (optional)

Specify a source currency.

Location: Query, Data Type: string

** A word enclosed with curly brackets "{ }" in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

A full list of supported currencies can be accessed both in JSON Format.

Parameters
No parameters.
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

Real-time exchange rates.

Parameters

currencies (optional)

Specify a comma-separated list of currency codes to limit your API response to specific currencies.

Location: Query, Data Type: string

source (optional)

Specify a source currency.

Location: Query, Data Type: string

** A word enclosed with curly brackets "{ }" in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

Timeframe endpoint lets you query the API for daily historical rates between two dates of your choice, with a maximum time frame of 365 days.

Parameters

end_date (required)

The end date of your preferred timeframe.

Location: Query, Data Type: string

start_date (required)

The start date of your preferred timeframe.

Location: Query, Data Type: string

currencies (optional)

Enter a list of comma-separated currency codes to limit output currencies.

Location: Query, Data Type: string

source (optional)

Enter the three-letter currency code of your preferred source currency.

Location: Query, Data Type: string

** A word enclosed with curly brackets "{ }" in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

Rate Limiting

Each subscription has its own rate limit. When you become a member, you start by choosing a rate limit that suits your usage needs. Do not worry; You can upgrade or downgrade your plan at any time. For this reason, instead of starting with a larger plan that you do not need, we can offer you to upgrade your plan after you start with "free" or "gold plan" options and start using the API.

When you reach a rate limit (both daily and monthly), the service will stop responding and returning the HTTP 429 response status code (Too many requests) for each request with the following JSON string body text.

{
"message":"You have exceeded your daily\/monthly API rate limit. Please review and upgrade your subscription plan at https:\/\/apilayer.com\/subscriptions to continue."
}

A reminder email will be sent to you when your API usage reaches both 80% and 90%, so that you can take immediate actions such as upgrading your plan in order to prevent your application using the API from being interrupted.

You can also programmatically check your rate limit yourself. As a result of each request made to the APILayer, the following 4 fields provide you with all the necessary information within the HTTP Headers.

x-ratelimit-limit-month: Request limit per month
x-ratelimit-remaining-month: Request limit remaining this month
x-ratelimit-limit-day: Request limit per day
x-ratelimit-remaining-day: Request limit remaining today

You can contact our support unit if you need any assistance with your application regarding to handle the returned result by looking at the header information.

Error Codes

APILayer uses standard HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate a clientside error, which means that failed given the information provided (e.g., a missing parameter, unauthorized access etc.). Codes in the 5xx range indicate an error with APILayer's servers (normally this should'nt happen at all).

If the response code is not 200, it means the operation failed somehow and you may need to take an action accordingly. You can check the response (which will be in JSON format) for a field called 'message' that briefly explains the error reported.

Status Code Explanation
400 - Bad Request The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized No valid API key provided.
404 - Not Found The requested resource doesn't exist.
429 - Too many requests API request limit exceeded. See section Rate Limiting for more info.
5xx - Server Error We have failed to process your request. (You can contact us anytime)

You can always contact for support and ask for more assistance. We'll be glad to assist you with building your product.

Reviews

4.75
  • Review rating
  • Review rating
  • Review rating
  • Review rating
  • Review rating
API rating
kank Akiyama
1 months ago

kank Akiyama

  • Review rating
  • Review rating
  • Review rating
  • Review rating
  • Review rating

Please continue this service for a long time.

Boris Štofik
1 months ago

Boris Štofik

  • Review rating
  • Review rating
  • Review rating
  • Review rating
  • Review rating

Works perfect and fast! :)

Bisam Hussain
3 months ago

Bisam Hussain

  • Review rating
  • Review rating
  • Review rating
  • Review rating
  • Review rating

good it is very much faster and cool

mi...@...es.dk
4 months ago

[email protected]

  • Review rating
  • Review rating
  • Review rating
  • Review rating
  • Review rating

Great product! Would though be nice to be able to fetch the average from the previous month on a specified currency.