> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# US Census Bureau

> US Census Bureau statistics (American Community Survey, decennial census and more) by geography, plus the Census Geocoder that turns addresses into coordinates and census geographies.

![](https://mintcdn.com/webrouter/8QP9EZc8V07Kl-0I/logo/data-apis/uscensus.webp?fit=max\&auto=format\&n=8QP9EZc8V07Kl-0I\&q=85\&s=29df22b2e9fa2064a83e204dc6820d5d)

[Web Catalog · Government](https://docs.webrouter.net/data-apis.md?category=government)

Key optional

Endpoints

8

Auth

Key in query

[Vendor docs](https://www.census.gov/data/developers/guidance/api-user-guide.html)

## Setup

| Variable | | What it is |
| - | - | - |
| `CENSUS_API_KEY` | some calls | A free Census Data API key (api.census.gov/data/key\_signup.html). Sent as the key query parameter on data queries; the geocoder needs none. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Data answers are a two-dimensional JSON array: the first row is the column names, each later row one geography. Missing values are null. Numbers come back as strings.
* get takes up to 50 variables, comma-separated; NAME gives the geography's name and group(TABLE) every variable of a table. ACS estimates end in E and their margins of error in M (B01001\_001E, B01001\_001M).
* Geography is for=\<level>:\<code or *>, narrowed with in=\<parent>:\<code> (e.g. for=county:*\&in=state:06). Codes are FIPS.
* The Census Bureau's guide says a key must be used with data queries; light keyless use is tolerated but limited per IP.
* Find datasets with GET /data.json and a dataset's variables with its variables.json before querying.

## Endpoints

GET

List datasets

Every dataset the Data API serves, with its vintage, title and links to its variables and geographies.

[Open](#uscensus-datasets-list)

GET

Query American Community Survey detailed tables

ACS 1-year, 5-year or supplemental estimates for chosen variables and geographies.

[Open](#uscensus-acs-query)

GET

Query ACS profile or subject tables

ACS data profiles (DP), subject tables (S) or comparison profiles (CP) for chosen geographies.

[Open](#uscensus-acs-tables-query)

GET

List an ACS dataset's variables

Every variable of an ACS dataset with its label, concept and group.

[Open](#uscensus-acs-variables)

GET

Query decennial census data

Decennial census counts (e.g. redistricting pl, dhc) for chosen variables and geographies.

[Open](#uscensus-decennial-query)

GET

Geocode a one-line address

Coordinates and matched address for a US address; with returntype geographies, also its state, county, tract and block.

[Open](#uscensus-geocode-oneline)

GET

Geocode an address by parts

Like the one-line geocoder, from street, city, state and ZIP fields.

[Open](#uscensus-geocode-address)

GET

Find census geographies for a point

State, county, tract, block and other census geographies containing a longitude/latitude.

[Open](#uscensus-geocode-coordinates)

### List datasets

GET

`/data.json`

`uscensus.datasets.list`

Every dataset the Data API serves, with its vintage, title and links to its variables and geographies.

Input

No inputs.

[Vendor docs](https://www.census.gov/data/developers/guidance/api-user-guide.html) · Same job: [ArcGIS Online](https://docs.webrouter.net/data-apis/arcgis.md#arcgis-groups-search), [Attio](https://docs.webrouter.net/data-apis/attio.md#attio-objects-list), [Bank of Canada](https://docs.webrouter.net/data-apis/bankofcanada.md#bankofcanada-lists), [US Bureau of Economic Analysis](https://docs.webrouter.net/data-apis/bea.md#bea-datasets-list), [Bright Data](https://docs.webrouter.net/data-apis/brightdata.md#brightdata-datasets-list), [Clay](https://docs.webrouter.net/data-apis/clay.md#clay-tables-query)

```python Python theme={null}
router.call_data_api("uscensus.datasets.list")
```

```text MCP theme={null}
call_data_api(endpoint="uscensus.datasets.list")
```

> [!NOTE]
>
> * A large catalog file (api.census.gov/data.json); filter it locally.

### Query American Community Survey detailed tables

GET

`/{year}/acs/{survey}`

`uscensus.acs.query`

ACS 1-year, 5-year or supplemental estimates for chosen variables and geographies.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`year` required</td><td>string</td><td>path</td><td>Vintage (data year). Example `2023`</td></tr>
    <tr><td>`survey` required</td><td>string</td><td>path</td><td>acs1 (1-year, areas of 65,000+ people), acs5 (5-year, every area), acsse (supplemental). One of `acs1`, `acs5`, `acsse`</td></tr>
    <tr><td>`get` required</td><td>string</td><td>query</td><td>Variables, comma-separated (max 50), or group(TABLE). Example `NAME,B01001_001E`</td></tr>
    <tr><td>`for_` required</td><td>string</td><td>query</td><td>Geography level and code, \* for all. Example `state:*`</td></tr>

    <tr>
      <td>
        `in_`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Parent geography, e.g. state:06.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://www.census.gov/data/developers/guidance/api-user-guide.Example_API_Queries.html) · Same job: [CMS Open Payments](https://docs.webrouter.net/data-apis/cms-open-payments.md#cms-open-payments-datastore-query), [CMS Data (data.cms.gov)](https://docs.webrouter.net/data-apis/data-cms.md#data-cms-dataset-rows), [data.gov.au](https://docs.webrouter.net/data-apis/data-gov-au.md#data-gov-au-rows-search), [Latvian Open Data Portal (data.gov.lv)](https://docs.webrouter.net/data-apis/data-gov-lv.md#data-gov-lv-rows-search), [data.gov.ua](https://docs.webrouter.net/data-apis/data-gov-ua.md#data-gov-ua-rows-search), [Dune](https://docs.webrouter.net/data-apis/dune.md#dune-query-latest-result)

### Query ACS profile or subject tables

GET

`/{year}/acs/{survey}/{table_type}`

`uscensus.acs.tables_query`

ACS data profiles (DP), subject tables (S) or comparison profiles (CP) for chosen geographies.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`year` required</td><td>string</td><td>path</td><td>Vintage. Example `2023`</td></tr>
    <tr><td>`survey` required</td><td>string</td><td>path</td><td>acs1 or acs5. One of `acs1`, `acs5`</td></tr>
    <tr><td>`table_type` required</td><td>string</td><td>path</td><td>profile (DP tables), subject (S tables) or cprofile (CP tables). One of `profile`, `subject`, `cprofile`</td></tr>
    <tr><td>`get` required</td><td>string</td><td>query</td><td>Variables (max 50) or group(TABLE). Example `NAME,DP03_0062E`</td></tr>
    <tr><td>`for_` required</td><td>string</td><td>query</td><td>Geography level and code. Example `county:*`</td></tr>
    <tr><td>`in_`</td><td>string</td><td>query</td><td>Parent geography. Example `state:06`</td></tr>
  </tbody>
</table>

[Vendor docs](https://www.census.gov/data/developers/guidance/api-user-guide.Example_API_Queries.html) · Same job: [CMS Open Payments](https://docs.webrouter.net/data-apis/cms-open-payments.md#cms-open-payments-datastore-query), [CMS Data (data.cms.gov)](https://docs.webrouter.net/data-apis/data-cms.md#data-cms-dataset-rows), [data.gov.au](https://docs.webrouter.net/data-apis/data-gov-au.md#data-gov-au-rows-search), [Latvian Open Data Portal (data.gov.lv)](https://docs.webrouter.net/data-apis/data-gov-lv.md#data-gov-lv-rows-search), [data.gov.ua](https://docs.webrouter.net/data-apis/data-gov-ua.md#data-gov-ua-rows-search), [Dune](https://docs.webrouter.net/data-apis/dune.md#dune-query-latest-result)

### List an ACS dataset's variables

GET

`/{year}/acs/{survey}/variables.json`

`uscensus.acs.variables`

Every variable of an ACS dataset with its label, concept and group.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`year` required</td><td>string</td><td>path</td><td>Vintage. Example `2023`</td></tr>
    <tr><td>`survey` required</td><td>string</td><td>path</td><td>ACS dataset. One of `acs1`, `acs5`, `acsse`</td></tr>
  </tbody>
</table>

[Vendor docs](https://www.census.gov/data/developers/guidance/api-user-guide.html) · Same job: [Affinity](https://docs.webrouter.net/data-apis/affinity.md#affinity-companies-fields), [ArcGIS Online](https://docs.webrouter.net/data-apis/arcgis.md#arcgis-items-get), [Attio](https://docs.webrouter.net/data-apis/attio.md#attio-attributes-list), [Bank of Canada](https://docs.webrouter.net/data-apis/bankofcanada.md#bankofcanada-series-get), [US Bureau of Economic Analysis](https://docs.webrouter.net/data-apis/bea.md#bea-parameters-list), [Bright Data](https://docs.webrouter.net/data-apis/brightdata.md#brightdata-datasets-metadata)

> [!NOTE]
>
> * Tens of thousands of variables; a group's own variables are at /\{year}/acs/\{survey}/groups/\{TABLE}.json.

### Query decennial census data

GET

`/{year}/dec/{dataset}`

`uscensus.decennial.query`

Decennial census counts (e.g. redistricting pl, dhc) for chosen variables and geographies.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`year` required</td><td>string</td><td>path</td><td>Census year. Example `2020`</td></tr>
    <tr><td>`dataset` required</td><td>string</td><td>path</td><td>Decennial dataset id as listed in /data.json (e.g. pl, dhc). Example `pl`</td></tr>
    <tr><td>`get` required</td><td>string</td><td>query</td><td>Variables (max 50) or group(TABLE). Example `NAME,P1_001N`</td></tr>
    <tr><td>`for_` required</td><td>string</td><td>query</td><td>Geography level and code. Example `state:*`</td></tr>

    <tr>
      <td>
        `in_`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Parent geography.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://www.census.gov/data/developers/guidance/api-user-guide.Example_API_Queries.html) · Same job: [CMS Open Payments](https://docs.webrouter.net/data-apis/cms-open-payments.md#cms-open-payments-datastore-query), [CMS Data (data.cms.gov)](https://docs.webrouter.net/data-apis/data-cms.md#data-cms-dataset-rows), [data.gov.au](https://docs.webrouter.net/data-apis/data-gov-au.md#data-gov-au-rows-search), [Latvian Open Data Portal (data.gov.lv)](https://docs.webrouter.net/data-apis/data-gov-lv.md#data-gov-lv-rows-search), [data.gov.ua](https://docs.webrouter.net/data-apis/data-gov-ua.md#data-gov-ua-rows-search), [Dune](https://docs.webrouter.net/data-apis/dune.md#dune-query-latest-result)

```python Python theme={null}
router.call_data_api("uscensus.decennial.query", {'year': '2020', 'dataset': 'pl', 'get': 'NAME,P1_001N', 'for_': 'state:*'})
```

```text MCP theme={null}
call_data_api(endpoint="uscensus.decennial.query", params={"year": "2020", "dataset": "pl", "get": "NAME,P1_001N", "for_": "state:*"})
```

### Geocode a one-line address

GET

`/{returntype}/onelineaddress`

`uscensus.geocode.oneline`

Coordinates and matched address for a US address; with returntype geographies, also its state, county, tract and block.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`returntype` required</td><td>string</td><td>path</td><td>locations (coordinates only) or geographies (coordinates plus census geographies). One of `locations`, `geographies`</td></tr>
    <tr><td>`address` required</td><td>string</td><td>query</td><td>Full address on one line. Example `4600 Silver Hill Rd, Washington, DC 20233`</td></tr>
    <tr><td>`benchmark` required</td><td>string</td><td>query</td><td>Address benchmark name or id. Example `Public_AR_Current`</td></tr>
    <tr><td>`vintage`</td><td>string</td><td>query</td><td>Geography vintage; required with geographies. Example `Current_Current`</td></tr>

    <tr>
      <td>
        `layers`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Geography layers to return, comma-separated ids or names, or all.
      </td>
    </tr>

    <tr><td>`format`</td><td>string</td><td>query</td><td>json or jsonp. One of `json`, `jsonp` Example `json`</td></tr>
  </tbody>
</table>

[Vendor docs](https://geocoding.geo.census.gov/geocoder/Geocoding_Services_API.html)

> [!NOTE]
>
> * Keyless. Pass format=json, or the answer is HTML.

### Geocode an address by parts

GET

`/{returntype}/address`

`uscensus.geocode.address`

Like the one-line geocoder, from street, city, state and ZIP fields.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`returntype` required</td><td>string</td><td>path</td><td>locations or geographies. One of `locations`, `geographies`</td></tr>

    <tr>
      <td>
        `street`

        required
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Street address.
      </td>
    </tr>

    <tr>
      <td>
        `city`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        City (with state, when no zip).
      </td>
    </tr>

    <tr>
      <td>
        `state`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        State.
      </td>
    </tr>

    <tr>
      <td>
        `zip`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        ZIP code (street plus zip is enough).
      </td>
    </tr>

    <tr><td>`benchmark` required</td><td>string</td><td>query</td><td>Address benchmark name or id. Example `Public_AR_Current`</td></tr>
    <tr><td>`vintage`</td><td>string</td><td>query</td><td>Geography vintage; required with geographies. Example `Current_Current`</td></tr>

    <tr>
      <td>
        `layers`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Geography layers, or all.
      </td>
    </tr>

    <tr><td>`format`</td><td>string</td><td>query</td><td>json or jsonp. One of `json`, `jsonp` Example `json`</td></tr>
  </tbody>
</table>

[Vendor docs](https://geocoding.geo.census.gov/geocoder/Geocoding_Services_API.html)

### Find census geographies for a point

GET

`/geographies/coordinates`

`uscensus.geocode.coordinates`

State, county, tract, block and other census geographies containing a longitude/latitude.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`x` required</td><td>number</td><td>query</td><td>Longitude. Example `-76.92744`</td></tr>
    <tr><td>`y` required</td><td>number</td><td>query</td><td>Latitude. Example `38.845985`</td></tr>
    <tr><td>`benchmark` required</td><td>string</td><td>query</td><td>Benchmark name or id. Example `Public_AR_Current`</td></tr>
    <tr><td>`vintage` required</td><td>string</td><td>query</td><td>Geography vintage. Example `Current_Current`</td></tr>

    <tr>
      <td>
        `layers`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Geography layers, or all.
      </td>
    </tr>

    <tr><td>`format`</td><td>string</td><td>query</td><td>json or jsonp. One of `json`, `jsonp` Example `json`</td></tr>
  </tbody>
</table>

[Vendor docs](https://geocoding.geo.census.gov/geocoder/Geocoding_Services_API.html)

```python Python theme={null}
router.call_data_api("uscensus.geocode.coordinates", {'x': -76.92744, 'y': 38.845985, 'benchmark': 'Public_AR_Current', 'vintage': 'Current_Current', 'format': 'json'})
```

```text MCP theme={null}
call_data_api(endpoint="uscensus.geocode.coordinates", params={"x": -76.92744, "y": 38.845985, "benchmark": "Public_AR_Current", "vintage": "Current_Current", "format": "json"})
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.