Documentation

Examples / Code Snippets

A small collection of code snippets, provided for the most common programming languages.

// latest rates
curl "https://freecurrencyapi.net/api/v2/latest?apikey=YOUR-APIKEY"

Error Codes

If your query fails, we will return a 3-digit error-code that indicates the problem that has led to the failure.

Status Code Comment
200 Successful Request
429 You have hit your rate-limit
404 A requested resource does not exist
500 Internal Server Error - let us know: freecurrencyapidotnet.net

GET Latest Rates: https://freecurrencyapi.net/api/v2/latest

Returns the latest exchange rates. We update the data every 30 seconds. Keep in mind that some currencies might be updated less often.

Request Parameters:

Parameter Required Type Comment
apikey false string you can make 10 requests without apikey before running into a rate limit.
base_currency false string The default base currency is 'USD'.

GET Historical Rates: https://freecurrencyapi.net/api/v2/historical

Returns exchange rates for a given time range. Generally, we provide data going back to 1999.

Request Parameters:

Parameter Required Type Comment
apikey false string you can make 10 requests without apikey before running into a rate limit.
base_currency false string The default base currency is 'USD'.
date_from false string (format: Y-m-d) The start date of your timeframe
date_to false string (format: Y-m-d) The end date of your timeframe