Short answer: Retrieval over court opinions breaks in five ways that retrieval over statute sections does not. An opinion is long prose where a majority and separate opinions share one text, so a chunk can hand one justice's view to a model as the Court's. A citation inside an opinion is an edge to another case, and a chunk without it loses context. The same words bind one court and not another, so court and date must be filters. A quote is only safe if you can check it against the full stored text. Result lists page, with caps. A sixth problem arrives first: one citation can return more than one record. Store ids, opinion kind and author, court, date and the text exactly as returned, then check every quote against it.
Written and checked on 25 November 2026. This is general information, not legal advice; check the cited opinion before relying on it.
TL;DR
- Split by opinion, then label. Every chunk carries the opinion's
kindand author. A search hit can be a dissent, and a combined text can hold four opinions. - Keep the edges. Store the case ids a chunk cites. The list of cited cases is a separate read, with a mention count for each.
- Filter on court and date in the query, before ranking, and keep both on every chunk.
- Check quotes against the full text. Keep the text as returned, with offsets. In the Gideon records read for this post, neither record is a perfect copy of the printed page.
- Expect more than one record for a citation.
372 U.S. 335and529 U.S. 266both came backambiguouson 25 November 2026.
Opinion text, as of 25 November 2026
The example is Gideon v. Wainwright, 372 U.S. 335 (1963). The citation matched two records in the API, and we read both. Two sentences show why chunk boundaries matter. The opinion of the Court, by Justice Black, says on page 344: "the Court in Betts v. Brady made an abrupt break with its own well-considered precedents." Justice Harlan, concurring, answers on page 349: "I cannot subscribe to the view that Betts v. Brady represented “an abrupt break with its own well-considered precedents.”" Both sentences appear in both records. We checked the wording against Cornell's Legal Information Institute copy and the Library of Congress scan of the U.S. Reports volume. Cornell's copy prints no page numbers, so the scan is the check that the sentences fall on pages 344 and 349, where the records' *344 and *349 markers put them.
You index the combined text of a Supreme Court opinion in 500-word windows. A user asks what the Court said about an earlier case, and the best window starts in the middle of a concurrence. What is the risk?
Who this is for and what you need
This is for an engineer who has built retrieval over statutes and is now pointing it at opinions. Create a key in your dashboard (the authentication docs show how) and send it as a Bearer token in the Authorization header. Calls go to https://api.vaquill.ai/api/v1/us.
How the responses here were obtained: the Vaquill MCP tools read the same records, and their field names match the REST examples in the case law quickstart and the opinion text page. Every response below was read through those tools on 25 November 2026 and is shown trimmed. The curl blocks are request shapes copied from the docs and were not run. The Python in "Try it" was run on 25 November 2026, on the full text of record B's lead opinion and of Douglas's concurrence and on fragments copied from record A's text. Record B was first read earlier that day as three opinions, with Douglas's concurrence inside the lead text; the record was corrected the same day, and its case record, lead opinion and Douglas's concurrence here come from a read after the correction.
Why opinions are harder than statute sections
A statute section is a short unit with one citation, no author and no later voices. An opinion is none of those things.
| Statute section | Opinion | |
|---|---|---|
| Length | Usually short | In the docs' sample of 20,000 opinions the median is about 5,300 characters and 90% are under about 26,700 |
| Voices | One text | A majority, concurrences, dissents, sometimes in one string |
| Citations | Its own cite | Its own cites, plus edges to every case it relies on |
| Where it applies | A jurisdiction | A court, a date and a rank that decide whether it binds |
| Quoting | Quote the section | Quote one opinion, at a page, from a text that may be scanned |
The size figures come from the data quality page, read on 25 November 2026; it measured a random sample on 22 November 2026 and says its figures are not an accuracy audit against the courts' own documents. For the generic pipeline, see how AI legal research works; for the cost side, API call vs RAG pipeline. The rest of this page covers only what case law changes.
Problem 1: one text, several voices
Reading Gideon through the API gives one decision in two shapes: record A holds one combined text, and record B is split into one record per opinion. Here is exactly what each record holds.
Record A USCASE_DE56583FBFB22C1A2854 | Record B USCASE_DE8506AF1050089F250C | |
|---|---|---|
| Citations listed | Five, including 372 U.S. 335, 83 S. Ct. 792 and 9 L. Ed. 2d 799 | One, 372 U.S. 335 |
opinions entries | One, kind combined, authorName null | Four: lead (Black), concurrence (Douglas), concurrence (Clark), concurrence (Harlan) |
| What the text holds | A header and the counsel lines, then Black's opinion of the Court, Douglas's concurrence, Clark's, Harlan's, then one NOTES block | One opinion per entry. The lead text is Black's opinion, ending "Reversed.", then his footnotes. Douglas's text starts MR. JUSTICE DOUGLAS. |
| Douglas | Inside the combined text | His own entry, with *346 and *347 page markers in its text |
| Footnotes | [1] to [7], then [1] to [4], [1] to [3] and [1] to [6] in one block | Black's seven footnotes follow "Reversed." as lines with no numbers and no heading, and in-text markers show as bare digits. Douglas's four notes are [1] to [4], at the end of his text |
textFromOcr | false | true on Black, Clark and Harlan; false on Douglas |
citedByCount | 6085 | 6950 |
qualityFlags | Empty | One entry: code duplicate_cluster, severity warn |
Neither record lists a dissent. The hazard shows here with concurrences, and a dissent is the same hazard with a larger consequence. A pipeline has to take both shapes: a combined text it must cut itself, and a split record it can read opinion by opinion.
The two sentences quoted above sit five pages apart. Black's, at page 344, is the Court's own account of Betts. Harlan's, at page 349, disputes that account while joining the result. His sentence is followed by “Ante, p. 344.”, a pointer back to the majority, and it only works if the page markers survive. A retriever asked whether Betts broke with precedent can return either sentence. If the chunk does not say who wrote it, a model will merge them.
What to do:
- Read the case first, then each opinion it lists. In record B, four reads cover what the
opinionslist names. The opinion text docs say each opinion is read and charged on its own. - Split a combined text yourself. Cut at the speaker lines, and cut the NOTES block off. The code in "Try it" does this for record A. Record B needs no cut: each opinion is its own record, and the same function returns one part for the lead text and one for Douglas's. Neither text has a NOTES line, so each opinion's notes stay at the end of its own text.
- Put
kindand author on every chunk, and write them into the text you hand the model, not only into metadata. - Key footnotes by opinion. In record A, footnote
[1]appears four times. In record B each opinion's notes already sit in its own text. - Do not treat a search hit as the holding. The search docs say a result is one case, with the best-matching opinion in
opinionId, and that opinion can be a dissent. For the main opinion, useleadOpinionId.
For how a human reads these parts in order, see how to read a Supreme Court opinion.
Problem 2: citations are edges
An opinion's meaning depends on the cases it points to. A chunk that says "Powell v. Alabama" is a pointer, and plain text hides where it leads. The API gives the edges as data. GET /us/cases/{caseId}/citations takes direction=cites or direction=cited_by and returns each case with a mentionCount. A per-opinion version exists too. In html format a citation to a case in the data is wrapped in a cite element carrying data-case-id.
The first three results of direction=cites, read for record A:
| Cited case | Mentions, record A |
|---|---|
| Betts v. Brady, 316 U.S. 455 | 31 |
| Powell v. Alabama, 287 U.S. 45 | 11 |
| O'Neil v. Vermont, 144 U.S. 323 | 5 |
We read the same list for record B before its correction and did not read it again, so its counts are not shown. Read the list for each record you hold. The first two results for direction=cited_by on record A were State of Iowa v. Young, 863 N.W.2d 249 (Iowa 2015), with 64 mentions, and United States v. Decoster, 624 F.2d 196 (D.C. Cir. 1979), with 33.
Three consequences for a pipeline:
- Store the cited case ids on each chunk. Retrieval can then pull the opinion a passage leans on instead of guessing from a name.
- Old cases carry no trace of later ones. Gideon says on page 339: "Upon full reconsideration we conclude that Betts v. Brady should be overruled." The text of Betts itself, decided in 1942, cannot say so. The later opinion does, so the edge from Gideon back to Betts is where that fact lives.
- A list of citing cases shows who mentioned a case, not who agreed. The endpoint lists citations only. To learn how a later court used a case, read that opinion.
Problem 3: court and date change the answer
The same sentence can bind one court and only persuade another. The binding vs persuasive authority guide has the map. For retrieval the rule is simple: the court and the date are part of the question, so they belong in the query and on every chunk.
The case search takes these filters, from the search docs:
| Filter | Value |
|---|---|
courtIds | Up to 50 court codes, such as US_FED_SCOTUS |
state, courtSystem | Two-letter code; federal, state, territorial, tribal, military |
courtLevel | supreme, appellate, trial and others |
dateFrom, dateTo | YYYY-MM-DD, both included |
publicationStatus | A list, such as ["published"] |
sort, minCitedBy | These act on the top matches, not on every match |
Request shape from the search docs, not run:
curl -X POST "https://api.vaquill.ai/api/v1/us/cases/search" \
-H "Authorization: Bearer $VAQUILL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "\"qualified immunity\" excessive force",
"courtIds": ["US_FED_CA9"],
"dateFrom": "2010-01-01",
"limit": 5
}'
Two details matter. First, filter in the request. The docs warn that sort and minCitedBy work on the top matches only, so ranking first and filtering afterward can hide the right opinion. Second, the records carry what you need to filter your own index: the Gideon records show courtId US_FED_SCOTUS with level supreme, and the Young case above shows US_IA_SUPREME with state IA. A date can also be partial: decisionDatePrecision says whether it is known to the day, month or year. Publication status matters too, because an unpublished decision may not be citable in the court your user is in. See published vs unpublished opinions.
Problem 4: quotes must be verbatim
A legal answer that quotes an opinion must quote it exactly, with the page. That means keeping the full text and checking every quote the model produces against it. The Gideon records show why you also need the court's own copy.
- Record A,
textFromOcrfalse, reads "Betts was indicated for robbery in a Maryland state court." The printed volume and Cornell read "indicted." - Record B's lead opinion,
textFromOcrtrue, reads "The Dependant:" where the print has "The DEFENDANT:", and "unable to. employ counsel" where the print has "unable to employ counsel". - Page markers sit inside words. Record B reads
We have con *340 strued this to mean. The scan's page break falls inside that word, and record A puts the marker after the word instead. A blanket find-and-replace on*340glues or splits words.
The docs describe the flag this way: textFromOcr is true when the text was read from page images and can hold recognition errors. It does not say a false value matches the print, and in this record it did not, in one word. Neither record is a perfect copy, so store the text exactly as returned, with its format, and let a function check quotes and report the span. If the answer will be filed or published, read the court's copy as well. The citation check guide covers that step.
Offsets help here. The docs say search can return passages, each with start and end positions in the plain text of the opinion. Compare a passage's span with the text format you stored before you rely on the positions.
Problem 5: paging and size
The docs give limits you should design around.
- An opinion is not paged. The
bodyfield holds the whole opinion. A read of several opinions takes up to 20 ids, and one answer holds at most 2,000,000 characters. When one does not fit,deferredlists the first opinion left over and every id after it, and you resume from the first deferred id. - Lists page by offset or by cursor. Search and most lists take
limitandoffset, up to an offset of 10,000, and you continue whilehasMoreistrue.GET /us/cases/listandGET /us/cases/changesuse a cursor: passnextCursorascursorwhilehasMoreistrue. - An empty page is still charged, so stop on
hasMoreinstead of probing for the end. - A broad search can time out with a
503. You are not charged. Narrow it by court, date or phrase.
Here is the paging contract on a live call. The first page of three cited cases for record A came back with "count": 3, "limit": 3, "offset": 0, "hasMore": true. The record says citedByCount 6085, which the data quality page defines as the number of distinct other cases that cite one of the case's opinions. At the MCP tool's largest page size of 100, 6085 rows is 61 pages. A list of more than 10,000 rows runs into the offset cap, so narrow it before you walk it.
One more: a citation can return more than one record
Both citations tried for this post returned ambiguous. The docs say ambiguous means several records match, sometimes copies of one case, and the response lists the candidates without picking one. We read the metadata for the three records returned for 529 U.S. 266, Florida v. J. L., decided 28 March 2000 in the Supreme Court. We did not read their texts.
caseId | caseName | docketNumber | Citations listed | citedByCount | leadOpinionId |
|---|---|---|---|---|---|
USCASE_18FDDAAD10F534CF5037 | Florida v. JL | 98-1993 | Seven | 1176 | USOP_616D1AA269978BD8F433 |
USCASE_613E2553DC6CBAB97960 | Florida v. J. L. | No. 98-1993 | One | 1587 | USOP_F761AE46C60E3AD672CD |
USCASE_7DD1DCFC8869F29F6B50 | Florida v. J. L. | No. 98-1993 | One | 6 | USOP_808F8552277471AFC34A |
The name, the docket string and the counts all differ. A pipeline that takes the first candidate, or counts every record as a case, will split one decision into several. The case data docs say to match on citation and docket number before you count or display cases. In practice:
- Group on citation, court, decision date and a cleaned docket number, with "No." stripped.
- Choose a canonical record by a written rule, and keep the other ids as aliases so a citation from any path lands on one case.
- Do not add
citedByCountacross records. The citing cases may overlap, and no record says which count is complete.
Try it
Five steps take you from a citation to a checked quote. Steps 1 to 4 use the API; step 5 is local.
1. Citation to candidates
Request shape from the docs, not run. Both citations went in one call; the first result is shown.
curl -X POST https://api.vaquill.ai/api/v1/us/cases/resolve \
-H "Authorization: Bearer $VAQUILL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"citations": ["372 U.S. 335", "529 U.S. 266"]}'
Response from the resolve_case_citations MCP tool on 25 November 2026, trimmed to the first result:
{
"results": [{
"index": 0,
"status": "ambiguous",
"case": null,
"candidates": [
{
"caseId": "USCASE_DE56583FBFB22C1A2854",
"caseName": "Gideon v. Wainwright",
"docketNumber": "155",
"court": { "courtId": "US_FED_SCOTUS", "level": "supreme" },
"decisionDate": "1963-03-18",
"citations": ["9 L. Ed. 2d 799", "83 S. Ct. 792", "372 U.S. 335", "93 A.L.R. 2d 733", "23 Ohio Op. 2d 258"],
"citedByCount": 6085,
"leadOpinionId": "USOP_A81A2E1ACDCB57E58D63"
},
{
"caseId": "USCASE_DE8506AF1050089F250C",
"caseName": "Gideon v. Wainwright",
"docketNumber": "No. 155",
"court": { "courtId": "US_FED_SCOTUS", "level": "supreme" },
"decisionDate": "1963-03-18",
"citations": ["372 U.S. 335"],
"citedByCount": 6950,
"leadOpinionId": "USOP_E1A9CB25ECC04A0CCF17"
}
]
}]
}
resolved would mean one case holds that citation. It never checks the case name, a quote or a pinpoint, and not_found does not mean a case is fake.
2. Read each candidate
Request shape, not run: GET /us/cases/{caseId} with the same header. The response wraps the record in case. The two records, trimmed to the fields this post uses:
{
"case": {
"caseId": "USCASE_DE56583FBFB22C1A2854",
"judgesText": "Black",
"opinions": [
{ "opinionId": "USOP_A81A2E1ACDCB57E58D63", "ordinal": 1, "kind": "combined", "authorName": null, "textFromOcr": false }
],
"qualityFlags": []
}
}
{
"case": {
"caseId": "USCASE_DE8506AF1050089F250C",
"judgesText": "Black, Clark, Douglas, Harlan",
"otherDates": "Argued January 15, 1963.",
"opinions": [
{ "opinionId": "USOP_E1A9CB25ECC04A0CCF17", "ordinal": 1, "kind": "lead", "authorName": "Black", "textFromOcr": true },
{ "opinionId": "USOP_048C7C0DE4FF65BB7C18", "ordinal": 2, "kind": "concurrence", "authorName": "Douglas", "textFromOcr": false },
{ "opinionId": "USOP_FAD866312C57DD110D38", "ordinal": 3, "kind": "concurrence", "authorName": "Clark", "textFromOcr": true },
{ "opinionId": "USOP_5CA94063C9908955C540", "ordinal": 4, "kind": "concurrence", "authorName": "Harlan", "textFromOcr": true }
],
"qualityFlags": [{ "code": "duplicate_cluster", "severity": "warn", "detectorVersion": 3 }]
}
}
The data quality page says a flag has a code, a severity and a detector version, and that warn marks a defect that may affect use. Its table of text-defect flags does not list duplicate_cluster, so treat it as a hint and do not build logic on it.
3. Read an opinion
Request shape, not run:
curl "https://api.vaquill.ai/api/v1/us/opinions/USOP_A81A2E1ACDCB57E58D63?format=text" \
-H "Authorization: Bearer $VAQUILL_API_KEY"
Response, trimmed. The body holds the whole text of the record, so only its first lines are shown:
{
"opinionId": "USOP_A81A2E1ACDCB57E58D63",
"caseId": "USCASE_DE56583FBFB22C1A2854",
"caseName": "Gideon v. Wainwright",
"courtId": "US_FED_SCOTUS",
"decisionDate": "1963-03-18",
"kind": "combined",
"authorName": null,
"textFromOcr": false,
"bodyUnavailable": false,
"format": "text",
"body": "372 U.S. 335 (1963)\nGIDEON\nv.\nWAINWRIGHT, CORRECTIONS DIRECTOR.\nNo. 155.\nSupreme Court of United States.\nArgued January 15, 1963.\nDecided March 18, 1963.\n…"
}
4. Read the edges
Request shape, not run: GET /us/cases/{caseId}/citations?direction=cites&limit=3. Response for record A, trimmed to the fields in the table above:
{
"caseId": "USCASE_DE56583FBFB22C1A2854",
"results": [
{ "case": { "caseId": "USCASE_4E3CEFBE7CE650B44FB1", "caseName": "Betts v. Brady", "citations": ["86 L. Ed. 1595", "62 S. Ct. 1252", "316 U.S. 455"] }, "mentionCount": 31 },
{ "case": { "caseId": "USCASE_A1D37396A29DACEF583A", "caseName": "Powell v. Alabama", "citations": ["77 L. Ed. 158", "53 S. Ct. 55", "287 U.S. 45", "84 A.L.R. 527"] }, "mentionCount": 11 },
{ "case": { "caseId": "USCASE_6427922A6C8ED03BEDE6", "caseName": "O'Neil v. Vermont", "citations": ["36 L. Ed. 450", "12 S. Ct. 693", "144 U.S. 323"] }, "mentionCount": 5 }
],
"count": 3,
"limit": 3,
"offset": 0,
"hasMore": true
}
5. Split the text and check quotes
This local code cuts a combined text at its speaker lines and finds a quote in the original text, returning its start and end. It ignores *NNN page markers, case, spacing and punctuation, so a marker inside a word does not break the match.
import re
SPEAKER = re.compile(r"^mr\. justice (\w+)", re.IGNORECASE | re.MULTILINE)
MARKER = re.compile(r"\*\d{1,4}")
def split_by_speaker(text):
"""Cut a combined opinion at each 'Mr. Justice X' line. Returns (label, start, end)."""
notes = re.search(r"^NOTES$", text, re.MULTILINE)
stop = notes.start() if notes else len(text)
marks = [(m.start(), m.group(1).title()) for m in SPEAKER.finditer(text, 0, stop)]
parts = [("preface", 0, marks[0][0])] if marks and marks[0][0] else []
for i, (start, name) in enumerate(marks):
end = marks[i + 1][0] if i + 1 < len(marks) else stop
parts.append((name, start, end))
if notes:
parts.append(("notes", stop, len(text)))
return parts
def squash(text):
"""Keep letters and digits only, lower-cased, and drop *NNN page markers.
where[i] is the offset in the original text of squashed[i]."""
skip = {i for m in MARKER.finditer(text) for i in range(m.start(), m.end())}
kept, where = [], []
for i, ch in enumerate(text):
if i not in skip and ch.isalnum():
kept.append(ch.lower())
where.append(i)
return "".join(kept), where
def find_quote(text, quote):
"""Return (start, end) of the quote in the ORIGINAL text, or None."""
flat, where = squash(text)
q, _ = squash(quote)
at = flat.find(q)
if at < 0 or not q:
return None
return where[at], where[at + len(q) - 1] + 1
Run on 25 November 2026. The record A speaker test used the speaker and section lines copied from its text, and its quote tests used sentences copied from it, so those offsets point into fragments. The record B lines ran on the full text of the lead opinion and of Douglas's concurrence, as returned after the correction:
record A split: preface, Black, Douglas, Clark, Harlan, notes
record B lead split: Black
record B Douglas split: Douglas
A, "the right to the aid of counsel is of this fundamental character"
-> found, across a marker: 'the right to the aid of *343 counsel is of this fundamental character'
A, "Betts was indicted for robbery in a Maryland state court" -> None
B lead, "Betts was indicted for robbery in a Maryland state court" -> found
B lead, "We have construed this to mean that in federal courts counsel must be provided"
-> found: 'We have con *340 strued this to mean that in federal courts counsel must be provided'
The useful result is the failed check on record A, and the court's copy says the check was right to fail. In record B each text comes back as one part, because each opinion is already its own record. Two limits: the function keeps digits, so a footnote number inside a quoted sentence breaks a match. In the lead text it shows as a bare 1 (Government.” 1 Treating the petition) and in Douglas's concurrence as [4] (prevailed[4] and rights). A quote that leaves the number out returns None on both, and so does any real wording difference. Report failures to a human instead of loosening the match.
What to store
| Level | Keep | Why |
|---|---|---|
| Case | caseId, every citations string, courtId, level and state, decisionDate with its precision, docketNumber as text, publicationStatus | Key, lookups and filters |
| Alias set | Every candidate caseId for one citation, your canonical pick and the rule | Ambiguous results |
| Opinion | opinionId, kind, authorName, format, textFromOcr, the text exactly as returned, the day you fetched it | Refetching, labels and quote checks |
| Chunk | Opinion id, start and end offsets into the stored text, kind, author, court, date, ids of the cases it cites | Filters, labels and edges |
| Edge | Citing case id, cited case id, mentionCount, fetch date | The citation graph; refetch it rather than freeze it |
| Answer | Each quote with the offsets your check returned | An audit trail |
For keeping a stored copy current, including removed rows and 410 responses, see court opinions as JSON.
Limits
- Search is keyword search. Every word must appear in one opinion, up to three quoted phrases are allowed, and
OR,NOTand wildcards are not supported. If you know the citation, resolve it. - Many records have no reporter citation, so they do not resolve by it. The data quality page measured at least one reporter citation on about 96% of supreme-level cases, 82% of appellate cases and 45% of trial-court cases in a random sample on 22 November 2026.
- Check the terms before you cache or show text. The rights and licensing page says you may cache, index and show case law in your own product (showing it to end users carries a credit line unless your plan waives it), and may not redistribute it as a dataset or API without a separate agreement.
What goes wrong
- Chunking across opinion lines. A window that straddles Black and Harlan attributes Harlan's disagreement to the Court.
- Taking the first candidate. An
ambiguousresult picks nothing, and each candidate is a separate record. - Counting records as cases. Gideon is two records and Florida v. J. L. is three, each with its own
citedByCount. - Trusting
textFromOcr: false. Record A has a wrong word despite it. - Stripping page markers with replace. In record B it turns
con *340 struedinto two fragments, so the text no longer matches the print. - Returning an old case as current. Betts v. Brady can match a right-to-counsel query. Its own text does not say Gideon overruled it.
- Treating
resolvedas proof. It means a case holds that citation, not that a brief's name, quote or pinpoint is right. - Paging blind. An empty page is charged and the offset stops at 10,000. Stop on
hasMore.
For US case law, statutes and regulations through one API key, see the US case law API.
FAQ
How do you chunk court opinions for RAG?
Split by opinion first, then by paragraph inside each opinion, and keep the opinion's kind and author on every chunk. A decision can have a majority, concurrences and dissents, and some records hold several in one text. Keep footnotes with the opinion they belong to, and keep the page markers so a pointer such as "Ante, p. 344" still means something.
Why does legal RAG need court and date filters?
A court's decision binds the courts below it in the same system and persuades others, and a decision's date decides whether it was still the rule in the year you care about. Put both in the search request, because the docs say sort and minCitedBy act only on the top matches, and keep both on each chunk so your own index can filter too.
How do I stop a model from misquoting an opinion?
Keep the opinion text as returned and check every quote the model emits against it, returning the span. If the answer will be filed or published, also compare it with the court's copy. In the Gideon records read for this post, record A had a wrong word although it was not flagged as scanned, and record B's lead opinion had recognition errors it was flagged for.
What do I do when a citation returns more than one case?
A citation can return ambiguous, which lists every candidate and picks none. Group candidates on citation, court, date and a cleaned docket number, choose a canonical record by a rule you write down, and keep the other ids as aliases. Do not add their citedByCount values.
How do I follow citations between opinions?
Read GET /us/cases/{caseId}/citations with direction=cites for what a case relies on and direction=cited_by for later cases that mention it, each with a mention count. Page with limit and offset while hasMore is true. The list shows who mentioned a case, and you have to read the later opinion to see whether it agreed.
How big is an opinion, and can I fetch it in pieces?
The docs' sample of 20,000 opinions had a median of about 5,300 characters and 90% under about 26,700, so many fit in one read. The body is not paged, and a read of several opinions stops at 2,000,000 characters, returning a deferred list. Split it into chunks yourself after you have fetched it.
Can I build retrieval on this data in my own product?
The rights page says you may cache, index and show case law in your own product (showing it to end users carries a credit line unless your plan waives it), and may not redistribute it as a dataset or API without a separate agreement. Read rights and licensing, including its section on withdrawn cases, before you build.
New legal AI guides, weekly.
Further Reading
- Case Law MCP Server: Connect Claude to US Case Law
- Court Opinions as JSON: The Fields and a Working Fetch
- Citation Lookup API: Build a Brief Checker in One Request
- Supreme Court Decisions Dataset: Where to Get It and What Each Covers
- Judge Data API: Profiles, Positions and Case Counts
- How to Check If a Case Is Still Good Law: What Citing Lists Miss

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.
