Get the Books
Enjoying these notebooks and want to support the work? Check out the practical books on Data Science, Visualisation, and Evolutionary Algorithms.
Get the books
Requests and JSON
Preamble¶
In [1]:
import requests
Get JSON from URL¶
In [22]:
response = requests.get('https://api.github.com')
if response.status_code == 200:
print('Success!')
elif response.status_code == 404:
print('Not Found.')
In [25]:
json_response = response.json()
json_response
Out[25]:
In [27]:
print(json_response['team_url'])
Support this work
You can support this work by getting the e-books. This notebook will always be available for free in its online format.
Plotapi, beautiful by default.
Let plotapi do the heavy lifting – enabling beautiful interactive visualisations with a single line of code (instead of hundreds).
Get Plotapi