Created
May 25, 2017 20:38
-
-
Save heycarsten/8e5ff89f4b827dfb125452001aa8b4b7 to your computer and use it in GitHub Desktop.
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
# Python 3.6.1 | |
from urllib.request import urlopen, Request | |
import json | |
url = 'http://lcboapi.com/products?q=gose' | |
req = Request(url) | |
req.add_header( | |
'Authorization', 'Token token="YOUR_API_KEY_HERE"' | |
) | |
res = urlopen(req).read().decode('utf8') | |
data = json.loads(res) | |
print(data['result']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment