This API converts prices to the local currency based on the user's location (150+ countries). It provides exchange rates and currency symbols for easy integration into e-commerce websites.
https://geo-currency-api.onrender.com
Endpoint: /geo-currency/
Method: GET
Description: Converts the price from USD to the local currency based on the user's location.
Response:
{
"status": "success",
"data": {
"base": "USD",
"convertedTo": "NGN",
"rate": 1471.70463884,
"currency_symbol": "₦"
},
"user_location": {
"country": "Nigeria",
"countryCode": "NG",
"city": "Lagos"
}
}
Endpoint: /geo-currency/{currency/}
Method: GET
Description: Converts the price from the specified currency to the local currency based on the user's location.
Parameters:
- currency: The currency code to convert from (e.g., EUR, GBP, JPY). Example: /EUR/
Response:
{
"status": "success",
"data": {
"base": "EUR",
"convertedTo": "NGN",
"rate": 1631.59510503,
"currency_symbol": "₦"
},
"user_location": {
"country": "Nigeria",
"countryCode": "NG",
"city": "Lagos"
}
}
Default Conversion: Send a GET request to / to get the conversion rate from USD to the user's local currency.
Specific Conversion: Send a GET request to /{currency}/ to get the conversion rate from the specified currency to the user's local currency.
To install and run the API, follow these steps:
- Clone the repository:
git clone https://github.com/deji12/currency-conversion-api.git
- Navigate to the project directory:
cd currency-conversion-api
- Install the required dependencies:
pip install -r requirements.txt
- Start the API server:
python manage.py runserver