import requests
def usd_to_kzt(usd):
url = "
https://api.exchangerate-api.com/v4/latest/USD "
response = requests.get(url)
data = response.json()
exchange_rate = data["rates"]["KZT"]
kzt = usd * exchange_rate
return kzt
usd_amount = 1 # Сумма USD
kzt_amount = usd_to_kzt(usd_amount)
print(f"{usd_amount} USD = {kzt_amount} KZT")
Самое главное что бы апишка была вечная и работала.