bikas
Currency Converter First Deployment
1f6c124
raw
history blame
430 Bytes
import requests
BASE_URL = "https://api.frankfurter.app"
def get_currencies():
"""
Fetch the list of available currencies from Frankfurter API.
Returns a list of currency codes.
"""
response = requests.get(f"{BASE_URL}/currencies")
if response.status_code == 200:
currencies = response.json()
return list(currencies.keys())
else:
raise Exception("Failed to fetch currencies")