-->
Best 4 Free Exchange Rate APIs With Python Examples (Step-by-Step with YouTube Video)

Best 4 Free Exchange Rate APIs With Python Examples (Step-by-Step with YouTube Video)

Back to top

Updated by Ashirafu Kibalama on September 16, 2024

Step-by-Step with YouTube Video: Here are the Best 4 Free Exchange Rate APIs With Python Examples.








Navigating currency exchange rates can be challenging for developers and businesses.


Luckily, there are free, reliable exchange rate APIs such as ExchangeRate-API, Open Exchange Rates, CurrencyFreaks, and FreeCurrencyAPI.


This post will introduce and provide Python examples for using these APIs and a helpful YouTube guide.


Learn to access and utilize these powerful APIs for currency conversions and financial applications, regardless of your experience level.


Watch my YouTube video on The Best 4 Free Exchange Rate API With Python Examples - Tutorial.







Top 4 Free Exchange Rate APIs With Python Example



1) ExchangeRate-API




Overview:

ExchangeRate-API provides reliable and accurate exchange rates for over 160 currencies. It offers a free tier with access to basic features and data updates every 24 hours.


Features:

  • Supports 160+ currencies
  • JSON API format
  • Data updates every 24 hours on the free tier
  • Easy-to-use documentation
  • Simple to use, 1,500 requests/month on the free plan.


Free Exchange Rate API Python (Usage Example) for ExchangeRate-API:



import requests

api_key = 'fc3efcf3b0b4e023e69a8e89' # change to your api_key
from_currency = 'USD'
to_currency = 'INR'

amount = 100


# GET https://v6.exchangerate-api.com/v6/YOUR-API-KEY/latest/USD
url = f'https://v6.exchangerate-api.com/v6/{api_key}/latest/{from_currency}'

response = requests.get(url)
data = response.json()

# print(data)

exchange_rate = data['conversion_rates'][f'{to_currency}']

print(exchange_rate)

converted_amount = exchange_rate * amount
print(f'{amount} {from_currency} = {converted_amount} {to_currency}')



#Output






2) Open Exchange Rates






Overview:

Open Exchange Rates offers exchange rate data for over 200 currencies. Its free tier provides hourly updates and access to historical data.


Features:

  • Supports 200+ currencies
  • JSON API format
  • Hourly updates on the free tier
  • Access to historical data
  • User-friendly documentation
  • 1,000 requests/month on the free plan.


Free Exchange Rate API Python (Usage Example) for Open Exchange Rates:


import requests

api_key = 'ca7665fe993e4ce5a1c6d77dc9f0261d' # change to your api_key
from_currency = 'USD'
to_currency = 'EUR'

amount = 100


# https://openexchangerates.org/api/latest.json?app_id=YOUR_APP_ID
url = f'https://openexchangerates.org/api/latest.json?app_id={api_key}'

response = requests.get(url)
data = response.json()

# print(data)

exchange_rate = data['rates'][f'{to_currency}']

print(exchange_rate)

converted_amount = exchange_rate * amount
print(f'{amount} {from_currency} = {converted_amount} {to_currency}')


#Output






3) CurrencyFreaks





Overview:

CurrencyFreaks provides exchange rate data for over 130 currencies. It offers a free tier with real-time data updates and supports various data formats.


Features:

  • Supports 130+ currencies
  • Real-time data updates on the free tier
  • JSON, XML, and CSV data formats
  • Simple and comprehensive documentation
  • 1000 API Calls/Month on the free plan


Free Exchange Rate API Python (Usage Example) for CurrencyFreaks:


import requests

api_key = 'cd257439b8354166a4440eaee927f6ea' # change to your api_key
from_currency = 'USD'
to_currency = 'EUR'

amount = 100


# https://api.currencyfreaks.com/v2.0/rates/latest?apikey=YOUR_APIKEY
url = f'https://api.currencyfreaks.com/v2.0/rates/latest?apikey={api_key}'

response = requests.get(url)
data = response.json()

# print(data)

exchange_rate = float(data['rates'][f'{to_currency}'])

print(exchange_rate)

converted_amount = exchange_rate * amount
print(f'{amount} {from_currency} = {converted_amount} {to_currency}')


#Output







4) FreeCurrencyAPI





Overview:

FreeCurrencyAPI offers exchange rate data for over 150 currencies. Its free tier provides real-time updates and supports multiple data formats.


Features:

  • Supports 150+ currencies
  • Real-time data updates on the free tier
  • JSON, XML, and CSV data formats
  • Detailed and easy-to-understand documentation
  • 5k Free Monthly Requests on free plan


Free Exchange Rate API Python (Usage Example) for FreeCurrencyAPI:



import requests

api_key = 'fca_live_ZPF3ogjUQFbW1hl7AbQVqWArlkrntqYnGcZE2Wr0' # change to your api_key
from_currency = 'USD'
to_currency = 'INR'

amount = 100

# "https://api.freecurrencyapi.com/v1/latest?apikey=YOUR-APIKEY"


url = f'https://api.freecurrencyapi.com/v1/latest?apikey={api_key}'

response = requests.get(url)
data = response.json()

# print(data)

exchange_rate = data['data'][f'{to_currency}']

print(exchange_rate)

converted_amount = exchange_rate * amount
print(f'{amount} {from_currency} = {converted_amount} {to_currency}')


#Output






Conclusion


This blog post explored the top four free exchange rate APIs: ExchangeRate-API, Open Exchange Rates, CurrencyFreaks, and FreeCurrencyAPI.


We've demonstrated how to integrate these APIs into projects using Python examples.

Our video tutorial provides a visual guide to help you implement these APIs.


Each API provides a free tier, allowing you to access exchange rate data for various currencies.

They all offer user-friendly documentation, real-time updates, and support for multiple data formats.


You can choose the one that best suits your needs based on your specific requirements (e.g., number of currencies, update frequency, data format).

Happy coding!


Related Posts:


Best 2 Free Weather APIs without API Key or Authentication or Subscription Required With Python Examples


2 Build a CV or Resume Generator pdf Flask Python With Source Code (Step-by-Step with YouTube Video) 


Other Posts:


A Beginner's Complete Guide: Deploy Flask App with SQLite/ PostgreSQL Database on cPanel/ shared hosting 


How Do I Add or Connect a Flask Python Website To Google Search Console?


How Do I Add or Connect Google Analytics to a Flask Python Website?


3 Methods To Add Python Interpreter To Pycharm IDE / Fix: Failed To Create Interpreter Pycharm