# USDA Economic Research Service — 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.

> 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. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-data-ers-usda-gov-api-37560911/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## 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.paywithlocus.com/api/wrapped/parse-data-ers-usda-gov-api-37560911/get_county_classifications \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-data-ers-usda-gov-api-37560911/get_county_demographics \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-data-ers-usda-gov-api-37560911/get_county_economic_data \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-data-ers-usda-gov-api-37560911/list_available_layers \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-data-ers-usda-gov-api-37560911/query_layer \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"county_fips":"<string>","layer_id":"<string>","limit":"<integer>","service":"<string>","state_fips":"<string>"}'
```
