# Census — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Get detailed property and housing statistics from the US Census Bureau, including home values, rental prices, occupancy rates, and housing unit counts across different geographic regions. Search and retrieve specific housing data tables to analyze real estate trends and demographics for your area of interest.

**Category:** Government & Public Data | **Website:** [www.census.gov/](https://www.census.gov/) | **Docs:** [parse.bot/marketplace/92e4c344-a52f-4927-9ebb-8a9ff2463564/census-gov-api](https://parse.bot/marketplace/92e4c344-a52f-4927-9ebb-8a9ff2463564/census-gov-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-census-gov-api-92e4c344/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_property_data

Get property and housing statistics for a specified geography. Returns median home value, median rent, owner/renter occupancy, housing unit counts, median year built, median rooms, household income, and monthly housing costs from ACS data. Makes multiple requests to Census data tables and merges results by geography. For state-level queries with geo_code=*, returns all 52 states/territories.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `county_code` | string | No | 3-digit county FIPS code. Required for tract queries. |
| `dataset` | string | No | ACS dataset: acs/acs5 (5-year estimates, all geographies) or acs/acs1 (1-year estimates, larger areas only). |
| `geo_code` | string | No | FIPS code for the geography, or * for all entities at the specified geo_level. |
| `geo_level` | string | No | Geography level. Accepted values: state, county, place, zip, tract. |
| `state_code` | string | No | 2-digit state FIPS code. Required for place and tract queries; optional for county queries to filter within a state. |
| `year` | string | No | ACS data year (e.g. 2022, 2021, 2020). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-census-gov-api-92e4c344/get_property_data \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"county_code":"<string>","dataset":"<string>","geo_code":"<string>","geo_level":"<string>","state_code":"<string>","year":"<string>"}'
```

### get_table_variables

Get all variables (columns) for a specific Census data table. Use this to discover available data fields before querying with get_property_data.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `dataset` | string | No | ACS dataset: acs/acs5 or acs/acs1. |
| `table_id` | string | No | Census table ID (e.g. B25077 for Median Value, B25001 for Housing Units). Discoverable via search_property_tables. |
| `year` | string | No | ACS data year (e.g. 2022, 2021, 2020). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-census-gov-api-92e4c344/get_table_variables \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dataset":"<string>","table_id":"<string>","year":"<string>"}'
```

### search_property_tables

Search for available Census data tables by keyword. Returns matching table IDs and descriptions from the ACS groups catalog. Useful for discovering additional property/housing data tables beyond the default set.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `dataset` | string | No | ACS dataset: acs/acs5 or acs/acs1. |
| `query` | string | No | Search keyword to filter tables by description or table ID (case-insensitive substring match). |
| `year` | string | No | ACS data year (e.g. 2022, 2021, 2020). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-census-gov-api-92e4c344/search_property_tables \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dataset":"<string>","query":"<string>","year":"<string>"}'
```
