Intro
If you want a free exchange rates API with no API key requirement for a small project then this is what you're looking for!
This open access API is subject to our Terms. You're welcome to cache the data we respond with and to use it for either personal or commercial currency conversion purposes. You are, however, not allowed to re-distribute it.
Differences Between Open / Free / Pro
Rate Limiting
We've been providing free versions of our currency conversion API for over 10 years now and have experienced the inevitable DDoS attacks & broken while(1){}
loops during this time. As such our open access free exchange rate API is rate limited.
• If you only request once every 24 hours you won't need to read any more of this section. Easy!
• If you can't keep a cached response for that long, you could request once every hour and still never get rate limited.
These suggestions are quite reasonable because:
• The data only refreshes once every 24 hours anyway.
• Included in the response is the specific time of the next data update.
• Our Terms permit caching of the data.
Don't panic if you send too many requests due to a bug and get rate limited. After 20 minutes the rate limit will finish and allow new requests.
Finally, we ask developers to vary the time of their requests if possible: e.g. use something like `time_next_update_unix` + rand(30,300)
to schedule your next request. This helps us manage the big spike in load at each update time.
Attribution
We don't require attribution but you are welcome to use the link below (we'd sure appreciate it). The more popular our currency converter API gets the better we can make this free & open version! You're welcome to change the link text if you'd like.
<a href="https://www.exchangerate-api.com">Currency Conversion by ExchangeRate-API.com</a>
Request Format Documentation
We use ISO 4217 Three Letter Currency Codes - e.g. USD for US Dollars, EUR for Euro etc. Here's the list of currency codes we support.
GET https://open.exchangerate-api.com/v6/latest
This will return the exchange rates from USD to all the other currencies we support:
{
"result": "success",
"documentation": "https://www.exchangerate-api.com/docs/free",
"terms_of_use": "https://www.exchangerate-api.com/terms",
"time_last_update_unix": 1585872397,
"time_last_update_utc": "Fri, 02 Apr 2020 00:06:37 +0000",
"time_next_update_unix": 1585959987,
"time_next_update_utc": "Sat, 03 Apr 2020 00:26:27 +0000",
"time_eol_unix": 0,
"base_code": "USD",
"rates": {
"USD": 1,
"AED": 3.67,
"ARS": 64.51,
"AUD": 1.65,
"CAD": 1.42,
"CHF": 0.97,
"CLP": 864.53,
"CNY": 7.1,
"EUR": 0.919,
"GBP": 0.806,
"HKD": 7.75,
"...": 7.85,
"...": 1.31,
"...": 7.47, etc. etc.
}
}
Note on EOL field
Over time we inevitably have to stop supporting certain endpoints or infrastructure and we can't predict when this will be. A lot of free services don't worry about this and just come and go - leaving users in trouble when they suddenly close down.
So whenever the time comes that we need to stop supporting this endpoint the `time_eol`
field will start showing the unix time of expected deprecation. This way you can set appropriate alerting in your code and have some time to make a new plan.
Error Responses
Successful responses will show success
for the result
field. In the event that there is an error in serving the response this field will state error
and another field called error-type
will be returned.
We rate limit in our infrastructure before network rate limiting kicks in. In the event that you get rate limited you will receive the response:
{
"result":"error",
"error-type":"rate-limited"
}
If you keep sending requests after receiving this then your traffic will start to get dropped at the network edge and you won't get any response for a few hours.