Below are the terms you will need to be familiar with when running an API query, like this one for the dataset, Vintage 2014 Population Estimates: US, State, and PR Total Population and Components of Change (Use Firefox or Chrome):
|We recommend that you use Chrome or Firefox when building and running API queries.|
A variable is each unit of data you are searching for in a dataset. Each variable that you can search for in a dataset has a name, which may be an acronym or meaningful on its own; e.g., STNAME, POP, DATE_.
In larger datasets, such as the American Community Survey, many of these names are based on an alphanumeric code; e.g., B01003_001E (Total Population).
You can find the list of variables in the dataset by visiting the variables page. For example, the variables page for the Vintage 2014 Population Estimates: US, State, and PR Total Population and Components of Change.
Required variables are the parameters that you need to include in your search; otherwise, your search will produce no data and an error message. The variable table for each dataset lists which variables are required, as shown below in the variable table for one of the 2014 Population Estimates datasets found here:
The get function (get=) specifies the required and selected variables you are requesting the API to give you. For example (Use Firefox or Chrome.):
The predicate specifies how variables should be filtered or limited, and you can create predicates of geography, string variables, numeric variables, and time (in time series datasets). In this example, the predicate limits the search on the July 1, 2014 (&DATE_=7) population or housing unit estimate and for all states (&for=state:*):
The predicate &for restricts the variables by geography at various levels, while &in and + restricts to geographic areas smaller than state level. You can include wildcards (:*) along with &for and &in.
Examples with wildcards:
For more information on Census Bureau geography, click here:
You can create a predicate of string variables with various restrictions and can include
Examples with PORT (code) and PORT_NAME from the Monthly International Trade Time Series – U.S. Exports by Port and Harmonized System (HS) Code dataset:
Examples with wildcards:
|You can use wildcards (:*) in predicates with string variables and geographies only. You cannot use wildcards in time predicates or predicates with numeric variables.|
You can create a predicate of a range of values for a numeric (int) variable. Please note that you cannot build a predicate with wildcards for numeric variables.
Examples from County Business Patterns:
For some datasets available on the Census Data API, data are stored for multiple points of time in one dataset, rather than across several datasets for individual points of time. When this occurs, we refer to the dataset as a time series dataset. You can find the list of time series datasets on the Census Data API here: api.census.gov/data/timeseries.html You can limit by time in time series datasets by using the predicate &time. Please note that you cannot build a predicate with wildcards (:*) for time in a time series dataset. Note that + is needed for time ranges, such as the time range from 1997 to 2012 (below).
For more information about time series datasets, see Example: A Time Series Dataset – International Trade Monthly Exports in this users guide.
You can include up to 50 variables in a single API query and can make up to 500 queries per IP address per day. More than 500 queries per IP address per day requires that you register for a Census key. That key will be part of your data request URL string.
Please keep in mind that all queries from a business or organization having multiple employees might employ a proxy service or firewall. This will make all of the users of that business or organization appear to have the same IP address. If multiple employees were making queries, the 500-query limit would be for the proxy server/firewall, not the individual user.