Skip to content

Instantly share code, notes, and snippets.

@bartekpacia
Last active December 15, 2019 12:36
Show Gist options
  • Save bartekpacia/947688ca5a8e6aadd736f1c5c275c579 to your computer and use it in GitHub Desktop.
Save bartekpacia/947688ca5a8e6aadd736f1c5c275c579 to your computer and use it in GitHub Desktop.
GCI 2019: Call an API using Python
import requests
import json
response = requests.get("https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=Craig%20Noone&format=json")
data = json.loads(response.text)
print(type(data)) # To prove that JSON has been converted to Python Dict
print(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment