Free Forex API just got an upgrade!

We're happy to announce that freeforexapi.com has now partnered up with currencylayer in an effort to offer you an even better free API service. To keep using our free currency API, please use the button below to get an API key.

Get Free API Access

Free Forex API

The Free Forex API is a simple REST API providing real-time foreign exchange rates for the major currency pairs. No more, no less.

Terms of Use !Important!

The Free Forex API is only for use for displaying the rate information on a webpage. Our monitoring systems constantly check the use of the API to ensure that there is no unauthorised use.

In order to prevent your site from being blacklisted, all you have to do is add the following linked image to your site next to where the rates are shown

Free Forex API

The code for the linked image is provided below.

<a href="https://www.freeforexapi.com">
    <img alt="Free Forex API" src="https://www.freeforexapi.com/Images/link.png" height="20">
</a>

What if my site has been blacklisted?

If the API returns an error message that the source has been blacklisted, please contact [email protected] providing the following information:

  • A telephone number (including international dialing code) on which you can be contacted.
  • The website address
  • Location of the image link as described above
  • Any other details such as alternate IP addresses that you are calling the API from that are different from the DNS entries for your domain name.

As soon as we verify the site we will unlock your site/address for future access. We will also whitelist your site to prevent it being blocked again. We are currently working through a backlog so please bare with us, we handle each request in the order it is received.

Our monitoring systems are sensitve, however they do implement a 'benefit of the doubt' policy, if a source is flagged as suspicious, the homepage of that source is scanned and if the image link is found, the source is whitelisted.

API use

The API is very simple and easy to use. There is one end point to access all of the rates data.
https://www.freeforexapi.com/api/live
Calling the end point will provide a list of the currency pairs that are supported. These are the 8 'major' currency pairs that make up over 93% of the global foriegn exchange market. Each pair uses the base currency as determined by the establised priority rankings, these are

  • Euro (EUR) - Highest Priority
  • UK Pound Sterling (GBP)
  • Australian Dollar (AUD)
  • New Zealand Dollar (NZD)
  • Unites States Dollar (USD)
  • Canadian Dollar (CAD)
  • Swiss Franc (CHF)
  • Japanese Yen (JPY) - Lowest Priority

{
    "supportedPairs":[
        "EURUSD",
        "EURGBP",
        "GBPUSD",
        "USDJPY",
        "AUDUSD",
        "USDCHF",
        "NZDUSD",
        "USDCAD",
        "USDZAR"
    ],
    "message":"'pairs' parameter is required",
    "code":1001
}

Get rates data

To get the rates data, simply add the parameter 'pairs' with one or more currency pairs as a comma separated list. Each rate returned contains a timestamp which is the time since the rate was last updated. The time is represented as milliseconds as defined here
Example 1:  Get the current rate for EURUSD
//Request
https://www.freeforexapi.com/api/live?pairs=EURUSD

//Response
{
    "rates":{
        "EURUSD":{
            "rate":1.170228,
            "timestamp":1532428704963}
        },
    "code":200
}
Example 2:  Get current rate for EURGBP and USDJPY
//Request
https://www.freeforexapi.com/api/live?pairs=EURGBP,USDJPY

//Response
{
    "rates":{
        "EURGBP":{
            "rate":0.891724,
            "timestamp":1532429549281
        },
        "USDJPY":{
            "rate":111.1307,
            "timestamp":1532429549281
        }
    },
    "code":200
}

Error codes

{
    "message":"'pairs' parameter is required",
    "code":1001
}

{
    "message":"The currency pair 'USDABC' was not recognised or supported",
    "code":1002
}