# 2s Census Demographics API

> 2s Census Demographics API is a paid API for AI agents from 2s.io, paid per call via x402, $0.00108/call, status unknown (last checked 2026-10-12).

Returns US Census Bureau ACS demographic data (population, income, housing, poverty) for a US state or county

## Facts

- Endpoint: GET https://2s.io/api/census/demographics?utm_source=zero.xyz
- Price: $0.00108/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-census-demographics-api-baaff424
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fgYjxT8AbSUGj-vea_l2D

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 2s-census-demographics-api-baaff424
```

Example prompt: Pull the latest ACS census demographics for Harris County, Texas — I need population, median household income, poverty rate, and median home value for the county.

## When to prefer this

Use this endpoint when you need authoritative, government-sourced demographic data for US states or counties, including income, housing, and poverty statistics from the American Community Survey. Prefer this over scraped or third-party demographic sources when ground-truth census accuracy is required, and when you need pay-per-call access without an API key or subscription.

## Known failure modes

- Missing required 'state' parameter returns validation error
- Invalid state code or FIPS returns no results or error
- Invalid county FIPS returns empty results
- Requesting a year outside available ACS data range returns an error
- Payment failure (insufficient USDC) blocks the request via x402 protocol

## How this service works

US Census ACS 5-year demographics for a state or county. Give a state (2-letter or 2-digit FIPS), optionally a 3-digit county FIPS, and get population, median age, median household income, per-capita income, poverty rate (computed), households, owner-occupancy rate (computed), median home value, and median gross rent. Free, public-domain (US Census Bureau). Complements census.zipcode (ZIP/ZCTA-level) with state- and county-level geography. Authoritative demographic data an LLM cannot recall — for market sizing, site selection, and socioeconomic research.

## Output

A JSON object with an array of demographic records including population, median age, number of households, poverty rate, median gross rent, median home value, owner occupancy rate, per capita income, and median household income for the queried geography, along with the data source and license info from the US Census Bureau ACS 5-Year survey.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "required": [
      "state"
     ],
     "properties": {
      "year": {
       "type": "integer",
       "description": "ACS data year (default latest)."
      },
      "state": {
       "type": "string",
       "description": "2-letter state code or 2-digit FIPS (required)."
      },
      "county": {
       "type": "string",
       "description": "3-digit county FIPS (omit for state-level)."
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-census-demographics-api-baaff424/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
