Currency Conversion API - Latest and Historical Currency Conversion

Easily change any amount between two currencies using real-time or historical exchange rates using our currency conversion api. Convert currency on a specific date or get up-to-date conversion rates using the latest exchange rates. Our service gives you detailed, accurate and reliable currency conversion data.

10K Free Credits, No Credit Card Required

Features

Real-Time Currency Conversion

Instantly convert any amount between currencies using the latest exchange rates. Whether you need to convert small amounts or large sums, our API provides accurate and up-to-date conversions to ensure you get the most reliable results.

Historical Conversion Accuracy

Convert currencies based on historical exchange rates, allowing you to analyze financial trends or conduct retroactive calculations. Ideal for financial reporting, auditing, or comparing past and present values.

Customizable Conversion Frequency

Specify the update frequency for exchange rates to match your needs. Choose from options like every minute, every hour, or daily updates to ensure your conversions are as current as required for your use case.

Documentation

API Endpoint

Latest Rates Currency Converter

GET

https://api.apifreaks.com/v1.0/currency/converter/latest/prices

Test
LANGUAGE
Python
PHP
Java
Node
Ruby
$ pip install requests

Historical Rates Currency Converter

GET

https://api.apifreaks.com/v1.0/currency/converter/historical/prices

Test
LANGUAGE
Python
PHP
Java
Node
Ruby
$ pip install requests

API Request

ParameterRequiredTypeDefaultDescription
fromYesString
From currency symbol
toYesString
To currency symbol
amountNoInteger1
The amount to be converted

Latest rates converter endpoint, you must also pass the updates parameter to get the conversion based on the exchange rate values that get updated in our database at the specified rate.

ParameterRequiredTypeDefaultDescription
updatesYesString
Exchange rates update period. Possible values are: (1) 1d - daily update (2) 1h - hourly update (3) 10m - 10 minute update (4) 1m - 1 minute update

For historical rates converter endpoint, you must provide the date parameter to perform the conversion using the exchange rates for that date.

ParameterRequiredTypeDefaultDescription
dateYesString
specific date (format YYYY-MM-DD) of which exchange rates is used.

API Response

FieldTypeRequirementDescription
dateStringMandatory
For the latest rates converter, it is the date and time with time zone included in it (UTC). It represents the exact time at which this rate of conversion was recorded in our database. For historical rates converter, it is the date for which data is requested. It is provided via input param
fromStringMandatory
It is the base currency code whose amount will be converted.
toStringMandatory
It is the desired currency code of which converted value is required
rateStringMandatory
It is the current base rate with base currency as desired converted currency and quote currency as from currency code
givenAmountStringMandatory
The amount to be converted. It can be given in the input
convertedAmountStringMandatory
Converted amount in the desired currency

HTTP Error Codes

Latest Rates Currency Converter

HTTP StatusReasons
400
Invalid Amount. Please provide amount in decimal format and greater than 0!
404
Rates of provided currency [CURRENCY_CODE] are not available in our database!

Historical Rates Currency Converter

HTTP StatusReasons
400
Provided Date [DATE] is in invalid format. It should be like YYYY-MM-DD!
400
Invalid Amount. Please provide amount in decimal format and greater than 0!
404
Rates of provided currency [CURRENCY_CODE] are not available in our database!
404
Rates of provided currency [DATE] are not available in our database!
404
Rates of provided currency [CURRENCYCODE] are available from [AVAILABLEFROMDATE] to [AVAILABLEUNTIL_DATE] in our database!

How-To-Guides

Currency Conversion According to Latest Rate

Convert any amount from one currency to another currency using the latest rate. Provide the from query parameter to provide the currency to convert, to query parameter to provide currency to convert to and amount query parameter to provide the amount to convert. The amount parameter is optional with default value as 1.

# Convert the amount 500 from usd to pkr
$ curl 'https://api.apifreaks.com/v1.0/currency/converter/latest/prices?apikey=API-KEY&from=USD&to=PKR&amount=500&updates=1h'
# Response { "date": "2023-03-21 15:22:00+00", "from": "USD", "to": "PKR", "rate": "281.683", "givenAmount": "500.0", "convertedAmount": "140841.475" }

Currency Conversion by Specifying Exchange Rates Update Period

For the latest rate conversion endpoint, pass the updates query parameter to get the conversion according to exchange rates that are updated after a specific period. The possible values are 1d, 1h, 10m, and 1m which will return the converted currencies that get updated every 1 day, 1 hour, 10 minutes and 1 minute respectively.

# Get currency conversion with exchange rates updated every 10 minutes.
$ curl 'https://api.apifreaks.com/v1.0/currency/converter/latest/prices?apikey=API-KEY&from=USD&to=PKR&amount=500&updates=10m'
# Response { "date": "2023-03-21 15:22:00+00", "from": "USD", "to": "PKR", "rate": "281.683", "givenAmount": "500.0", "convertedAmount": "140841.475" }

Currency Conversion for a Specific Date

Convert amount from one currency to another according to any past date. Provide the date query parameter to perform the conversion using the exchange rates for that date.

$ curl 'https://api.apifreaks.com/v1.0/currency/converter/historical/prices?apikey=API-KEY&date=2022-01-10&from=USD&to=PKR&amount=500'
# Response { "date": "2022-01-10", "from": "USD", "to": "PKR", "rate": "176.750", "givenAmount": "500.0", "convertedAmount": "88375.000" }

Pricing

To use the Currency Converter APIs, API credits are required. Charges are applied only for successful queries, indicated by a 2xx status code. If a request results in a 4xx or 5xx status code, no credits will be deducted, and any credits already charged will be promptly refunded.

ServiceCredits
Daily Price Updates Converter 1 credit
Hourly Price Updates Converter2 credits
10-Minute Price Updates Converter 3 credits
1-Minute Price Updates Converter4 credits
Historical Price Currency Converter 3 credits

Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, ensuring you stay informed about your remaining balance and can optimize your resource allocation effectively.

Price Estimation Calculator