# Census dataset query

Query any Census Data API dataset by path. Needs dataset and get. Served by US Census Bureau.

Query any Census Data API dataset by path (decennial census '2020/dec/pl', population estimates '2023/pep/charv', Annual Business Survey '2022/abscs', Economic Census '2022/ecnbasic') with variables, geography and time. The dedicated Census tools cover ACS, business patterns, indicators and trade; rows come as arrays, first row = headers.

- Tool ID: `census/data-query`
- Provider: [US Census Bureau](/providers/census.md)
- Capability: [Knowledge & research](/tools/knowledge.md)
- Price: no charge per call
- Authentication: an authorised Agentik workspace is required for execution, including zero-price tools.

## Pricing contract

No charge per call. A workspace is still needed so your agent can call it.


```json
{
  "model": "per_call",
  "amountUsd": 0
}
```

## Complete input schema


```json
{
  "type": "object",
  "properties": {
    "dataset": {
      "type": "string",
      "minLength": 3,
      "maxLength": 80,
      "pattern": "^([0-9]{4}|timeseries)(/[a-z0-9]+){1,4}$",
      "description": "Dataset path after /data/, e.g. '2020/dec/pl' or 'timeseries/poverty/saipe'"
    },
    "get": {
      "type": "string",
      "minLength": 1,
      "maxLength": 800,
      "pattern": "^[A-Za-z0-9_(),.]+$",
      "description": "Comma-separated variables (max 50), e.g. 'NAME,B19013_001E', or a whole table 'group(B19013)'"
    },
    "for": {
      "type": "string",
      "minLength": 3,
      "maxLength": 200,
      "pattern": "^[A-Za-z0-9 ()/,'.&-]+:[A-Za-z0-9*,]+$",
      "description": "Geography to return, e.g. 'state:06', 'county:*', 'zip code tabulation area:94103' or 'us:1'"
    },
    "in": {
      "type": "string",
      "minLength": 3,
      "maxLength": 200,
      "pattern": "^[A-Za-z0-9 ()/,'.&:*+-]+$",
      "description": "Parent geography filter, e.g. 'state:06' or 'state:06 county:037'"
    },
    "time": {
      "type": "string",
      "minLength": 4,
      "maxLength": 30,
      "pattern": "^(from )?[0-9]{4}(-[0-9]{2}|-Q[1-4])?( to [0-9]{4}(-[0-9]{2}|-Q[1-4])?)?$",
      "description": "Time filter for timeseries datasets, e.g. '2022' or 'from 2019 to 2022'"
    }
  },
  "required": [
    "dataset",
    "get"
  ],
  "additionalProperties": false
}
```

## Published example

This is the provider tool’s published example. Replace example values with the user’s requested inputs, respecting the schema; do not execute an example merely to test a connection.


```json
{
  "tool_id": "census/data-query",
  "input": {
    "dataset": "2020/dec/pl",
    "get": "NAME,P1_001N",
    "for": "state:06"
  }
}
```

## Execute and retrieve

Inspect again before execution, explain the price and obtain the required authority. Use MCP run_tool or POST /v1/run with this tool ID, valid input and an idempotency key. Save the returned run ID and follow the actual state. If Agentik answers that the tool is temporarily unavailable, do not retry it blindly; use discovery to propose an alternative.

A partial or uncertain result can still have consumed provider resources. Consult [billing](/docs/billing.md), [idempotency](/docs/idempotency.md) and [asynchronous results](/docs/async.md).

Licence: Public domain (U.S. Government work); Census Data API Terms of Service.

Attribution: This product uses the Census Bureau Data API but is not endorsed or certified by the Census Bureau..

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

[REST inspection](https://api.agentik.cc/v1/tools/census/data-query) · [OpenAPI](/openapi.json) · [Connection guide](/connect.md)

---

[HTML page](/providers/census/data-query) · [Agent index](/llms.txt)
