cenpy.remote.APIConnection.query¶
-
APIConnection.
query
(self, cols=None, geo_unit='', geo_filter={}, apikey='', **kwargs)[source]¶ Conduct a query over the USCB api connection
- Parameters
- colslist of str
census column names to request
- geo_unitdict or str
identifiers for the basic spatial unit of the query
- geo_filterdict
required geometries above the specified geo_unit needed to complete the query
- apikeystr
USCB-issued API key for your query.
- **kwargsadditional search predicates can be passed here
- Returns
- pandas.DataFrame
results from the API
Notes
If your list of columns exceeds the maximum query length of 50, the query will be broken up and concatenated back together at the end. Sometimes, the USCB might frown on large-column queries, so be careful with this. Cenpy is not liable for your key getting banned if you query tens of thousands of columns at once.