gender by zip code
I'm attempting to write some Python code to retrieve this information. I only have a little experience with APIs, and I'm kind of lost. import requests query_params = { 'apikey': 'mykey', 'place': , #would like to select all 'state': # would like to select all #probably need one for ZCTAs? } # PO120001 - PO120049 all sex by age categories ...more »
I'm attempting to write some Python code to retrieve this information. I only have a little experience with APIs, and I'm kind of lost.
import requests
query_params = { 'apikey': 'mykey',
'place': , #would like to select all
'state': # would like to select all
#probably need one for ZCTAs?
}
# PO120001 - PO120049 all sex by age categories
# not sure how to request them
endpoint = 'http://api.census.gov/data/2010/sf1' # this is probably wrong
response = requests.get(endpoint, params=query_params)
data = response.json # i think
Has anyone done anything like this? Is Python the wrong way to be doing it?
Thanks
« less full details »
