# Courts — 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 the complete California Rules of Court including all 10 titles, Standards of Judicial Administration, and Ethics Standards for Neutral Arbitrators by searching specific rules, browsing tables of contents, or retrieving full chapter texts. Search across judicial procedure, civil rules, criminal rules, probate rules, family rules, and more to find the exact court guidance you need.

**Category:** Government & Public Data | **Website:** [courts.ca.gov/cms/rules/index/two](https://courts.ca.gov/cms/rules/index/two) | **Docs:** [parse.bot/marketplace/4c25c47d-abd4-4557-8aea-fdcadebd5907/courts-ca-gov-api](https://parse.bot/marketplace/4c25c47d-abd4-4557-8aea-fdcadebd5907/courts-ca-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/courts/`
**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 chapter rules

Get the full text of multiple rules from a title, optionally filtered by division or chapter number. Fetches each rule's page individually. Use the limit parameter to control how many rules are retrieved (each is a separate HTTP round-trip). Without filters, returns rules from the start of the title.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `chapter` | string | No | Filter by chapter number or text (e.g., '1' matches 'Chapter 1'). Omitting returns rules from all chapters. |
| `division` | string | No | Filter by division number or text (e.g., '1' matches 'Division 1'). Omitting returns rules from all divisions. |
| `limit` | integer | No | Maximum number of rules to fetch. |
| `title_slug` | string | No | Title identifier slug. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/courts/get-chapter-rules \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"chapter":"<string>","division":"<string>","limit":"<integer>","title_slug":"<string>"}'
```

### Get rule text

Get the full text of a specific rule by its ID. Returns the rule title and complete text content parsed from the official page. For numbered titles, passing just the number (e.g. '2_3') is accepted and normalized to 'rule2_3'.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `rule_id` | string | Yes | Rule identifier from the table of contents (e.g., 'rule2_3', 'ethics1', 'standard2_1'). For numbered titles, passing just the number like '2_3' is also accepted and will be normalized to 'rule2_3'. |
| `title_slug` | string | No | Title identifier slug. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/courts/get-rule-text \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"rule_id":"<string>","title_slug":"<string>"}'
```

### Get table of contents

Get the table of contents for a specific title, listing all rules with their division and chapter hierarchy. Each rule entry includes its slug, display name, division, chapter, and relative path. Useful for discovering rule IDs before fetching full text.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `title_slug` | string | No | Title identifier slug. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/courts/get-table-of-contents \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"title_slug":"<string>"}'
```

### List titles

List all available titles in the California Rules of Court. Returns a static list of title identifiers, their full names, and table-of-contents paths. No pagination — the full catalog fits in one response.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/courts/list-titles \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

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