def call_api():
    URL = 'https://api.coindesk.com/v1/bpi/currentprice.json'
    conn = setup()
    while 1:
        r = requests.get(url=URL)
        current_time = datetime.now()
        data = r.json()
        price = data['bpi']['USD']['rate_float']
        cur = conn.cursor()
        cur.execute(f"INSERT INTO BT_Price (Created_at,Price) VALUES ('{str(current_time)}', {price})")
        conn.commit()
        time.sleep(15)
def call_api():
    URL = 'https://api.coindesk.com/v1/bpi/currentprice.json'
    conn = setup()
    while 1:
        r = requests.get(url=URL)
        current_time = datetime.now()
        data = r.json()
        price = data['bpi']['USD']['rate_float']
        cur = conn.cursor()
        cur.execute(f"INSERT INTO BT_Price (Created_at,Price) VALUES ('{str(current_time)}', {price})")
        conn.commit()
        time.sleep(15)