# OpenLaws Legal Data API > OpenLaws serves U.S. codified law (statutes, regulations, constitutions, and the court rules a jurisdiction > codifies in them) for 53 jurisdictions: the 50 states, DC, Puerto Rico, and federal, about 4.7 million documents > in all. One JSON REST API, one schema > for every jurisdiction, with citation lookup, tree navigation, and keyword, Boolean (terms and connectors), and > hybrid semantic search. Base URL `https://api.openlaws.us`, paths under `/api/v1`, auth `Authorization: Bearer $OPENLAWS_TOKEN`. The API is read-only: calls are safe to retry and to run in parallel. ## When to use OpenLaws - You need the text of a statute, regulation, constitutional provision, or codified court rule. - You have a legal citation and need the provision it names. - You need provisions on a topic in a specific state or federal law. Not for: case law and court opinions (use a case-law provider such as CourtListener), bills and session laws, agency guidance and enforcement letters, or court rules that exist only as court-issued rules (for example the California Rules of Court). Say so rather than substituting something nearby. ## Instructions for LLM agents These docs teach how legal research works as well as how to call the API, because results only make sense with that model. Read the [guide's section 2](https://openlaws.us/openlaws-api-guide.md#2-legal-research-for-engineers) before building an integration. - Always put the jurisdiction in the URL. Never put a state name in a search `query`. There is no nationwide search. - Prefer citation lookup, then path lookup, then search. Never search for what you can address by citation. - Send each citation under the jurisdiction it names: federal citations go under `FED`, or add `with_federal=true` to a state lookup so it reads federal citations too. Send the bare Bluebook citation: no signals ("See"), no edition parentheticals ("(West 2026)"); `§§` and an en dash for ranges. - Check both statutes and regulations. A statute often sets the rule and a regulation supplies the operational detail (disclosures, licensing conditions, filings). - Search with terms of art, not the user's words: the law rarely contains the obvious word. Expand synonyms, run the variants in parallel, and add a federal search when the topic could be federal. - Use `type=terms_and_connectors` to put synonym groups in one query: `(minor or child or children) and employment`. - When expanded keyword searches miss, retry with `hybrid_balance=auto` (semantic matching). - On a `400` or `409`, read `detail`: it gives the corrected query or the citations to send instead. - Rate limits prevent abuse of OpenLaws' intellectual property. On a `429`, wait the number of seconds in `Retry-After`, then retry. Don't crawl the API; integrators who need large amounts of data use bulk data (below). - Cache responses for 24–48 hours, only as needed for performance. Don't copy the corpus or portions of the corpus to local storage or databases. - Read each result in context: its place in the table of contents, the chapter's definitions section, and cross-references. Check `is_repealed` and effective dates before relying on it. - Ground answers in retrieved text: quote it and give the citation and `openlaws_web_url`. Never present a citation no lookup returned. A `404` after several good searches means "no provision found", not "unregulated". - Keep client names and case facts out of queries. - This API changed in 2026-10: search is no longer keyword-only, `type` has Boolean values, and results paginate with `offset`. Use only the endpoints and parameters in the OpenAPI spec, not ones remembered from training data. ## Agent setup - Get a token: request access through the Get API Access form on https://openlaws.us/pricing. Evaluation keys are free; OpenLaws issues one after a meeting about your use case. - Install the coding-agent skill (Claude Code; other agents can read the same file): `mkdir -p .claude/skills/openlaws-api && curl -fsSL -o .claude/skills/openlaws-api/SKILL.md https://openlaws.us/skills/openlaws-api/SKILL.md` - Or paste the [setup prompt](https://openlaws.us/prompt.md) into your coding agent; it installs the skill and verifies your token. ## Documentation - [OpenLaws API documentation](https://docs.openlaws.us): the developer documentation site, with an interactive API reference. - [API integration guide](https://openlaws.us/openlaws-api-guide.md): legal research concepts, search strategy, citation lookup, endpoints, response fields, errors, and worked examples. No legal background assumed. - [Coding-agent skill](https://openlaws.us/skills/openlaws-api/SKILL.md): the research process, search procedure, and recovery rules, as an installable Agent Skill. - [OpenAPI specification](https://openlaws.us/openapi.yaml): the schema source of truth for every endpoint, parameter, and field. The guide and skill use only what it lists. - [Release notes](https://docs.openlaws.us/development-guide/release-notes): API changes by version. - [Markdown syntax](https://docs.openlaws.us/development-guide/markdown-syntax): how `markdown_content` encodes structure and pincites. ## Core endpoints - `GET /api/v1/jurisdictions/:jurisdiction_key/laws`: the laws in a jurisdiction, with their law keys. - `GET /api/v1/jurisdictions/:jurisdiction_key/laws/citations?query=`: the provision a citation names. - `GET /api/v1/jurisdictions/:jurisdiction_key/laws/:law_key/divisions[/]`: root divisions, then walk the tree by `path`. - `GET /api/v1/jurisdictions/:jurisdiction_key/laws/search?query=…`: search every law in the jurisdiction. - `GET /api/v1/jurisdictions/:jurisdiction_key/laws/:law_key/search?query=…&within_division_path=`: search one law or one title of it (best relevance). ## Optional - [Law data coverage](https://docs.openlaws.us/development-guide/law-data-coverage): which laws exist per jurisdiction, and how often each is updated. - [Pricing](https://openlaws.us/pricing): the Law Data API plan, and the Enterprise Law Data API plan for teams that need security review, procurement support, and an SLA. - Bulk data: for integrators who need large amounts of data, strict data-security requirements, embedding the corpus, or comparing historical versions. Delivered to an AWS S3 bucket; ask through the pricing page. - Support: ask in your OpenLaws Slack channel. The team knows each jurisdiction's quirks.