Spaces:
Runtime error
Runtime error
File size: 430 Bytes
1f6c124 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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")
|