Currency Conversion API
USD-EUR Currency Conversion API
The Currency Conversion API provides real-time exchange rates between USD (United States Dollar) and EUR (Euro). This API allows you to:
- Convert USD to EUR at current market rates
- Convert EUR to USD at current market rates
- Get accurate conversions for any amount
- Access real-time exchange rate data
The API uses up-to-date exchange rates and provides instant conversions between these two major world currencies.
/v1/convertcurrency GET
https://api.api-ninjas.com/v1/convertcurrency
Parameters
- haverequired- Currency you currently hold. For example, - USDor- EUR.
- wantrequired- Currency you want to convert to. For example, - USDor- EUR.
- amountrequired- Amount of currency to convert. 
Headers
- X-Api-Keyrequired- API Key associated with your account. 
Sample Request Live Demo!
have
want
amount
https://api.api-ninjas.com/v1/convertcurrency?have=USD&want=EUR&amount=1000Sample Response
JSON
1
2
3
4
5
6
{
  "old_amount": 1000,
  "old_currency": "USD",
  "new_currency": "EUR",
  "new_amount": 920.45
}Code Examples
1
2
3
4
5
6
7
8
import requests
api_url = 'https://api.api-ninjas.com/v1/convertcurrency?have=USD&want=EUR&amount=1000'
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code == requests.codes.ok:
    print(response.text)
else:
    print("Error:", response.status_code, response.text)If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.