Convert any amount from one currency to the local currency of the provided IP address or the client machine's IP address location, using the current exchange rates. This type of conversion is particularly beneficial for international businesses, e-commerce platforms, and financial applications that cater to a global audience. It allows you to provide users with pricing and transaction details in their local currency, enhancing user experience, improving customer satisfaction, and increasing conversion rates
Convert any currency to the local currency of a given IP address. Whether you're using IPv4 or IPv6, our API accurately identifies the location and provides conversions based on the latest exchange rates, ensuring localized and relevant results.
If no IP address is provided, our API automatically uses the client's IP address to determine the local currency. This allows currency conversions without manual input.
Customize the frequency of exchange rate updates for your conversions. Choose from intervals like every minute, hour, or day to get the most precise and timely conversions, tailored to your specific needs and scenarios.
$ pip install requests
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 | |
from | Yes | String | From currency symbol | |
ip | No | String | IPv4 or IPv6 geolocated currency | |
amount | No | Integer | 1 | The amount to be converted |
Field | Type | Requirement | Description |
---|---|---|---|
date | String | Mandatory | 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. |
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 |
ipAdress | String | Mandatory | It is the IP Address whose country's currency will be extracted and be used as "to". It will be the request IP if it's value is not given. |
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 | Provided IP Address [IP_ADDRESS] is invalid. |
404 | Geolocation of provided IP [IP_ADDRESS] is unknown. |
404 | Rates of provided currency [CURRENCY_CODE] are not available in our database! |
Convert the provided currency to the local currency of the IP address location that is passed using the ip query parameter. Both IPv4 and IPv6 addresses are supported. If no ip is provided, then the ip of the client machine will be used. The from parameter specifies which base currency needs to be converted. If the amount parameter is not passed, then default amount value of 1 will be converted.
# Response { "date": "2023-03-22 08:03:00+00", "from": "GBP", "to": "PKR", "rate": "346.232", "ipAddress": "182.186.18.9", "givenAmount": "500.0", "convertedAmount": "173115.892" }$ curl 'https://api.apifreaks.com/v1.0/currency/converter/ip-to-currency?apikey=API-KEY&from=GBP&ip=182.186.18.91&amount=500&updates=1d'
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-22 08:03:00+00", "from": "GBP", "to": "PKR", "rate": "346.232", "ipAddress": "182.186.18.9", "givenAmount": "500.0", "convertedAmount": "173115.892" }$ curl 'https://api.apifreaks.com/v1.0/currency/converter/ip-to-currency?apikey=API-KEY&from=GBP&ip=182.186.18.91&amount=500&updates=10m'
To use the Geolocalized Currency Converter API, 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 IP Currency Converter | 3 credits |
Hourly Price Updates IP Currency Converter | 4 credits |
10-Minute Price Updates IP Currency Converter | 5 credits |
1-Minute Price Updates IP Currency Converter | 6 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.