AIBOSS1441 / READ-ME

1 stars 0 forks source link

C# #4

Open AIBOSS1441 opened 1 week ago

AIBOSS1441 commented 1 week ago

import requests

api_key = 'YOUR_API_KEY' url = f'https://api.coinlayer.com/live?access_key={api_key}&symbols=BTC,ETH'

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

btc_to_usd = data['rates']['BTC'] eth_to_usd = data['rates']['ETH']

print(f"1 BTC = {btc_to_usd} USD") print(f"1 ETH = {eth_to_usd} USD")