# USDA Economic Research Service — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.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.

> Access comprehensive economic and demographic data for any US county, including unemployment rates, employment figures, income levels, poverty statistics, and population characteristics from the USDA Economic Research Service. Search and filter across all 3,143 US counties to analyze rural economic trends and county classifications for research, planning, or policy development.

**Category:** Government & Public Data | **Website:** [data.ers.usda.gov/](https://data.ers.usda.gov/) | **Docs:** [parse.bot/marketplace/37560911-2942-4001-8ab1-e4eb97382b8f/data-ers-usda-gov-api](https://parse.bot/marketplace/37560911-2942-4001-8ab1-e4eb97382b8f/data-ers-usda-gov-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/usda-economic-research-service/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get county classifications

Get county type classifications including rural-urban continuum codes, urban influence codes, metro/nonmetro status, economic dependency types (farming, manufacturing, mining, government, recreation), and special designations (low education, low employment, population loss, retirement destination, high amenity). Without filters returns all ~3,143 US counties.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `county_fips` | string | No | 5-digit county FIPS code for a specific county. Leading zeros preserved. |
| `limit` | integer | No | Maximum number of counties to return. If omitted, returns all matching counties. |
| `state_fips` | string | No | 2-digit state FIPS code to filter by state. Leading zeros preserved. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/usda-economic-research-service/get-county-classifications \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"county_fips":"<string>","limit":"<integer>","state_fips":"<string>"}'
```

### Get county demographics

Get population and demographics data for counties including population size/change, migration, age distribution, race/ethnicity, education levels, household characteristics, and foreign-born population. Without filters returns all ~3,143 US counties.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `county_fips` | string | No | 5-digit county FIPS code for a specific county. Leading zeros preserved. |
| `limit` | integer | No | Maximum number of counties to return. If omitted, returns all matching counties. |
| `state_fips` | string | No | 2-digit state FIPS code to filter by state. Leading zeros preserved. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/usda-economic-research-service/get-county-demographics \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"county_fips":"<string>","limit":"<integer>","state_fips":"<string>"}'
```

### Get county economic data

Get comprehensive economic data for counties including unemployment rates (2007-2021), employment change, employment by industry sector, median household income, per capita income, and poverty rates. Combines Jobs and Income data services. Without filters returns all ~3,143 US counties. Pagination is internal; the response is a single page.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `county_fips` | string | No | 5-digit county FIPS code for a specific county (e.g., '06037' for Los Angeles County). Leading zeros preserved. |
| `limit` | integer | No | Maximum number of counties to return. If omitted, returns all matching counties. |
| `state_fips` | string | No | 2-digit state FIPS code to filter by state (e.g., '01' for Alabama, '06' for California). Leading zeros preserved. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/usda-economic-research-service/get-county-economic-data \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"county_fips":"<string>","limit":"<integer>","state_fips":"<string>"}'
```

### List available layers

List all available data layers across the 5 atlas services (People, Jobs, Income, County_Classifications, Veterans). Each layer has an id, name, service, and default_visibility flag. Use the returned layer IDs with the query_layer endpoint.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `service` | string | No | Filter to a specific service: people, jobs, income, county_classifications, veterans. If omitted, returns layers for all services. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/usda-economic-research-service/list-available-layers \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"service":"<string>"}'
```

### Query layer

Query any specific data layer from any service for raw county-level data. Use list_available_layers to discover available services and layer IDs. Returns raw field values from the ArcGIS service. Fields vary by layer.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `county_fips` | string | No | 5-digit county FIPS code for a specific county. Leading zeros preserved. |
| `layer_id` | string | No | Layer ID within the service. Use list_available_layers to discover valid IDs (0-39 depending on service). |
| `limit` | integer | No | Maximum number of counties to return. If omitted, returns all matching counties. |
| `service` | string | Yes | Service name: people, jobs, income, county_classifications, or veterans. |
| `state_fips` | string | No | 2-digit state FIPS code to filter by state. Leading zeros preserved. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/usda-economic-research-service/query-layer \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"county_fips":"<string>","layer_id":"<string>","limit":"<integer>","service":"<string>","state_fips":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.