Vote up to Idea gender by zip code Vote down to Idea gender by zip code


This idea is active.
Using Data »

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

# not sure how to request them

endpoint = '' # 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?



Submitted by 1 year ago

Comments (3)

  1. Moderator

    Not sure if you've seen this, but the guys at Sunlight labs made a python wrapper for calling the API:


    1 year ago
    1. Community Member Idea Submitter

      Sweet, thank you. I'll check this out.

      1 year ago
  2. I posted a dissected query in this topic as well, so you can manually test your queries to make sure you get back what you're expecting to get back.

    1 year ago

Vote Activity Show


  1. The idea was posted
    1 year ago