# Capitol — 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.

> Search and navigate Texas statutes and constitutional law with full-text lookup capabilities across codes, chapters, and individual sections. Quickly retrieve complete statute text for any Texas law you need to reference or study.

**Category:** Government & Public Data | **Website:** [statutes.capitol.texas.gov/](https://statutes.capitol.texas.gov/) | **Docs:** [parse.bot/marketplace/0f7e74a8-d16f-4988-bef2-3fd89a343496/statutes-capitol-texas-gov-api](https://parse.bot/marketplace/0f7e74a8-d16f-4988-bef2-3fd89a343496/statutes-capitol-texas-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-statutes-capitol-texas-gov-api-0f7e74a8/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_section_text

Retrieves the full text of a specific statute section or an entire chapter. When section is provided, returns only that section's text. When section is omitted, returns the full chapter text. The chapter parameter uses the url_key from list_chapters (e.g. 'PE.1', 'CN.1').

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `chapter` | string | Yes | Chapter identifier in format 'CODE.NUMBER' (e.g. 'PE.1', 'CN.1', 'FA.5'). Use url_key from list_chapters results. |
| `code` | string | Yes | Two-letter statute code (e.g. 'CN', 'PE', 'FA'). |
| `section` | string | No | Section number within the chapter (e.g. '1.01', '1.8', '1.3a'). Use section_number from list_sections results. Omit to retrieve the full chapter text. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-statutes-capitol-texas-gov-api-0f7e74a8/get_section_text \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"chapter":"<string>","code":"<string>","section":"<string>"}'
```

### list_chapters

Lists all chapters (or articles for the Constitution) within a given statute code. Each chapter entry includes a value identifier needed by the list_sections endpoint and a url_key used by get_section_text.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `code` | string | Yes | Two-letter statute code (e.g. 'CN' for Texas Constitution, 'PE' for Penal Code). Valid codes available from list_codes endpoint. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-statutes-capitol-texas-gov-api-0f7e74a8/list_chapters \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"<string>"}'
```

### list_codes

Lists all available Texas statute codes (e.g. Penal Code, Family Code, The Texas Constitution). Each code has a short abbreviation used as the identifier in other endpoints. Returns the complete set of codes available in the system.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-statutes-capitol-texas-gov-api-0f7e74a8/list_codes \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### list_sections

Lists all sections within a specific chapter or article. Requires the chapter_value identifier from the list_chapters endpoint. Each section entry includes a section_number used by get_section_text.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `chapter_value` | string | Yes | Chapter identifier from list_chapters results (format: 'hid.ahid', e.g. '61952.53300'). |
| `code` | string | Yes | Two-letter statute code (e.g. 'CN', 'PE', 'FA'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-statutes-capitol-texas-gov-api-0f7e74a8/list_sections \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"chapter_value":"<string>","code":"<string>"}'
```

### search_statutes

Full-text search across Texas statutes and the Constitution. Returns matching chapters/articles ranked by relevance. Can be filtered to a specific code or search all codes. Results are paginated with up to 10 results per page.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `code` | string | No | Two-letter statute code to filter results (e.g. 'CN', 'PE', 'FA'). Use 'ZZ' or omit to search all codes. Valid codes available from list_codes endpoint. |
| `page` | integer | No | Page number for paginated results (1-based). |
| `query` | string | Yes | Search text to find in statutes (e.g. 'freedom of speech', 'property tax'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-statutes-capitol-texas-gov-api-0f7e74a8/search_statutes \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"<string>","page":"<integer>","query":"<string>"}'
```
