Skip to main content

Legal API in 2026: What It Is, What It Returns, and How to Pick One

The lawyer who trusted the eloquent answer

In March 2023 a New York lawyer filed a brief in Mata v. Avianca that cited a string of cases. The cases read beautifully. They had names, reporter numbers, holdings, the works.

They also did not exist. ChatGPT had invented them, and the lawyer, charmed by how confident the output looked, never checked them against a real source. The court sanctioned him in June 2023, and the sanctions turned into the opening act of a genre.

In April 2026, EDRM republished a ComplexDiscovery tally of the AI sanction wave. It counted at least $145,000 in sanctions for fabricated citations imposed by U.S. courts in the first quarter of 2026, and its headline said courts had lost patience with these filings.

That story is the most useful frame for picking a legal API. Developers ask about features. They should also ask what the response actually returns, and whether they can trace it back to a real, citable source.

Reviewed and corrected on 12 October 2026. This is general information, not legal advice.

An eloquent answer you cannot verify is a liability with good prose. A boring structured record you can open and confirm is an asset. That distinction is the whole ballgame in 2026.

This post covers what a legal API really is, the five axes that separate a good one from a bad one, and what a real request and response looks like when you query primary law.

TL;DR

  • "Legal API" is not one category. The data splits into four types (statutes and regulations, case law, dockets, filings), and a second split runs across all of them: primary-law data APIs versus AI-answer APIs. Conflating them is the most common evaluation mistake.
  • Pick on five hard axes: coverage, freshness, response shape, auth, and pricing transparency. Feature lists lie. These do not.
  • After the fabricated-citation sanctions of 2023 to 2026, the API that returns a verifiable, citable primary-law record beats the one that returns a clever answer you cannot trace.
  • Statutes and regulations are the part of the legal corpus you should never try to scrape and maintain yourself. The pipeline is a tax you pay forever.
  • A good statutes response is structured: citation, title hierarchy, breadcrumb, relevance score, and direct links to the official text. A statutes API should be explicit about which corpora it serves. Vaquill AI's serves US primary law and no case law.

Part of our MCP and developer guide series.

For related MCP / API / developer coverage, see Top Legal Data APIs for Developers in 2026.

Spot the problem
Question 1 of 4

A chatbot hands you a case citation. You ask it, "Is that a real case?" and it says yes, and even adds that you can find it on a major legal database. Have you verified the case?

A legal API is an HTTP endpoint that lets your code request legal data (statutes, regulations, court opinions, dockets, or filings) and get it back as structured, machine-readable JSON or XML, without a human opening a browser. It turns the law into something your software can query, render, and verify on demand. That is the boring, correct definition.

The interesting part is that "legal data" hides two completely different products under one phrase, and developers conflate them constantly.

The first kind is a primary-law data API. You send it a query or a citation, it returns the underlying source: a statute section, a regulation, a court opinion. The value is in the corpus and the structure. Think of it as a database with an HTTP front door.

The second kind is an AI-answer API. You send it a question in plain English, it returns a generated answer, ideally grounded in primary law with citations attached. The value is in the synthesis. Think of it as a research associate behind an endpoint.

These are not interchangeable, and the failure mode of treating them as one is exactly what bit the Mata lawyer. An AI-answer API that does not anchor every claim to a retrievable source is producing confident prose.

A primary-law API does not hallucinate text, because it is not generating anything. It hands you text that already exists. It can still return the wrong section for a query, which is why the citation and source link on every row matter.

The right mental model: the AI-answer layer should sit on top of a primary-law layer, and the primary-law layer should be auditable on its own. If you cannot click through from the answer to the actual section of the U.S. Code, you do not have a legal research tool. You have a confident stranger.

A short history: from the Syllabi to JSON

An API is a new front door on a very old job. Somebody has always had to collect the law, organize it and hand it to lawyers, and the collecting has always been the hard part.

In 1876 a young Minnesota bookseller named John B. West started doing it. His first product was the Syllabi, an eight-page weekly pamphlet summarizing Minnesota Supreme Court decisions. The first issue came out on October 21, 1876, and its stated plan was modest: "to furnish digests or opinions in cases decided in other states, which may have a special importance here." It did well enough that by the next year it was renamed the North Western Reporter, and by 1879 it covered Iowa, Michigan, Nebraska and the Dakota Territory. In 1887 West announced a classification scheme for organizing points of law, and he later added "key numbers," a unique identifier for each point. The American Bar Association endorsed the classification plan as a standard in 1898. That is a 19th-century version of what you now call metadata, and it is why lawyers could find things at all. (Source: the ABA Journal's profile of West and the Syllabi.)

Statutes needed the same treatment. Congress passed an act on June 30, 1926 to "consolidate, codify, and set forth the general and permanent laws of the United States," compiled "into a single volume," and the result is the Code that is still cited as "U. S. C." The act is candid about the Code's limits. The matter in the Code "shall establish Prima facie" the laws in force on December 7, 1925, and if the Code and the original enactments disagree, the enactments win. Keep that in mind when you read a response from any API: a codified section is a well-organized view of the law, and the underlying source can still matter. (Source: the Act of June 30, 1926 in the Statutes at Large.)

The web changed who could read all this. Since May 1990 the Supreme Court has released its decisions to the Internet. In 1992 Thomas Bruce and Peter Martin founded Cornell's Legal Information Institute, and since 1993 it has provided access to those decisions. The Institute's introduction page also describes converting the raw text of the U.S. Code from the Office of the Law Revision Counsel into hyperlinked web pages, with an update service for sections that had changed. (Source: the LII's own introduction to the Institute.) A person could now read the law for free. A program still had to scrape the pages, which is the gap that structured legal APIs fill.

The Supreme Court put the principle behind all of this plainly in 2020, in a case about whether Georgia could copyright its annotated state code. "The animating principle behind this rule is that no one can own the law," the Court wrote, adding, in a passage quoting an 1886 Massachusetts decision, that "Every citizen is presumed to know the law," and that all should "have free access" to its contents. (Georgia v. Public.Resource.Org, slip opinion.) Free access to the text is settled. What costs money, then and now, is organizing it, keeping it current and making it queryable.

Under the two layers above, "legal data" itself splits into four corpora, and most APIs specialize in one or two. Knowing which type you need is the first decision, because pricing, freshness, and licensing differ wildly across them.

  • Statutes and regulations. The codified law: the U.S. Code, the Code of Federal Regulations, and the state and territory codes. Best when you need the current text of a section, its hierarchy, and amendment history. Free government sources include govinfo.gov (GPO) and the Federal Register API for daily executive actions. OpenLaws, Midpage and Vaquill AI package this layer for developers.
  • Case law. Court opinions and precedent. LexisNexis and Westlaw sell proprietary case-law access by subscription or contract.
  • Dockets and litigation data. The live record of who filed what, when: parties, entries, documents, and deadlines. PACER is the federal source. Docket Alarm and UniCourt are commercial sources of docket data, and UniCourt's site lists API delivery.
  • Filings and agency records. Regulatory and enforcement documents: SEC EDGAR filings, Regulations.gov rulemaking dockets, and openFDA for FDA records. These are filing-specific feeds, not general legal research.
TypeWhat it returnsExample providersTypical access
Statutes and regulationsCode sections, hierarchy, amendment historygovinfo, Federal Register, OpenLaws, Midpage, Vaquill AIFree gov sources; commercial APIs publish plans or sell by contract (check each provider's page)
Case lawCourt opinions, precedent, citationsLexisNexis, WestlawSubscription or contract
Dockets and litigationParties, entries, deadlines, documentsPACER, Docket Alarm, UniCourtPaid per-use / subscription
Filings and agency recordsSEC, FDA, rulemaking documentsSEC EDGAR, Regulations.gov, openFDAFree gov

A practical rule: statutes and case law are the two corpora that are hardest to scrape and maintain yourself. The pipeline is a permanent cost, covered below. Dockets and filings change so fast that you almost always want a vendor's feed anyway.

The five axes that actually matter

Forget the marketing grids. Score any legal API on five things.

1. Coverage: which corpora, and how deep

Coverage is the first filter and the one most easily faked. "Comprehensive US legal data" means nothing. Ask: which corpora, and how many sections within each?

For case law, the bar is breadth of precedent: a serious tool should cover the bulk of precedential U.S. decisions across federal and state courts, reachable by citation and by semantic query.

On the statutes side, coverage means the U.S. Code, the Code of Federal Regulations, and the state and territory codes, each of which is published differently, formatted inconsistently, and amended on its own schedule.

A vendor that says "we cover statutes" should be able to hand you section counts per corpus. If they cannot, the coverage is thinner than the homepage suggests.

2. Freshness: how often the corpus refreshes

Statutes amend. Regulations get rewritten. Executive actions land daily. A legal API that returns last year's text of a section is not just stale, it is dangerous, because the reader assumes it is current.

So ask about cadence per corpus, not in the aggregate. Federal Register material (rules, executive orders, proclamations) is published every business day. The U.S. Code, the CFR and state codes change on other schedules, set by their publishers.

"We keep it updated" is not an answer. A source-by-source cadence, plus a way to see when each source was last read, is, and a vendor worth buying from can walk you through what refresh cadence means source by source.

3. Response shape: structured fields versus prose blobs

This is the axis that most developers underweight and later regret. The shape of the response determines what you can build.

A prose blob (one big string of generated text) is easy to display and impossible to build on. You cannot filter it, score it, deduplicate it, or verify it without re-parsing.

A structured response gives you fields: a citation you can render as a link, a hierarchy you can show as a breadcrumb, a relevance score you can sort on, a corpus type you can filter by, format links you can hand to a user for verification. Those fields, and the promise that they are still there next quarter, are what the schema contract a legal data API owes you is made of.

Here is the rule, sharpened by the sanction wave: the response should make verification cheap. If every source comes back with a citation and a direct link to the official text, your users can confirm the law in one click.

If it comes back as a paragraph, they have to trust you. After Mata, trust is not a feature you want to be selling.

4. Auth: how you get in and stay in

Auth is the least glamorous axis and the one that quietly determines whether you ship this quarter. Look for plain Bearer-token authentication over HTTPS, keys you can rotate from a dashboard, and a prefix convention so you can spot a leaked key in your logs (a vq_key_ style prefix is one example you will see in this category).

Avoid anything that requires a sales call to get a sandbox token. If you cannot generate a key and make your first call in ten minutes, that friction is a preview of the whole relationship.

AxisGood signalRed flag
CoverageSection counts per corpus, stated case-law breadth"Comprehensive US data" with no numbers
FreshnessA stated cadence per source and a visible last-read time"Kept up to date"
Response shapeCitation, hierarchy, relevance score, format linksOne prose blob
AuthBearer token, dashboard key rotation, prefix conventionSales call for a sandbox key
PricingA unit price and per-call costs you can read before you sign up"Contact sales" or "from $X/mo"

5. Pricing transparency: can you see the meter

Incumbent research platforms are largely sold by quote. SoftwareFinder's LexisNexis page says the cost "starts from $171/month" and ends in a custom-pricing tier, so the real number depends on what you negotiate.

For a developer trying to estimate unit economics, opacity is disqualifying.

What you want is a unit price and per-call costs you can read before you commit, so you can model your unit economics.

A real statutes request and response

Enough theory. Here is a search against a primary-law API, for the concept behind a statute every litigator knows: deprivation of rights under color of law.

curl -X POST https://api.vaquill.ai/api/v1/us/statutes/search \
  -H "Authorization: Bearer $VAQUILL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "deprivation of rights under color of law", "corpusType": "USC", "limit": 1}'

Two things to notice before the response. The auth is a single Bearer header, no OAuth dance. And corpusType scopes the search to the U.S. Code, so you are not wading through state look-alike provisions. (The endpoint also accepts a state filter when you do want a specific jurisdiction.)

This is a real response from 12 October 2026, trimmed to 12 of the 148 fields a result can carry. The envelope fields shown are real too, with a few others (total, offset, query and timing) left out.

{
  "results": [
    {
      "actId": "USC_T18_C13_S242",
      "citation": "18 U.S.C. § 242 (2026)",
      "title": "Deprivation of rights under color of law",
      "corpusType": "USC",
      "relevanceScore": 0.93,
      "displayPath": "Title 18: CRIMES AND CRIMINAL PROCEDURE / Chapter 13: CIVIL RIGHTS / Section 242: Deprivation of rights under color of law",
      "breadcrumb": [
        { "type": "title", "num": "18", "label": "Title 18", "name": "CRIMES AND CRIMINAL PROCEDURE" },
        { "type": "chapter", "num": "13", "label": "Chapter 13", "name": "CIVIL RIGHTS" },
        { "type": "section", "num": "242", "label": "Section 242", "name": "Deprivation of rights under color of law" }
      ],
      "actStatus": "in_force",
      "goodLawStatus": "good_law",
      "lastAmendedYear": 1996,
      "currentThrough": "2026-09-18",
      "sourceUrl": "https://uscode.house.gov/view.xhtml?req=granuleid:USC-prelim-title18-section242&num=0&edition=prelim"
    }
  ],
  "count": 1,
  "hasMore": true,
  "noGoodMatch": false,
  "matchQuality": "strong",
  "creditsConsumed": 4
}

The top hit is 18 U.S.C. § 242, the criminal provision. The civil cause of action most people mean, 42 U.S.C. § 1983, is a different section, and you reach it by citation or by a query worded for it.

Every field here earns its place. The citation renders as a link. The displayPath and breadcrumb tell your user (and you) exactly where this provision sits in the code. actStatus is the publisher's own status word and goodLawStatus is a conservative verdict derived from it, so treat unknown as "verify against the official source."

The relevanceScore orders the results within this one response. It is a relative rank, not a confidence, so don't compare it across queries or cut results off at a fixed value. To ask whether the corpus has anything on point at all, read noGoodMatch on the response, and matchQuality (exact, strong, moderate, weak, none) to judge how far to trust the top result. The lastAmendedYear and currentThrough fields are your freshness signals in-band: the first is the last amendment the publisher credits on this section, the second is the date the publisher says the text is current through. And sourceUrl is the verification path: a user can open the government's own page and confirm the law for themselves.

That is the response shape that survives a sanctions motion.

Search blends semantic and keyword matching (see hybrid search), so a plain-language query can find a section even when the exact words are not in its title.

If you want the actual text, the section body endpoint returns the full provision in HTML and plain text. To go straight from a citation to a section, the resolve endpoint takes a string such as 42 U.S.C. 1983 and returns USC_T42_C21_S1983.

For the deeper mechanics of how queries get matched, the Boolean search guide goes into operator syntax across legal databases.

What developers say

The people who try to use legal data programmatically tend to complain about the same two things: the data is inconsistent, and nobody can quickly check what a tool tells them.

On the first, a Hacker News commenter writing about legal research in June 2026 put it this way: "it boggles my mind how every state organizes their statutes in entirely dissimilar ways." The same commenter pointed at what consistency would buy: "it would even be possible to introduce a form of unit testing for legal drafting that would allow us to automatically verify if the LLM hallucinated a citation." (stult, Hacker News, June 2026.) That is the verification argument in this post, made by a reader of the news and not by a vendor.

On the second, when the Avianca news broke in June 2023, a commenter wrote of the lawyer: "He did the absolute, bare minimum amount of verification needed to [hopefully] cover his ass." (jstarfish, Hacker News, June 2023.) Blunt, but it matches the sanctions opinion, which describes a lawyer who asked the chatbot itself whether the cases were real.

What most people get wrong

They treat "legal API" as one category. They compare a case-law data API to an AI-answer API on price and conclude one is "cheaper," when the two are doing different jobs. Decide which layer you need first.

They optimize for the clever answer over the traceable record. A demo where the AI writes a gorgeous paragraph feels impressive. In production, the question your user (and eventually a judge) asks is "where does this come from?" Build for that question from day one.

ABA Formal Opinion 512, issued July 29, 2024, says a lawyer who uses a generative AI tool without an appropriate degree of independent verification or review of its output could violate the duty of competence under Model Rule 1.1. Your API choice either makes that verification easy or makes it hard.

The judge in Mata was not hostile to the technology. His sanctions opinion says "there is nothing inherently improper about using a reliable artificial intelligence tool for assistance. But existing rules impose a gatekeeping role on attorneys to ensure the accuracy of their filings." (Opinion and Order on Sanctions, June 22, 2023.) The same opinion records why the lawyer turned to ChatGPT. His firm's research subscription had limited access to federal cases, and he "falsely assumed" ChatGPT was "like a super search engine." Then, when he doubted the cases, he asked ChatGPT whether one of them was a real case, and it said yes. A response that carries a citation and a link to the official text gives your user a way out of that loop.

They ignore freshness until it burns them. A statute that was amended last month and an API that last refreshed last quarter is a quiet bug that ships wrong law to a confident user. Check the cadence per corpus.

They treat statute sourcing as a side task. Pulling USC, CFR and state codes from official sites that each work differently, parsing PDFs and XML, tracking section hierarchy and amendment history, and keeping all of it current is ongoing work. Plan for it whichever route you take.

It is not a project you finish. It is a system you feed. Unless statute ingestion is your product, buy the layer and spend your engineers on what makes you different.

If you want the full build-versus-buy math, the API call versus RAG pipeline comparison runs the numbers.

How this fits the broader stack

Picking a legal API is really picking which layers you outsource. A sensible split: statutes and regulations from a primary-law API (the maintenance trap), case-law access from a provider that maintains the corpus for you (the coverage trap), and an AI layer on top that is grounded in both, with citations you can open.

Two more reads worth your time as you evaluate. If you are weighing the legal exposure of ungrounded AI, the piece on AI hallucinations and sanctions connects the Mata lineage to today's penalties.

And if procurement or your security team is asking the hard questions, where your legal AI data actually goes is the one to send them, because the data-handling story matters as much as the response shape.

The throughline across all of it: in 2026, the legal API worth building on is the one that hands you a record you can verify, on a schedule you can trust, at a price you can read before you commit. Everything else is prose.

FAQ

What is a legal API? A legal API is an HTTP endpoint that lets your code request legal data (statutes, regulations, court opinions, dockets, or filings) and get it back as structured JSON or XML. Instead of a person searching a website, your application sends a query or a citation and receives a machine-readable record it can render, store, and verify.

What types of legal API are there? Four main ones: statutes and regulations (the codified law), case law (court opinions), dockets and litigation data (live case records), and filings and agency records (SEC, FDA, rulemaking). A separate split runs across all of them: primary-law data APIs return the source text, while AI-answer APIs return a generated answer that should be grounded in that source.

How do legal APIs work? They use a standard request-response pattern. You authenticate with an API key, send a request (a search query, a citation, or a filter like jurisdiction or corpus), and the server returns a structured response. A good one gives you fields you can act on: a citation, a hierarchy, a relevance score, and links to the official source text.

Are legal APIs free? Some are. U.S. government sources like govinfo, the Federal Register API, Regulations.gov, and openFDA are free. Commercial providers range from self-serve pricing to enterprise contracts. Lexis and Westlaw are sold by quote or tier; SoftwareFinder's LexisNexis page says the cost "starts from $171/month" (Software Finder), with a custom-pricing tier above it.

Can a legal API hallucinate? A primary-law data API does not invent text, because it returns text that already exists rather than generating anything (it can still return the wrong section, so check the citation). An AI-answer API can, which is why every claim it returns should link back to a retrievable primary source. The fabricated citations that drew sanctions in Mata v. Avianca came from ungrounded generation, not from a data API.

What is the difference between a legal API and legal research software? Research software is a browser product a person logs into. A legal API is the same data exposed to your code, so you can build it into your own application, workflow, or AI system. Many vendors offer both; the API is the developer-facing door to the corpus.

Which legal API should I use for US statutes? For raw federal text at no cost, use govinfo and the Federal Register API. If you need search, structured fields, citation hierarchy, and amendment history without building the ingestion pipeline, a statutes API is the faster path. Vaquill AI's API serves US primary law: the U.S. Code, the CFR, state and territory codes, court rules, agency guidance and more, with no case law.

For more on what a statutes-and-legislation API looks like end to end, see the US primary law API, or email contact@vaquill.ai.

Connect our US primary law database.
Every US statute, regulation, constitution, and executive order via REST, MCP or SQL. 5.4M+ sections, section-level citations, and links to the official source. Plus a free open dataset.
Updated October 12, 202625 min read

New legal AI guides, weekly.

Priyansh Khodiyar

Priyansh Khodiyar

Co-Founder & CTO

Priyansh leads engineering and AI at Vaquill AI: the pipelines that pull statutes, regulations and court rules from every US jurisdiction's official publisher, and the REST API, MCP server and open dataset that serve them.

Cookie preferences

Choose what Vaquill may use on this browser. You can change this at any time from “Cookie settings” in the footer.

Details in the Cookie Policy.