Skip to content

Instantly share code, notes, and snippets.

@broschke
Last active March 12, 2019 15:49
Show Gist options
  • Save broschke/a34b566103dfde9e9d1086f0f1a2ccc0 to your computer and use it in GitHub Desktop.
Save broschke/a34b566103dfde9e9d1086f0f1a2ccc0 to your computer and use it in GitHub Desktop.
import urllib.request
import json
import sqlite3
from key import ID, SECRET
CLIENT_ID = ID
CLIENT_SECRET = SECRET
v = '20170315'
url = 'https://api.foursquare.com/v2/venues/categories?client_id='+ CLIENT_ID +'&client_secret=' + SECRET + '&v=' + v
contents = urllib.request.urlopen(url).read()
#print(contents)
parsed = json.loads(contents)
i = parsed['response']['categories'][0]['id']
print(i)
for i in parsed:
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment