You cannot access variables through the Census Bureau API without specifying what "row" and "column" you want. From table B17021
you have many options; one such option you could select would be the Estimate
(column) of Income in the past 12 months below poverty level
(row). In general, the format of properly formatted variable names is TableName_VariableNumberType
. So for the example I just gave:
- Table =
B17021
- Row =
002
- Type =
estimate
(E
)
The variable this corresponds to is "B17021_002E"
.
However, it's best to simply consult the relevant API documentation to make sure you have the correct variable name. Table B17021
begins about halfway down the page, and you can cross-reference this guide against what you see the in the American FactFinder to make sure you have the right variable name.
As an aside, I wrote myself a guide about this a couple of years ago for Python. It is slightly out of date, but I have posted it to my GitHub in case it might help.
Edit: It appears that get_acs
does not require you put in the variable type. If you do not, the data that are returned have all attributes, which allows you to separately plot estimate, margin of error, from the same object. That's a nice feature!