Changes

Jump to navigation Jump to search
Other datasets available using api.census.gov are listed here: https://www.census.gov/data/developers/data-sets.html.
 
==Working with the API==
 
The API doesn't seem to require a key, but you can request one from https://api.census.gov/.
 
The data contains "null" values, as well as values that indicate error codes (-999999999,-888888888,-666666666,-555555555,-222222222, and others. See https://www.census.gov/data/developers/data-sets/acs-1year/notes-on-acs-estimate-and-annotation-values.html. Generally, it appears that all negative and null values should be striped.
 
The API uses improper URL encoding (or more accurately, doesn't use URL encoding), so most methods for auto-populating URL parameters in scripting languages will not function correctly. Build URLs manually.
 
The API returns improper JSON. Essentially, it just encodes a flat data structure into JSON syntax one line at a time, and completely ignores the structure of the data (and so the point of encoding it in JSON). However, the first (zeroth) column is the requested geography name, so multiple pulls can be joined using that. And the first (zeroth) row is a valid set of column headers.
 
To request a group ask for '''group(B06009)''' where you would normally request a field like '''B06011_001E'''. Programmers can rely on groups and fields being identifiable from the "_" and the string length.
=Old Approach using AFF=

Navigation menu