Currency Data Without the Price Tag
Most currency APIs charge for real-time rates. ExchangeRate-API gives you 1500 requests/month free with no API key needed for the open endpoint.
No-Key Endpoint (Open Access)
import requests
def get_rates(base="USD"):
r = requests.get(f"https://open.er-api.com/v6/latest/{base}")
data = r.json()
return data["rates"]
rates = get_rates("USD")
print(f"1 USD = {rates[EUR]:.4f} EUR")
print(f"1 USD = {rates[GBP]:.4f} GBP")
print(f"1 USD = {rates[JPY]:.2f} JPY")
Currency Converter
def convert(amount, from_currency, to_currency):
rates = get_rates(from_currency)
result = amount * rates[to_currency]
return round(result, 2)
print(f"$100 = {convert(100, USD, EUR)} EUR")
print(f"$100 = {convert(100, USD, JPY)} JPY")
print(f"100 GBP = {convert(100, GBP, USD)} USD")
Historical Rates (With Free Key)
API_KEY = "your_free_key" # Get at exchangerate-api.com
def historical_rate(base, target, year, month, day):
r = requests.get(f"https://v6.exchangerate-api.com/v6/{API_KEY}/history/{base}/{year}/{month}/{day}")
return r.json()["conversion_rates"][target]
rate = historical_rate("USD", "EUR", 2025, 1, 15)
print(f"USD/EUR on 2025-01-15: {rate}")
Supported Currencies
161 currencies including all major ones plus crypto-adjacent stablecoins.
Free vs Paid
| Feature | Free (no key) | Free (with key) | Paid |
|---|---|---|---|
| Requests | Unlimited* | 1500/mo | 100K/mo |
| Update frequency | Daily | Daily | Every 60s |
| Historical rates | No | Yes | Yes |
| Pair conversion | No | Yes | Yes |
*Open endpoint has no hard limit but is rate-limited.
Alternatives
| API | Free Tier | Real-time? |
|---|---|---|
| ExchangeRate-API | 1500/mo | Daily |
| Frankfurter | Unlimited | Daily |
| Fixer.io | 100/mo | Hourly (paid) |
| CurrencyAPI | 300/mo | Daily |
Frankfurter (api.frankfurter.app) is fully free and open-source if you need unlimited calls.
More from me: 10 Dev Tools I Use Daily | 77 Scrapers on a Schedule | 150+ Free APIs
Top comments (0)