Created
January 4, 2019 21:23
-
-
Save horeaporutiu/0009ddbd9c990ecbb4cd918decbdec79 to your computer and use it in GitHub Desktop.
make your first api call in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is the module that helps us make API calls (requests) | |
import requests | |
# this module helps us print all aspects of the data returned from API call | |
from pprint import pprint | |
# to make a different API call, just change the url below to a API endpoint. Two examples, one pokemon, one for longitude and latitude | |
# response = requests.get("http://api.open-notify.org/iss-now.json") | |
response = requests.get("https://pokeapi.co/api/v2/pokemon/ditto") | |
pprint(vars(response)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
python ./introToAPI.py