#!/usr/bin/env python3 import requests from requests.exceptions import HTTPError from http.server import BaseHTTPRequestHandler, HTTPServer import time class MyServer(BaseHTTPRequestHandler): def do_GET(self): try: response = requests.get('https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd&include_market_cap=false&include_24hr_vol=true&include_24hr_change=true&include_last_updated_at=true&precision=2') response.raise_for_status() # access JSOn content jsonResponse = response.json() print("Entire JSON response") print(jsonResponse) print(jsonResponse["ethereum"]["usd"]) except HTTPError as http_err: print('HTTP error occurred:', http_err) except Exception as err: print('Other error occurred:', err) self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() self.wfile.write(bytes("