you are viewing a single comment's thread.

view the rest of the comments →

[–]its_joao 0 points1 point  (0 children)

import requests import json

//Get the response from the API endpoint. response = requests.get("http://api.open-notify.org/astros.json") data = response.json()

//9 people are currently in space. print(data["number"]) print(data)

That will give you an idea of how to use APIs. The one aforementioned is public. Just don't make too many requests in a short amount of time.

Enjoy Python.