# Law Cornell — 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 thousands of legal definitions and explanations from Cornell Law's Wex encyclopedia to understand legal terms, concepts, and their relationships across different practice areas. Browse entries alphabetically or by legal category to quickly find the legal information you need.

**Category:** Government & Public Data | **Website:** [www.law.cornell.edu/wex](https://www.law.cornell.edu/wex) | **Docs:** [parse.bot/marketplace/791e5030-f2e7-41c2-9749-844692ddca4f/law-cornell-edu-api](https://parse.bot/marketplace/791e5030-f2e7-41c2-9749-844692ddca4f/law-cornell-edu-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-law-cornell-edu-api-791e5030/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_category_entries

Get entries belonging to a specific legal area/category with pagination support. Returns paginated results with term names, slugs, and text snippets. Categories correspond to the /wex/category/ paths on the Cornell Law site. Page numbering is 0-indexed.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category` | string | Yes | Category slug (e.g., 'contracts', 'constitutional_law', 'criminal_law_and_procedure', 'property'). |
| `limit` | integer | No | Maximum entries per page. 0 returns all entries on the page. |
| `page` | integer | No | Page number (0-indexed). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-law-cornell-edu-api-791e5030/get_category_entries \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category":"<string>","limit":"<integer>","page":"<integer>"}'
```

### get_entry

Get the full definition, legal areas/categories, and related terms for a specific Wex entry by its slug. The slug corresponds to the URL path segment after /wex/ on the Cornell Law site. Returns the complete text definition, a list of legal areas the entry belongs to, and cross-referenced terms (see_also).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `slug` | string | Yes | The entry slug (e.g., 'contract', 'habeas_corpus', 'first_amendment'). Spaces are converted to underscores automatically. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-law-cornell-edu-api-791e5030/get_entry \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"slug":"<string>"}'
```

### list_entries

List Wex legal encyclopedia entries for a specific letter or all letters. Returns term names, slugs, and URLs. Each letter page contains all entries starting with that letter. Use 'all' to fetch every letter sequentially. No server-side pagination; use limit to cap the result count client-side.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `letter` | string | No | Letter to browse (a-z, or numbers 1, 3, 4, 7, 9). Use 'all' to get entries for all letters. |
| `limit` | integer | No | Maximum number of entries to return. 0 returns all entries. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-law-cornell-edu-api-791e5030/list_entries \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"letter":"<string>","limit":"<integer>"}'
```

### search_entries

Search Wex entries by keyword in the term name. Performs a case-insensitive substring match against entry names in the alphabetical index. By default searches the letter matching the first character of the query; specify a letter to search within a different letter page. Returns matching terms with their slugs and URLs.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `letter` | string | No | Specific letter to search within (a-z, or numbers 1, 3, 4, 7, 9). If omitted, searches the letter matching the first character of the query. |
| `limit` | integer | No | Maximum results to return. |
| `query` | string | Yes | Search keyword to match against term names (case-insensitive substring match). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-law-cornell-edu-api-791e5030/search_entries \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"letter":"<string>","limit":"<integer>","query":"<string>"}'
```
