Skip to content

Instantly share code, notes, and snippets.

@olssonm
Created May 5, 2015 15:23
Show Gist options
  • Save olssonm/53ada210d525f2bc543b to your computer and use it in GitHub Desktop.
Save olssonm/53ada210d525f2bc543b to your computer and use it in GitHub Desktop.
Parse JSON from NamnAPI v2 with Python
from urllib import urlopen
import json
data = urlopen('http://api.namnapi.se/v2/names.json?limit=10').read()
data = json.loads(data)
for name in data['names']:
print name['firstname']
print name['surname']
print name['gender']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment