GETΒΆ


This examples illustrates a simple synchronous HTTP GET request on the position of the ISS and displays it on the canvas. Reloading the screen should update the coordinates of the ISS.
from p5 import *

def setup():
    size(400, 400)
    no_loop()

def draw():
    background(220)
    sleep(0.5)
    sat_data = http_get('https://api.wheretheiss.at/v1/satellites/25544')
    lat = sat_data['latitude']
    log = sat_data['longitude']
    print(lat,log)
    fill(0)
    text("  latitude = " + str(lat) + "  longitude = " + str(log),(0,200))

run(mode='P3D')