Using Data

API Query Dissection

A dissection of the API query string for the Census API

I have posted this in another topic, however it is hard to find.

Host name, API sub-folder (this triggers our api to parse the following data).

http://api.census.gov/data/

This portion refers to the DataSet/Instance pair (without both, it's difficult to determine what number you want back)

2010/sf1?

This determines what variables to retrieve (required, must exist within the variable documentation for the API)

get=P012D007,P012D008,P012D009,P012D010,P012D011,P012D012

Geography, all currently available data sets require this to return proper numbers

&for=block+group:1&in=state:2+county:170+tract:000101

The reason for this is two-fold, allowing us to limit users, as well as providing us with information as to how many people are using what dataset.

&key=(yourkeyhere)

Tags

Submitted by

Stage: Active

Feedback Score

2 votes
2 up votes
0 down votes
Idea#105

Idea Details

Vote Activity

  1. Upvoted
  2. Upvoted

Similar Ideas [ 4 ]

Events

  1. The idea was posted

Comments

  1. Comment
    Phillip Thomas ( Idea Submitter )

    Note to the Moderators: This idea should be pinned to make it easier to find.

  2. Comment
    eitanbarazani

    Sorry... I probably miss something here, but I don't see a link to a document :)

    Thanks,

    Eitan

  3. Comment
    Phillip Thomas ( Idea Submitter )

    You were asking about how to format api queries, this thread does that.

  4. Comment
    eitanbarazani

    Hi,

    I am looking for a document that will have the definitions of the "P......" commands, the denitions (values) of "block+group:1&in=state:2+county:170+tract:000101"

    Is there such a document?

    Thanks again,

    Eitan

Add your comment