Cornell APIlaw.cornell.edu ↗
Access thousands of legal definitions, categories, and related terms from Cornell Law's Wex encyclopedia via 4 structured endpoints.
What is the Cornell API?
The Cornell Law Wex API provides structured access to thousands of legal encyclopedia entries across 4 endpoints, covering definitions, legal area categories, alphabetical browsing, and keyword search. The get_entry endpoint returns the full text definition, a list of legal areas, and cross-referenced related terms for any Wex entry by slug. Developers can browse entries with list_entries, search by keyword with search_entries, or page through category-scoped results with get_category_entries.
curl -X GET 'https://api.parse.bot/scraper/6bd7af01-4baf-49a4-ac73-de7eb8734ea7/list_entries?limit=5&letter=a' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace law-cornell-edu-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.cornell_law_wex_legal_encyclopedia_api import Wex, Entry, EntrySummary, CategoryEntry, Letter
wex = Wex()
# List entries for a specific letter using the Letter enum
for summary in wex.entrysummaries.list(letter=Letter.C, limit=5):
print(summary.term, summary.slug, summary.url)
# Search for entries matching a keyword
for result in wex.entrysummaries.search(query="tort", letter=Letter.T, limit=3):
print(result.term, result.slug)
# Navigate from summary to full entry detail
for summary in wex.entrysummaries.list(letter=Letter.A, limit=2):
entry = summary.details()
print(entry.term, entry.definition[:80], entry.legal_areas)
# Get a specific entry by slug
entry = wex.entries.get(slug="contract")
print(entry.term, entry.url, entry.see_also[:3])
# Browse a category with auto-pagination
contracts = wex.category(slug="contracts")
for cat_entry in contracts.list_entries(limit=5):
print(cat_entry.term, cat_entry.snippet[:60], cat_entry.url)
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.
| Param | Type | Description |
|---|---|---|
| limit | integer | Maximum number of entries to return. 0 returns all entries. |
| letter | string | Letter to browse (a-z, or numbers 1, 3, 4, 7, 9). Use 'all' to get entries for all letters. |
{
"type": "object",
"fields": {
"total": "integer, number of entries returned",
"letter": "string, the letter queried (uppercased, or 'ALL')",
"entries": "array of objects with keys: term, url, slug, letter"
},
"sample": {
"data": {
"total": 5,
"letter": "A",
"entries": [
{
"url": "https://www.law.cornell.edu/wex/a_fortiori",
"slug": "a_fortiori",
"term": "a fortiori",
"letter": "A"
}
]
},
"status": "success"
}
}About the Cornell API
What the API covers
Cornell Law's Wex is a free legal encyclopedia maintained by LII (Legal Information Institute). This API exposes its content as structured JSON: term names, slugs, full definitions, legal area classifications, and cross-references. Entries cover foundational legal concepts — from habeas_corpus and first_amendment to consideration and negligence — organized both alphabetically and by practice area.
Browsing and searching entries
The list_entries endpoint accepts a letter parameter (a–z, or numeric entries like 1, 3, 4, 7, 9) and returns an array of objects each containing term, url, slug, and letter. Passing letter=all retrieves the full alphabetical index sequentially. The search_entries endpoint performs a case-insensitive substring match against term names; by default it narrows to the letter matching the first character of the query, but you can override this with the letter parameter. Both endpoints accept a limit parameter to cap result counts.
Fetching full definitions and categories
The get_entry endpoint takes a slug (e.g., contract, habeas_corpus) and returns the complete definition text, a legal_areas array classifying the entry by practice area, and a see_also array of related term names. The get_category_entries endpoint accepts a category slug (e.g., contracts, criminal_law_and_procedure, constitutional_law) and returns paginated results with term, slug, url, and a short snippet per entry. Pagination is 0-indexed and the response includes total_pages and count fields.
Data shape and behavior notes
Slugs use underscores in place of spaces — the API normalizes spaces to underscores automatically. The legal_areas field on get_entry responses directly mirrors the category taxonomy used by get_category_entries, so you can chain the two endpoints: retrieve an entry's categories, then fetch other entries in those same categories. The list_entries endpoint does not paginate server-side; use the limit parameter client-side to cap results.
The Cornell API is a managed, monitored endpoint for law.cornell.edu — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when law.cornell.edu changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official law.cornell.edu API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a legal glossary widget that resolves term slugs to full definitions using
get_entry - Populate a practice-area content hub by pulling all entries under
constitutional_laworcriminal_law_and_procedureviaget_category_entries - Auto-link legal terms in contract documents by matching keywords against the Wex index with
search_entries - Generate a structured legal term graph by following
see_alsocross-references returned byget_entry - Build an offline legal reference dataset by iterating all letters with
list_entriesand fetching each slug withget_entry - Tag or classify legal documents by matching terms against the
legal_areastaxonomy returned per entry
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Cornell Law offer an official developer API for Wex?+
What does `get_category_entries` return, and how do I paginate through it?+
entries, each with term, slug, url, and snippet (a short excerpt). The response also includes count, total_pages, page, category, and category_slug. Pagination is 0-indexed — set page=0 for the first page, page=1 for the second, and so on. Setting limit=0 returns all entries on a given page without a cap.Does `search_entries` search the full definition text, or only term names?+
get_entry endpoint returns the full definition field, but there is no full-text search endpoint currently. You can fork this API on Parse and revise it to add a definition-body search endpoint.Does the API expose citation data, case references, or external links within definitions?+
definition field returns plain text content of the entry, and see_also returns related Wex term names. Case citations, statute references, or hyperlinks embedded in definitions are not separately structured. You can fork this API on Parse and revise it to add structured citation extraction from the definition text.Are all letters of the alphabet available in `list_entries`?+
letter parameter supports a–z and a handful of numeric buckets (1, 3, 4, 7, 9) for entries that begin with numbers. Not every letter has the same entry count. Passing letter=all fetches entries across every available letter sequentially.