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.
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.
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.
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.
$ pip install requests
$ pip install requests
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
from | Yes | String | From currency symbol | |
to | Yes | String | To currency symbol | |
amount | No | Integer | 1 | 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.
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
updates | Yes | String | 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.
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
date | Yes | String | specific date (format YYYY-MM-DD) of which exchange rates is used. |
Field | Type | Requirement | Description |
---|---|---|---|
date | String | Mandatory | 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 |
from | String | Mandatory | It is the base currency code whose amount will be converted. |
to | String | Mandatory | It is the desired currency code of which converted value is required |
rate | String | Mandatory | It is the current base rate with base currency as desired converted currency and quote currency as from currency code |
givenAmount | String | Mandatory | The amount to be converted. It can be given in the input |
convertedAmount | String | Mandatory | Converted amount in the desired currency |
HTTP Status | Reasons |
---|---|
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! |
HTTP Status | Reasons |
---|---|
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! |
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# Response { "date": "2023-03-21 15:22:00+00", "from": "USD", "to": "PKR", "rate": "281.683", "givenAmount": "500.0", "convertedAmount": "140841.475" }$ curl 'https://api.apifreaks.com/v1.0/currency/converter/latest/prices?apikey=API-KEY&from=USD&to=PKR&amount=500&updates=1h'
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.# Response { "date": "2023-03-21 15:22:00+00", "from": "USD", "to": "PKR", "rate": "281.683", "givenAmount": "500.0", "convertedAmount": "140841.475" }$ curl 'https://api.apifreaks.com/v1.0/currency/converter/latest/prices?apikey=API-KEY&from=USD&to=PKR&amount=500&updates=10m'
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.
# Response { "date": "2022-01-10", "from": "USD", "to": "PKR", "rate": "176.750", "givenAmount": "500.0", "convertedAmount": "88375.000" }$ curl 'https://api.apifreaks.com/v1.0/currency/converter/historical/prices?apikey=API-KEY&date=2022-01-10&from=USD&to=PKR&amount=500'
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.
Service | Credits |
---|---|
Daily Price Updates Converter | 1 credit |
Hourly Price Updates Converter | 2 credits |
10-Minute Price Updates Converter | 3 credits |
1-Minute Price Updates Converter | 4 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.