Import the a Python library to work with APIs
import requests
Send a get request to an endpoint
response = requests.get(“Endpoint_address_as_string”)
Examine the status code from a response object
response.status_code
Import a library to work with JSON
import jason
Use a function from json library to convert a Python object into a string
new_string = json.dumps( Python_Object )
Use a function from json library to convert a JSON string into a Python object
Python_Object = json.loads( JASON_String )
Retrieve a Python object from a response object
response.json()
Retrieve a JSON text from a response object
response.content
Retrieve metadata from a response object
response.headers #returns as a dictionary object