Overview
The LawDiver API is a versioned REST surface at https://lawdiver.com/api/v1. Create an account and get a key. It exposes case search, cite checking (a single citation, a batch, or an entire uploaded document — cases, U.S.C., C.F.R., state statutes, court rules, constitutions, plus IRS tax authorities), citation resolution, case metadata and retrieval (including PDFs), statute section retrieval by Bluebook citation, good-law and citing-case lookups, and a jurisdiction reference — over the same verified corpus that powers this site. A bulk upload runs many of those calls and returns one document when they finish. Product overview: /products/api. The same key also unlocks the hosted MCP server at POST /mcp (see /products/mcp).
Every request and response is JSON, except where a PDF is the product. Every response — success or failure — carries a requestId. Quote it in support requests; it keys the exact ledger row and log line for your call.
https://lawdiver.com/api/v1. Always configure your HTTP clients to use the apex domain over HTTPS. Cross-host redirects (such as from www.lawdiver.com) or plain http:// redirects cause standards-compliant HTTP clients to strip the Authorization header or send credentials unencrypted. If a key is ever sent over plain HTTP, treat it as compromised and rotate it at /account/api-keys./api/v1 on every host before the www→apex redirect. If clients still see a cross-host 301 on www.lawdiver.com/api/v1, add a Cloudflare Redirect Rule exception sowww.lawdiver.com/api/v1* is not redirected (or is served in place). Separately, strip client-suppliedCF-Connecting-IP (and related) on /api/v1* with a Transform Rule — spoofed values yield a bare Cloudflare 403 (error code: 1000) before the request reaches the origin.# No key required — lists endpoints
curl https://lawdiver.com/api/v1Commercial use
The API may be used for commercial purposes under the Terms of Service. Build a legal app you keep to yourself, software your firm runs, or a product you offer the general public — including one you charge for, and including one that serves API returns to third parties for compensation.
That is unusual. CourtListener's membership API is limited to personal, educational, research, journalistic, and exploratory use. A revenue-generating product, a firm of more than five attorneys, and internal tools that support an organization each require a separate commercial agreement. Westlaw and Lexis do not license their opinions into an app that competes with theirs.
LawDiver supplies the raw material — the cases, the statutes, the regulations, and the rules — and your product is what users see. You may not use the API to recreate, rebuild, or mirror the LawDiver database; wholesale corpus copies require a separate bulk-data license. The Terms are at /terms; the longer product account is on /products/api#commercial-use.
Authentication
Send your API key on every request except the unauthenticated discovery document at GET /api/v1. The bearer form is preferred because it is what HTTP clients and API gateways already understand. lawdiver_api_key is an optional label: send it as a header or as a query parameter when the caller names the credential.
Authorization: Bearer ld_live_xxxxxxxxxxxxxxxxxxxx
# or
X-API-Key: ld_live_xxxxxxxxxxxxxxxxxxxx
# or the optional key label (header)
lawdiver_api_key: ld_live_xxxxxxxxxxxxxxxxxxxx
# or the same label as a query parameter
?lawdiver_api_key=ld_live_xxxxxxxxxxxxxxxxxxxxGetting a key
Create and revoke keys at /account/api-keys after signing up and verifying your email. A key is shown exactly once, at creation — only a SHA-256 hash is stored, so it cannot be recovered or re-displayed. If a key is lost, revoke it and issue a new one. Revocation takes effect on the next request.
Responses and errors
Successful responses carry the endpoint's payload plus two envelope fields: usage (units recorded for this call) and requestId.
{
"results": [ ... ],
"usage": {
"operation": "case_search",
"quantity": 7,
"breakdown": { "cases": 7 }
},
"requestId": "req_Ab3xK9pQ"
}usage.breakdown keys depend on the operation — for example { cases } on search and retrieval, { citations, errors } on cite check, and { citations, pages, errors } on document cite check.
Errors use the same envelope with an error object. Branch on error.code, not on the message — codes are stable, messages may be reworded.
{
"error": {
"code": "invalid_request",
"message": "Invalid search request.",
"details": [
{ "field": "jurisdiction.state", "message": "jurisdiction.state is required when type is 'one_state'" }
]
},
"usage": null,
"requestId": "req_Ab3xK9pQ"
}| Field | Type | Description |
|---|---|---|
missing_api_key | 401 | No key was presented. |
invalid_api_key | 401 | The key is unknown, revoked, or expired. These are not distinguished on purpose. |
api_key_deactivated | 401 | The key was deactivated because that address opted out of email. The message states that reason. |
account_suspended | 403 | The account exists but is not permitted to make calls. |
rate_limited | 429 | Too many requests. Honour Retry-After. |
invalid_request | 400 | Validation failed. details names the offending fields. |
not_found | 404 | No such case, job, or report — or no /api/v1 route matches the path. |
method_not_allowed | 405 | The path exists but the HTTP method does not. The Allow header lists the permitted verbs. |
gone | 410 | The path has been retired. The body may include a replacement hint. |
idempotency_conflict | 409 | The same Idempotency-Key was reused with a different request body. Generate a fresh key for the new request. |
unsupported_media_type | 415 | Document upload was not a PDF or Word file. May include received and fileName. |
payload_too_large | 413 | Uploaded document exceeds the size limit. |
service_unavailable | 503 | A dependency was briefly unavailable, or a soft deadline was hit (for example resolve / retrieve / cited-by / goodlaw-check). Retry. |
internal_error | 500 | Our fault. Quote the requestId. |
200 with status: "did_you_mean" and up to three candidates. The request was understood and usefully answered, so treating it as an error class would make your error handler swallow the suggestions.Retired endpoints
POST /api/v1/requests and GET /api/v1/requests/:id return gone (410). Case processing is no longer queued through the public API — use retrieval and cite-check for published data, or on-demand processing on the case display.
Troubleshooting headers and proxies
Do not inject CF-Connecting-IP: Inbound requests carrying a client-supplied CF-Connecting-IP header are rejected at the edge proxy with HTTP 403 (error code 1000). If your corporate egress proxy, CDN, or API gateway automatically injects this header, strip or omit it before sending requests to the LawDiver API.
Idempotency
Send an Idempotency-Key header on the endpoints that honour it: POST /api/v1/search, POST /api/v1/citecheck/cite, POST /api/v1/cases/retrieve, and POST /api/v1/statutes/retrieve. If the same key is replayed for the same account with the same request body, the stored response is returned with replayed: true (also on usage.replayed) and the work is not run again. Use it whenever a network timeout leaves you unsure whether a call landed.
Other endpoints — including GET /api/v1/cases/:id/pdf, case metadata, batch lookup, and document upload — do not read the header. A retried PDF download re-renders; cache the bytes on your side if you need a safe retry.
curl -X POST https://lawdiver.com/api/v1/search \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: my-request-2026-08-13-001" \
-d '{"query":"adverse possession","jurisdiction":{"type":"one_state","state":"FL"},"limit":5}'idempotency_conflict (409) — it does not run the new request and does not silently return the old answer. Generate a fresh key per distinct request. The original call must have sent the key — a first call without one cannot be replayed later.A replayed search returns results, total, replayed, usage, and requestId — not totalAvailable, searchInfo, or suggestion. Cite check replays the stored results; case and statute retrieve replay the stored response whole.
Rate limits
Authenticated requests are limited per minute per account. Guarded responses carry your budget headers on every outcome (including success); a 429 also sends Retry-After. The unauthenticated discovery route (GET /api/v1) does not send rate-limit headers.
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
X-RateLimit-Reset: 1726260000 # unix seconds when the window resets
RateLimit-Limit: 60
RateLimit-Remaining: 57
RateLimit-Reset: 12 # seconds until reset
RateLimit-Policy: 60;w=60
Retry-After: 12 # only on 429Your limit is reported in GET /api/v1/usage. The limiter is a per-replica in-memory window, so treat the published number as a floor and back off on Retry-After rather than computing against an exact global budget. If you need a higher ceiling, ask — it is a per-account setting, not a plan tier.
Time limits
Every API call has a time limit to completion. Search, cite check, retrieval, and citing-case lookups each stop when that deadline is reached and return JSON, so the edge gateway does not replace the answer with an HTML timeout page. The search budget stays under the gateway idle timeout, about 100 seconds.
When API usage is high, some requests still reach that limit before they finish. Complex searches are the usual case: several engines share one deadline, one of them runs long, and the call comes back as an error or as a degraded search. A timeout is a failed attempt. It does not mean the corpus has no matching authority. Retry the call, or send the work through bulk upload, which attempts every call three times before giving up.
service_unavailable, lookupStatus: deadline_exceeded, and a search with degraded: true as incomplete work. An empty results list on a degraded search does not mean the case is absent.Quickstart
A minimal TypeScript client. It centralizes the key, surfaces the requestId on failure, and adds nothing else — the API is plain HTTP and does not need an SDK.
const BASE = 'https://lawdiver.com/api/v1';
const KEY = process.env.LAWDIVER_API_KEY!; // server-side only
async function call<T>(path: string, body?: unknown, idempotencyKey?: string): Promise<T> {
const res = await fetch(BASE + path, {
method: body ? 'POST' : 'GET',
headers: {
Authorization: `Bearer ${KEY}`,
...(body ? { 'Content-Type': 'application/json' } : {}),
...(idempotencyKey ? { 'Idempotency-Key': idempotencyKey } : {}),
},
body: body ? JSON.stringify(body) : undefined,
});
const json = await res.json();
if (!res.ok) {
// Quote requestId in support tickets; it keys our log line and ledger row.
throw new Error(`${json.error?.code}: ${json.error?.message} (${json.requestId})`);
}
return json as T;
}
const found = await call<{ results: Array<{ caseName: string; citation: string }> }>('/search', {
query: 'promissory estoppel reliance damages',
jurisdiction: { type: 'one_state_plus_federal', state: 'NY' },
limit: 5,
});
for (const r of found.results) console.log(r.caseName, '—', r.citation);Case search
/api/v1/searchSearches the opinion corpus and returns cases with the passage that made each one relevant. Jurisdiction is required — an unscoped national search is the slowest query available and is almost never what was intended.
Request body
| Field | Type | Description |
|---|---|---|
queryrequired | string | What to search for: a citation, a case name, a description of the issue, or a boolean query (AND, &, OR, NOT, %, "phrase", !, *, /s, /p, w/5). Under auto, connectors are uppercase. Under boolean, lowercase and / or / not are connectors too. |
jurisdictionrequired | object | Which courts to search. See the table below. |
searchType | enum | auto (default), citation, case_name, boolean, semantic, or hybrid. keyword is accepted and runs boolean. Leave it out unless you know what you have. |
limit | integer | Cases to return, 1–200, default 10. Capped by your account's maxCasesPerSearch (platform default 50 — asking for more than your cap silently returns at most the cap). |
filters.dateFrom | string | YYYY-MM-DD. Only cases filed on or after this date. |
filters.dateTo | string | YYYY-MM-DD. Only cases filed on or before this date. |
filters.includeUnpublished | boolean | Unpublished dispositions are excluded by default. Set true to include them (some jurisdictions allow limited citation of unpublished opinions). |
filters.publishedOnly | boolean | When true, further restrict to opinions marked published on is_published. Independent of the default unpublished exclusion above. |
filters.goodLawOnly | boolean | Exclude cases with negative treatment. Off by default: bad law is flagged, not hidden, because you usually need to know it exists. |
include.caseCard | boolean | When true, attach the AI analysis card (summary, holdings, issues, quotations, syllabus) when Stage-2 analysis exists; otherwise caseCard: null. Off by default. |
include.opinionText | boolean | When true, attach opinion text: the full body if it fits opinionTextMaxChars, otherwise query-relevant excerpts totaling that budget. Off by default — turn it on for agent loops that must read without a second retrieval call. |
include.goodLawReport | boolean | Expand goodLaw with negative-treatment evidence (citing cases that overruled, questioned, or otherwise treated this one). On by default so a tool caller sees overruled / questioned without a follow-up. Set false for the summary-only shape. |
opinionTextMaxChars | integer | Char budget for include.opinionText. Default 10000, clamped 500–50000. Short opinions return in full; longer ones return excerpts. |
searchType
Omitting searchType routes the query automatically and is the recommended default. Pinning an engine is worth it when you already know what the string is — it removes both the latency and the false positives of engines that had nothing to contribute.
| Field | Type | Description |
|---|---|---|
auto | default | The router inspects the query and picks. Use this unless you have a reason not to. |
citation | pinned | The string is a reporter citation. |
case_name | pinned | The string is a party name. |
boolean | pinned | Strict Terms and Connectors over opinion text. Every term is required. No semantic, name, or citation hits are mixed in. See search connectors. keyword is accepted and runs this same search. |
semantic | pinned | Meaning-based retrieval; the query is a description of an issue. |
hybrid | pinned | Terms and semantic together, fused. Not a boolean pin. |
Boolean search
Connectors work in any searchType — under auto the router sees the operators and dispatches the boolean engine alongside anything else that applies, and every row on the page satisfies the expression whenever at least one case does. Pin searchType: "boolean" when you want the boolean engine only: no query rewriting, no concept matching, no curated landmarks, and every term required. The response's searchInfo.booleanOperatorsDetected confirms whether the parser actually saw connectors. A query with AND, OR, NOT, proximity, a field prefix or a wildcard runs on the boolean engine alone under auto. A sentence that only quotes a phrase still gets concept matching: when no case contains the phrase, auto returns related cases, each flagged connectorMatch: false.
auto connectors are uppercase. trust AND estate is a boolean instruction; trust and estate is three literal words. Under searchType: "boolean" lowercase and / or / not / but are connectors too (Terms & Connectors semantics). BUT NOT is one exclusion, the same as NOT and %. Phrases need double quotes. Proximity binds tighter than AND, so a AND b /s c means a AND (b /s c). Stemming is always on. A trailing ! is the root expander. * is exactly one character, not truncation. /s is within 25 words and /p is within 80 words. Those are word counts, not sentence or paragraph boundaries, because many opinions are PDFs converted to text. Full rules: /docs/search-connectors.curl -X POST https://lawdiver.com/api/v1/search \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "\"qualified immunity\" /s \"clearly established\" AND NOT prison",
"jurisdiction": { "type": "federal_circuit", "circuit": "11" },
"searchType": "boolean",
"limit": 10,
"filters": { "dateFrom": "2015-01-01" }
}'| Field | Type | Description |
|---|---|---|
AND or & | connector | Both terms anywhere in the opinion. A space is the same. Example: negligence AND causation, or negligence & causation. |
OR | connector | Either term. Loosest binding — group with parentheses when mixing with AND. Example: rescission OR cancellation. (battery OR assault) AND consent requires consent along with either offense. |
NOT, BUT NOT, or % | connector | Exclude opinions containing the next term, phrase, or group. NOT, BUT, BUT NOT, and % are the same exclusion. Example: immunity NOT prisoner, immunity BUT NOT prisoner, or immunity % prisoner. The exclusion stops at that operand, so immunity BUT NOT prisoner AND damages still requires damages. |
"exact phrase" | connector | Words in this order, adjacent, still stemmed. Example: "clearly established" also matches clearly establishes. #established is that spelling only. |
/s | proximity | Within 25 words, either order. Not a sentence-boundary test. Example: employer /s negligent. w/s is the same window. notice +s cure also requires notice first. |
/p | proximity | Within 80 words, either order. Not a paragraph-boundary test. Example: "forum non conveniens" /p factors. w/p and /seg are the same window. +p requires the left term first. |
w/N | proximity | Within N words. Example: summary w/3 judgment. /5 is the same as w/5. notice +5 cure is the same window with notice first. Maximum 255. |
term! | wildcard | Root expander. Example: unconscionab! matches unconscionable and unconscionability. Stemming already covers ordinary word forms. |
* | wildcard | Exactly one character. Example: dr*ve matches drive and drove, not driver. ? is the same mark. Not truncation — truncation is !. |
field:term | scope | Restrict the next term or phrase. Example: holdings:"clearly established". Fields: case_name, syllabus, headnotes, holdings, body. |
Jurisdiction
Eight choices. Some require a companion field, and the validation error will name it if you omit it. For the authoritative list of USPS state codes and examples, call GET /api/v1/jurisdictions. That response publishes the same codes under stateCodes and states[].code — use those values as jurisdiction.state (or jurisdiction.districtState) on the search request.
| Field | Type | Description |
|---|---|---|
all_states | — | Every state court, no federal courts. |
all_states_and_federal | — | Everything. The broadest and slowest scope. |
all_federal | — | Every federal court, including the Supreme Court. |
one_state | + state | That state's own courts only. Requires jurisdiction.state, a USPS code such as "FL" (same values as stateCodes / states[].code from GET /api/v1/jurisdictions). |
one_state_plus_federal | + state | The state's courts, its regional circuit, and the U.S. Supreme Court — what a practitioner in that state actually cites. Requires jurisdiction.state. |
federal_circuit | + circuit | One circuit plus the Supreme Court. Requires circuit: "1"–"11", "dc", or "federal". |
federal_district | + districtState | The federal district courts sitting in a state. Requires districtState, e.g. "TX" for the districts of Texas. |
us_supreme_court | — | The U.S. Supreme Court alone. |
Example
curl -X POST https://lawdiver.com/api/v1/search \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "qualified immunity excessive force",
"jurisdiction": { "type": "federal_circuit", "circuit": "11" },
"limit": 5,
"filters": { "dateFrom": "2015-01-01" },
"include": { "caseCard": true, "opinionText": true, "goodLawReport": true },
"opinionTextMaxChars": 10000
}'Response
{
"results": [
{
"caseId": "4218873",
"caseName": "Smith v. City of Miami",
"citation": "812 F.3d 1234",
"bluebookCitation": "Smith v. City of Miami, 812 F.3d 1234 (11th Cir. 2016)",
"parallelCitations": ["2016 WL 123456"],
"court": "United States Court of Appeals for the Eleventh Circuit",
"courtAbbreviation": "11th Cir.",
"jurisdiction": "Eleventh Circuit",
"dateFiled": "2016-02-11",
"year": 2016,
"published": true,
"citedByCount": 74,
"snippet": "...the officers' use of force was not objectively reasonable...",
"snippetSource": "parenthetical",
"opinionType": "majority",
"goodLaw": {
"status": "good",
"negative": false,
"unknown": false,
"negativeTreatmentCount": 0,
"basis": "No negative treatment among 74 citing opinions.",
"computedAt": "2026-08-01T12:00:00.000Z",
"negativeCitations": []
},
"caseCard": {
"summaryAi": "The Eleventh Circuit held that…",
"posture": "Appeal from summary judgment",
"standardOfReview": "de novo",
"disposition": "Affirmed",
"issuesPresented": ["Whether force was objectively reasonable"],
"holdings": [{ "issue": "Excessive force", "holding": "…", "pinCite": "1241" }],
"keyQuotations": [{ "quote": "…", "pinCite": "1241" }],
"courtSyllabus": null
},
"opinion": {
"mode": "excerpts",
"text": "…objectively reasonable under the Fourth Amendment…",
"charCount": 8420,
"sourceCharCount": 48210,
"truncated": true
},
"matchExplanation": [
"Search terms found in case name, syllabus or holdings: qualified, immunity, excessive, force",
"Similar in substance to the concept searched (no keyword overlap required)",
"Found by 2 independent search methods",
"Cited by 74 later cases"
],
"retrievalUrl": "https://lawdiver.com/api/v1/cases/4218873/pdf"
}
],
"total": 1,
"totalAvailable": 46,
"degraded": false,
"warning": null,
"searchInfo": {
"enginesUsed": ["keyword", "semantic"],
"jurisdictionLabel": "the 11th Circuit and the U.S. Supreme Court",
"citationsDetected": [],
"liftedPhrases": [],
"booleanOperatorsDetected": false,
"bodyTextSearchUnavailable": false,
"degraded": false,
"engineErrors": [],
"latencyMs": 412
},
"suggestion": null,
"usage": { "operation": "case_search", "quantity": 1, "breakdown": { "cases": 1 } },
"requestId": "req_Ab3xK9pQ"
}| Field | Type | Description |
|---|---|---|
total vs totalAvailable | integer | total is the number of rows in this response. totalAvailable is the size of the fused candidate pool after cluster collapse (engine-capped, typically a few hundred at most) — not a corpus-wide hit count. Raising limit cannot reveal more than this pool. |
bluebookCitation / parallelCitations | string | string[] | bluebookCitation is the preferred Bluebook form when known; parallelCitations lists other locators on file for the same decision. |
degraded | boolean | Top-level copy of searchInfo.degraded. Check this before treating results: [] as proof the corpus has no matches — when true, one or more search engines failed (timeout / budget). The call is still one search. |
warning | string | null | Set when degraded is true. Empty results plus a warning means an outage, not a genuine empty corpus hit. The call is still one search. |
matchExplanation | string[] | Ordered reasons this row matched (citation, name, keyword, semantic, authority, good-law). An array, not a single string. |
opinionType | string | majority | dissent | concurrence | per_curiam | other. Separate opinions are collapsed to the lead for display; matchExplanation notes when a dissent or concurrence was what matched. |
goodLaw.unknown | boolean | True means treatment has not been determined — not that the case is good. Never present it to a user as a clean bill of health. |
goodLaw.negativeCitations | array | Present when include.goodLawReport is on (the default): citing cases with treatments such as overruled, questioned, or limited. Empty when none were found. |
caseCard | object | null | Present only when include.caseCard is true. The analysis card when it exists; null when the opinion has not been analysed yet. |
opinion | object | null | Present only when include.opinionText is true. mode is full or excerpts; truncated is true when the source was longer than the budget. |
snippet / snippetSource | string | null | snippet is the passage that made the case relevant (or null when none exists). snippetSource is parenthetical | court_syllabus | summary_ai | opinion_body | null. |
retrievalUrl | string | A ready-made link to the case PDF. |
searchInfo.enginesUsed | string[] | Engines that completed without error for this request — not the planned router set. |
searchInfo.booleanOperatorsDetected | boolean | True when the parser found connectors (AND, OR, NOT, quotes, /s, /p, w/N, field:) in the query. False means the query ran as plain terms — usually because a connector was lowercase. |
outcome | string | hits, empty (the search ran and matched nothing) or degraded_empty (an engine failed, so the empty list proves nothing; retry). |
searchInfo.citationStatus | string | Present when the query contained a reporter citation. found, out_of_scope (the case exists in a court outside jurisdiction; its id is in searchInfo.citationMatches), not_in_corpus, or engine_error. |
searchInfo.queryRelaxed | object | Present when the query as typed matched nothing and a looser form produced the results. kind is connectors_loosened, phrase_loosened or simplified; query is the form that ran. Never set on a pinned searchType. |
searchInfo.unsupportedQuery | string | opinion_author when the query is an "Opinion by Judge X" search. There is no index of writing judges; the words are matched as text only. |
connectorMatch | boolean (row) | Present and false only when no case matched your connectors and auto kept a related case (such as a curated landmark) so the page is not empty. Absent means the row satisfied the expression. Never present under searchType: "boolean". |
searchInfo.bodyTextSearchUnavailable | boolean | True when keyword recall covered case names, syllabi, and holdings only because a full-text index was unavailable. Explains an unexpectedly thin result set. |
searchInfo.degraded | boolean | Same as top-level degraded. True when at least one search engine timed out or failed. An empty result set with degraded true is an outage, not proof that no matching case exists. |
searchInfo.engineErrors | array | Engines that failed, each with engine, code (timeout | unavailable | query_rejected | unknown), and message. Budget-wall stops classify as timeout. Empty when the search completed cleanly. |
suggestion | string | null | Present only on an empty result set — a broader query worth trying instead. |
Jurisdictions
/api/v1/jurisdictionsRequires API keyAuthoritative list of jurisdiction types, circuit ids, USPS state codes, and example payloads for search. Call this instead of hard-coding state codes. Request field jurisdiction.state (and districtState) takes a value from stateCodes or states[].code in this response.
curl -H "Authorization: Bearer YOUR_KEY" \
https://lawdiver.com/api/v1/jurisdictions{
"types": ["all_states", "one_state", "one_state_plus_federal", "…"],
"circuits": ["1", "2", "…", "dc", "federal"],
"stateCodes": ["AL", "AK", "…", "WY"],
"states": [{ "code": "FL", "name": "Florida" }, "…"],
"examples": [
{ "type": "all_states_and_federal" },
{ "type": "one_state", "state": "TX" },
{ "type": "federal_circuit", "circuit": "5" },
{ "type": "us_supreme_court" }
]
}Cite check — a citation
/api/v1/citecheck/citeChecks whether a citation resolves to a real authority, returns the correct Bluebook form when known, and — for cases — reports good-law status. The same request shape accepts reporter case cites, federal/state statutes and court rules (including C.F.R.), and specialty administrative citations (IRS tax authorities). Send citation for one, or citations for up to 50 in a single call.
Request body
| Field | Type | Description |
|---|---|---|
citation | string | One citation, as written (max 500 characters). A case name works too. Blank or overlong values return a per-row error verdict instead of rejecting the request. |
citations | string[] | Up to 50 citations in one call (each max 500 characters). Sync cite checking handles standard reporter citations, vendor citations (Westlaw/Lexis), public-domain formats (e.g. Ohio, Illinois, New Mexico, Utah), statutes, C.F.R., court rules, and specialty administrative forms (tax). Subsequent-history compounds and semicolon string cites may expand into more than one result row per input (up to 100 check units total). For batches containing mostly unresolvable citations, keep sync batches smaller. Prefer POST /citecheck/document for large briefs or heavily unresolvable sets. |
Supply exactly one of the two. Beyond 50 citations, use the document endpoint — it is asynchronous and paces itself rather than holding a connection open. Sync cite batches apply a ~15s soft-lookup budget after an exact-only first pass (overall sync wall ~20s); timed-out rows return verdict error with lookupStatus: deadline_exceeded and record quantity 0. One blank, overlong, or otherwise invalid element returns an error row for that element and still checks the rest of the batch — it does not fail the whole request.
inputIndex (with unitIndex 0 for the primary authority). results.length may exceed the number of citations you sent. Always match on inputIndex, not array position. citationAsSent echoes the exact input string. usage.quantity counts completed expanded units, so compounds can record more units than the input count.Verdicts
| Field | Type | Description |
|---|---|---|
valid | verdict | The citation resolves cleanly. correctedCitation carries proper Bluebook form. Usually one candidate is returned, but parallel reporters that both resolve can yield more than one — always inspect candidates rather than assuming candidates[0] is the only match. Use POST /api/v1/cases/retrieve when you need an explicit pick. For statutes and regulations, valid means the section exists and no subsection/pin was written (or the pin itself was verified). |
section_verified | verdict | A statute or regulation section number was confirmed against a held corpus or official source, but a written subsection or pin (for example § 158(a)(1)) was not verified. Do not treat this as proof the pin exists.correctedCitation is null so the as-written pin is not silently truncated. |
name_mismatch | verdict | The reporter citation resolves to a real case, but the party names, year, or court as written differ from that case (including regional reporters cited to the wrong state). The resolved candidate is still returned so you can verify the citation against the linked case. |
page_mismatch | verdict | The reporter citation names a real case, but the written page is wrong for that decision: an interior pin used as the first page, a near-first-page typo, or a comma pincite past the end of the opinion's reporter-page span. correctedCitation supplies the proper first-page form; do not treat the as-written pin as confirmed. |
likely_valid | verdict | Up to three candidates, and deliberately no pick. Two common causes: (1) candidates found by name or partial signal while the citation as written keys to none of them (transposed volume, wrong page, or a reporter that does not match the key); (2) an exact reporter-key hit whose Bluebook form diverges sharply from the as-written locator (for example a WL cite that resolves to a U.S. Reports parallel) — a Possible Match where the citation is right but you must verify. correctedCitation is null in both cases. |
implausible | verdict | The reporter series or volume cannot exist (for example a volume above the published ceiling). Strong evidence of fabrication. See structured coverage. |
not_in_corpus | verdict | We searched a range or specialty family we hold and found no match (including a recognized Rev. Rul. form with no row yet). Actionable for integrators, but still not proof of fabrication — see corpusCaveat, coverage, and authorityCoverage. |
not_covered | verdict | We do not hold (or cannot yet search) this range, or the input was unparseable. Absence is evidence of nothing. |
unverified | verdict | No source available that could confirm or deny this authority (for example an unmirrored statute family, or a specialty lookup that failed internally). |
error | verdict | This one citation could not be checked (including sync soft-lookup deadline). Reported explicitly rather than omitted, because an omitted row reads as "checked and fine". Error rows are excluded from usage.quantity. |
likely_valid no candidate is chosen for you. Quietly rewriting a citation to a case the author never read is the worst thing a cite checker can do, so the choice stays with you. Present the candidates; let a human pick.implausible is the strong fabrication signal. not_in_corpus means we looked in a range we hold and finished that search with no match. A soft-lookup timeout is never absence — it returns error with lookupStatus: deadline_exceeded so you can retry. not_covered means we cannot speak to that range. Use structured coverage rather than treating every miss as fabricated.Example
curl -X POST https://lawdiver.com/api/v1/citecheck/cite \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"citations":["570 U.S. 744","999 F.3d 1"]}'{
"results": [
{
"inputIndex": 0,
"unitIndex": 0,
"role": "primary",
"citationAsSent": "570 U.S. 744",
"citationAsWritten": "570 U.S. 744",
"verdict": "valid",
"lookupStatus": "completed",
"correctedCitation": "United States v. Windsor, 570 U.S. 744 (2013)",
"explanation": "This citation resolves to a case in the corpus.",
"corpusCaveat": null,
"reporterKeys": ["us/570/744"],
"candidates": [
{
"caseId": "2812209",
"caseName": "United States v. Windsor",
"bluebookCitation": "United States v. Windsor, 570 U.S. 744 (2013)",
"citation": "570 U.S. 744",
"parallelCitations": ["133 S. Ct. 2675", "186 L. Ed. 2d 808", "2013 WL 3196928"],
"knownCitations": [
{ "cite": "570 U.S. 744", "kind": "reporter", "preferred": true, "matched": true },
{ "cite": "133 S. Ct. 2675", "kind": "reporter", "preferred": false, "matched": false },
{ "cite": "186 L. Ed. 2d 808", "kind": "reporter", "preferred": false, "matched": false },
{ "cite": "2013 WL 3196928", "kind": "westlaw", "preferred": false, "matched": false }
],
"court": "Supreme Court of the United States",
"year": 2013,
"published": true,
"citedByCount": 1204,
"goodLaw": { "status": "good_law", "negative": false, "unknown": false },
"matchedBy": "reporter_key",
"confidence": 1,
"retrievalUrl": "https://lawdiver.com/api/v1/cases/2812209/pdf"
}
]
}
],
"usage": { "operation": "citecheck_cite", "quantity": 2, "breakdown": { "citations": 2, "errors": 0 } },
"requestId": "req_Ab3xK9pQ"
}| Field | Type | Description |
|---|---|---|
lookupStatus | enum | Per-row soft-lookup outcome: completed, deadline_exceeded, skipped_budget, or failed. Soft timeouts and budget skips are never silent absences — pair with verdict / explanation. |
knownCitations | object[] | Every known locator for the found case (reporter, Westlaw, Lexis, neutral, docket/case number). Each entry has cite, kind, preferred (used in the Bluebook form), and matched (true when the as-written citation matches that locator). |
matchedBy | enum | How the candidate was found: reporter_key, case_name, volume_page_near, or docket_number. |
confidence | number | 0–1. Exactly 1 only for a reporter-key match. |
reporterKeys | string[] | The reporter citations parsed out of your input. Empty means the string was not a citation at all, which is itself useful feedback. |
explanation | string | Plain language, safe to show a user verbatim. |
Cite check — specialty authorities
The same POST /api/v1/citecheck/cite (and MCP check_citation) path also verifies specialty administrative citations against LawDiver's held corpora. No extra parameter is required: send the citation string as written. Recognized specialty forms are resolved before the statute and case ladders, so they never fall through to a false case miss.
POST /api/v1/search.Accepted input forms
| Field | Type | Description |
|---|---|---|
Tax (IRS) | examples | Rev. Rul. 2024-9, Rev. Proc. 2021-33, Notice 2014-21, T.D. 9847, PLR 202637011, TAM 200043005, CCA 201512017, and related IRB / written-determination spellings. Keys look like tax:rev_rul:2024-9. |
How to read the output
Specialty hits use the same result row shape as case checks, with three important differences: candidates and reporterKeys are always empty arrays, and identity lives on authorityCoverage instead of a case candidate. Branch on verdict first, then read authorityCoverage.authorityKey when present.
| Field | Type | Description |
|---|---|---|
verdict: valid | meaning | A row was found in the specialty corpus. correctedCitation is the stored Bluebook form when it differs from your input; explanation names the authority type (for example "Revenue Ruling found in LawDiver's tax authority corpus."). |
verdict: not_in_corpus | meaning | The cite was recognized as a held specialty family, but no matching row exists yet. Treat as a harvest gap or a fabricated number — not as "we never check this family." |
verdict: unverified | meaning | The form was recognized but the lookup could not complete (for example an internal error). Retry; do not treat as absence. |
authorityCoverage | object | Present on specialty (and statute/rule) rows. label is the Bluebook or type label; authorityType is the non-case bucket (specialty rows use regulation); authorityKey is the stable corpus key (for example tax:rev_rul:2024-9); outsideCoverage is true only when verdict is unverified. |
candidates / reporterKeys | empty | Always [] for specialty and statute rows. Do not require a case candidate to treat the row as successful — check verdict and authorityCoverage. |
Example
curl -X POST https://lawdiver.com/api/v1/citecheck/cite \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"citations":["Rev. Rul. 2024-9","Release No. 34-106389"]}'{
"results": [
{
"inputIndex": 0,
"unitIndex": 0,
"role": "primary",
"citationAsSent": "Rev. Rul. 2024-9",
"citationAsWritten": "Rev. Rul. 2024-9",
"verdict": "valid",
"lookupStatus": "completed",
"correctedCitation": null,
"explanation": "Revenue Ruling found in LawDiver's tax authority corpus.",
"corpusCaveat": null,
"reporterKeys": [],
"candidates": [],
"authorityCoverage": {
"label": "Rev. Rul. 2024-9",
"outsideCoverage": false,
"authorityType": "regulation",
"authorityKey": "tax:rev_rul:2024-9"
}
}
],
"usage": { "operation": "citecheck_cite", "quantity": 3, "breakdown": { "citations": 3, "errors": 0 } },
"requestId": "req_Ab3xK9pQ"
}valid row intentionally has no caseId. Persist authorityCoverage.authorityKey if you need a stable id, and show explanation / correctedCitation to users the same way you would a case hit.Cite check — a document
/api/v1/citecheck/documentAsync — returns a job idUpload a brief or memo as multipart/form-data with a file field. Case citations, statutes, C.F.R., court rules, and specialty administrative citations (tax) are extracted and checked. The result is a report PDF listing each citation with its verdict — with the first page of each case found appended as an exhibit.
PDF, .docx, and .doc are accepted, up to 40 MB. The call returns a job id immediately; a 60-page brief takes 30–120 seconds, which is longer than any load balancer will hold a connection. If object storage or the job queue is down, the upload returns service_unavailable.
1. Upload
| Field | Type | Description |
|---|---|---|
file | file | Required. PDF or Word document (multipart field). |
delivery | "poll" | "email_link" | Optional. Default poll. Set email_link to email recipients a secure link to the interactive results page when the check finishes. Supplying any emails / email also selects email_link. |
emails | string | string[] | One or more recipient addresses (repeat the field, or comma/semicolon-separated). Required when delivery=email_link. Max 10 unique addresses. Each recipient gets the same results link. |
email | string | Alias for a single address; merged into the same recipient list as emails. |
curl -X POST https://lawdiver.com/api/v1/citecheck/document \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-F "[email protected]"curl -X POST https://lawdiver.com/api/v1/citecheck/document \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-F "[email protected]" \
-F "delivery=email_link" \
-F "[email protected]" \
-F "[email protected]"{
"jobId": "9f2c1a44-8e7b-4d2a-9c15-6b0e3f7a1d88",
"status": "queued",
"fileName": "brief.pdf",
"fileSize": 1841204,
"delivery": "email_link",
"emails": ["p***@firm.com", "a***@firm.com"],
"resultsUrl": "https://lawdiver.com/cc/e/v1.eyJlbmMiOiJBMjU2R0NNIn0....",
"message": "Cite check queued.",
"statusUrl": "https://lawdiver.com/api/v1/citecheck/jobs/9f2c1a44-.../",
"reportUrl": "https://lawdiver.com/api/v1/citecheck/jobs/9f2c1a44-.../report",
"pollAfterSeconds": 5,
"requestId": "req_Ab3xK9pQ"
}delivery=email_link (or any emails are supplied), LawDiver emails each recipient a link to the cite-check results webpage after the job completes. The URL is opaque and expires in 7 days. Polling and the PDF report remain available on the same job.200, not 202: the state lives in the status field so one code path handles queued, processing, and completed.2. Poll
/api/v1/citecheck/jobs/:idPoll every 2–5 seconds until status is completed or failed. The status response also carries the full per-citation findings, so you can render your own UI instead of the PDF if you prefer. Until the job finishes, counts, citations, otherAuthoritiesFound, and reportUrl are null (not omitted). Specialty and statute rows in citations use the same shape as the sync cite endpoint, including authorityCoverage. When email delivery was requested, status also includes masked emails, resultsUrl, and emailSentAt.
{
"jobId": "9f2c1a44-8e7b-4d2a-9c15-6b0e3f7a1d88",
"status": "completed",
"fileName": "brief.pdf",
"pageCount": 34,
"citationCount": 41,
"counts": {
"valid": 34, "likelyValid": 3, "nameMismatch": 0, "notFound": 2, "notCheckable": 2, "errors": 0,
"byVerdict": { "valid": 34, "likely_valid": 2, "section_verified": 1, "not_in_corpus": 2, "unverified": 2 }
},
"otherAuthoritiesFound": 7,
"citations": [ /* one entry per citation, same shape as the cite endpoint */ ],
"quotes": [
{
"quote": "A notice of appeal must be filed within 60 days after entry of the judgment.",
"citation": "Smith v. Jones, 123 F.3d 456",
"status": "wording_differs",
"grade": "possible",
"sourceExcerpt": "A notice of appeal must be filed within 30 days after entry of the judgment.",
"differences": ["number differs: "30" in the source, "60" in the quote"],
"notes": [],
"pin": null,
"origin": "inline",
"docCharStart": 18422,
"docCharEnd": 18499,
"caseId": "cd_1a2b3c",
"bluebookCitation": "Smith v. Jones, 123 F.3d 456 (9th Cir. 1997)"
}
],
"quoteStats": { "quotesFound": 22, "quotesChecked": 22, "truncated": false, "errors": 0 },
"reportUrl": "https://lawdiver.com/api/v1/citecheck/jobs/9f2c1a44-.../report",
"resultsUrl": "https://lawdiver.com/cc/e/v1.eyJlbmMiOiJBMjU2R0NNIn0....",
"emails": ["p***@firm.com"],
"emailSentAt": "2026-08-13T14:03:05.000Z",
"error": null,
"createdAt": "2026-08-13T14:02:11.000Z",
"startedAt": "2026-08-13T14:02:12.000Z",
"completedAt": "2026-08-13T14:03:04.000Z"
}| Field | Type | Description |
|---|---|---|
status | enum | queued, processing, completed, or failed. |
otherAuthoritiesFound | integer | Count of extracted spans that are not cite-checked (for example internal source tags). Statutes, rules, and specialty administrative cites are checked and appear in citations with authorityCoverage — they are not counted here. |
counts | object | Roll-up counters. notFound counts citations in a range LawDiver holds (or that cannot exist). notCheckable counts authorities no source can confirm, which is not the same as not found. byVerdict is the exact count per verdict. |
quotes | array | null | Each quotation attributed to a cited authority, compared word for word with that authority. status is verified, wording_differs, not_found_in_source, unconfirmed, or not_checked. differences says what changed (a number, a negation, a dropped clause). Quote checks are not billed. null means the quote check did not run; an empty array means no attributed quotation was found. |
error | string | null | Why the job failed, when status is failed. |
3. Download the report
/api/v1/citecheck/jobs/:id/reportReturns application/pdf: a cover page with the tally, one entry per citation with its verdict and correct Bluebook form, and the first page of each case found appended behind it. Fetch it as many times as you like once the job has completed.
not_found, because a cite-checked brief is privileged work product.Citation resolve
/api/v1/citations/resolveMaps a cite or case name to up to five candidate cases without delivering a PDF. Use this when you need candidates only; use POST /api/v1/cases/retrieve when you want the did-you-mean / deliver flow in one product surface. Recorded at quantity 0 (free). Soft lookup deadlines surface as service_unavailable, not as a confident miss.
curl -X POST https://lawdiver.com/api/v1/citations/resolve \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"410 U.S. 113"}'| Field | Type | Description |
|---|---|---|
queryrequired | string | A citation or case name, 2–500 characters. |
{
"verdict": "valid",
"correctedCitation": "Roe v. Wade, 410 U.S. 113 (1973)",
"explanation": "This citation resolves to a case in the corpus.",
"candidates": [
{
"caseId": "…",
"caseName": "Roe v. Wade",
"citation": "410 U.S. 113",
"bluebookCitation": "Roe v. Wade, 410 U.S. 113 (1973)",
"court": "Supreme Court of the United States",
"year": 1973,
"confidence": 1,
"matchedBy": "reporter_key",
"pdfUrl": "https://lawdiver.com/api/v1/cases/…/pdf"
}
],
"usage": { "operation": "case_retrieval", "quantity": 0, "breakdown": { "cases": 0 } },
"requestId": "req_Ab3xK9pQ"
}Case retrieval
/api/v1/cases/retrieveResolves a citation or a case name to one case. Three outcomes, all of them 200: an unambiguous hit, a did-you-mean list, or nothing found.
Request body
| Field | Type | Description |
|---|---|---|
queryrequired | string | A citation (410 U.S. 113) or a case name (Roe v. Wade). Both go to the same resolver. |
caseId | string | Your answer to a previous did-you-mean. Supplying it skips resolution and delivers that case. Must be an opinion id (not a cluster id). |
Outcomes
| Field | Type | Description |
|---|---|---|
ok | status | Exactly one case matched unambiguously. case holds it, case.pdfUrl links to the PDF. |
did_you_mean | status | Up to three candidates. Also returned when a citation is valid but two parallel reporters both resolved — delivering the wrong one of two cases is worse than asking. |
not_found | status | Nothing matched. corpusCaveat may explain that the case could exist but not yet be loaded. |
The did-you-mean round trip
curl -X POST https://lawdiver.com/api/v1/cases/retrieve \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"Smith v. Jones"}'{
"status": "did_you_mean",
"message": "More than one case could match... Choose one and call this endpoint again with its `caseId`.",
"candidates": [
{
"caseId": "1183422",
"caseName": "Smith v. Jones",
"bluebookCitation": "Smith v. Jones, 421 So. 2d 1024 (Fla. 1982)",
"year": 1982,
"confidence": 0.82,
"matchedBy": "case_name",
"pdfUrl": "https://lawdiver.com/api/v1/cases/1183422/pdf"
}
],
"usage": { "operation": "case_retrieval", "quantity": 0 },
"requestId": "req_Ab3xK9pQ"
}curl -X POST https://lawdiver.com/api/v1/cases/retrieve \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"Smith v. Jones","caseId":"1183422"}'The second call returns status: "ok". Answering stays on the same endpoint so the two-step conversation does not force you to switch routes mid-flow.
Statute retrieval
/api/v1/statutes/retrievePulls the full text of a statute, regulation, or court-rule section when you supply a proper Bluebook citation with a section number (or an authorityKey from cite-check). Cite-check confirms whether a section exists; this endpoint delivers the body.
42 U.S.C. § 1983, Fla. Stat. § 768.81, Cal. Civ. Code § 1714, or Fed. R. Civ. P. 12. Bare words without a section number cannot be keyed. Specialty administrative forms (Rev. Rul.) stay on POST /citecheck/cite.Request body
| Field | Type | Description |
|---|---|---|
query | string | Bluebook citation with a section number (2–500 characters). Required unless you supply authorityKey. |
authorityKey | string | Stable key from cite-check authorityCoverage.authorityKey (for example st:federal:usc-42:1983). Required unless you supply query. |
year | number | Optional preferred code edition year (1900–2100) when the publisher or mirror is year-versioned. |
Outcomes
| Field | Type | Description |
|---|---|---|
ok | status | Section body delivered in statute.body. Records one retrieval unit. |
not_found | status | We searched a held corpus (or official source) and found no such section. Records no unit. |
unavailable | status | Identity may be confirmed, but full text is not pullable yet (publisher timeout, identity-only closed set, or empty body). Records no unit. |
not_a_statute | status | The string is not a parseable statute / regulation / rule citation (or is a specialty form). Records no unit. Use case retrieve or cite-check instead. |
curl -X POST https://lawdiver.com/api/v1/statutes/retrieve \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: statute-1983-001" \
-d '{"query":"42 U.S.C. § 1983"}'{
"status": "ok",
"message": "Statute section delivered.",
"query": "42 U.S.C. § 1983",
"citationAsWritten": "42 U.S.C. § 1983",
"verdict": "valid",
"statute": {
"authorityKey": "st:federal:usc-42:1983",
"kind": "statute",
"bluebook": "42 U.S.C. § 1983",
"heading": "Civil action for deprivation of rights",
"body": "Every person who, under color of any statute…",
"bodyChars": 1842,
"edition": "2024",
"officialUrl": "https://www.govinfo.gov/…",
"jurisdiction": "federal",
"section": "1983",
"verifiedBy": "mirror"
},
"usage": { "operation": "statute_retrieval", "quantity": 1, "breakdown": { "statutes": 1 } },
"requestId": "req_Ab3xK9pQ"
}Supports Idempotency-Key the same way as case retrieve. Coverage follows the mirrored and on-demand statute families CiteCheck already verifies — federal U.S.C. / C.F.R. and wired state codes.
Case metadata
/api/v1/cases/:idReturns case metadata (no PDF body). :id may be an opinion id or a decision id — unlike retrieve and PDF, which take the opinion id only. In the response, caseId is the opinion id and decisionId (also returned under the legacy name clusterId) identifies the decision every opinion in the case belongs to. The same two ids come back from /good-law and /cited-by, and any of these endpoints accepts either one as :id.
curl https://lawdiver.com/api/v1/cases/2812209 \
-H "Authorization: Bearer $LAWDIVER_API_KEY"Case batch
/api/v1/cases/batchLookup metadata for up to 50 case ids in one call. Response includes cases for those found and notFound for ids that did not resolve. Each id may be an opinion id or a decision id, same as GET /api/v1/cases/:id.
curl -X POST https://lawdiver.com/api/v1/cases/batch \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"caseIds":["2812209","1183422"]}'Good-law detail
/api/v1/cases/:id/good-lawGood-law status for a case plus negativeCitations (negative treatment among citing opinions). caseId and decisionId match the values GET /api/v1/cases/:id returns for the same case.
curl https://lawdiver.com/api/v1/cases/2812209/good-law \
-H "Authorization: Bearer $LAWDIVER_API_KEY"Goodlaw check
/api/v1/cases/:id/goodlaw-checkLists cases that cite this one, each with a citation status (overruled, questioned, followed, cited, and the rest of the treatment vocabulary). When no treatment was recorded, status is not adverse. An explicit cited stays cited. :id may be an opinion id or a decision id. Resolve a reporter cite with POST /api/v1/citations/resolve or POST /api/v1/cases/retrieve first, then pass the returned caseId. A completed check records one unit. A missing case records none. A heavy unlimited list can return service_unavailable after the same soft deadline as cited-by — retry with limit=100. That timeout records no unit.
Query parameters
| Field | Type | Description |
|---|---|---|
limit | 10 | 50 | 100 | unlimited | How many citing case names to return, including the pinned rows below. Default 10. Other values are invalid_request. |
order | recent | negative | recent (default) fills the rest of the list with the newest citing cases. negative fills it with negative treatments only (overruled, reversed, vacated, abrogated, superseded, questioned, criticized, limited, distinguished), newest first. |
Order of citingCases
Two rows are pinned before order applies, and a case is never listed twice:
1. The newest reversal, when one exists. A reversal is a citing case whose treatment is in the overruling family (overruled, reversed, vacated, abrogated, superseded, including overruled_in_part). status is still that verb, and pin is reversal.
2. The newest citing case, any treatment. If there is no reversal, this is the first row (pin mostRecent). If the newest cite is the reversal, it stays first only. On order=negative this row stays even when its status is not adverse.
total is the stored citing-case count for recent, and the number of citing cases with a negative treatment for negative. citingCaseId is the public opinion id of the citing case.
curl "https://lawdiver.com/api/v1/cases/2812209/goodlaw-check?limit=10&order=recent" \
-H "Authorization: Bearer $LAWDIVER_API_KEY"{
"caseId": "2812209",
"order": "recent",
"limit": "10",
"total": 8421,
"citingCases": [
{
"citingCaseId": "123",
"caseName": "Dobbs v. Jackson Women's Health Organization",
"citation": "597 U.S. 215",
"dateFiled": "2022-06-24",
"status": "overruled",
"pin": "reversal"
}
],
"usage": { "operation": "goodlaw_check", "quantity": 1 },
"requestId": "req_Ab3xK9pQ"
}Cited by
/api/v1/cases/:id/cited-byCases that cite this one, paginated. Query params: limit (1–100, default 25) and offset (default 0). Heavy pages may return service_unavailable after a soft timeout — retry with a smaller limit.
curl "https://lawdiver.com/api/v1/cases/2812209/cited-by?limit=25&offset=0" \
-H "Authorization: Bearer $LAWDIVER_API_KEY"Opinion text
/api/v1/cases/:id/textFull opinion body as JSON for agents and MCP clients. Query params: offset (character offset, default 0), maxChars (default 100000, max 250000) and pageMarkers (default true). When opinion.truncated is true, call again with opinion.nextOffset until finished. The text is typeset the same way the case page is: running headers and gutter page numbers are removed, hyphenated line wraps rejoined, paragraphs separated by a blank line, and reporter star pages written inline as [*458] so you can pin-cite from the text. Pass pageMarkers=false to omit the markers. Search include.opinionText remains short excerpts for hit enrichment — use this endpoint when you need the whole case. A non-empty body slice records one retrieval unit.
curl "https://lawdiver.com/api/v1/cases/2812209/text?offset=0&maxChars=100000" \
-H "Authorization: Bearer $LAWDIVER_API_KEY"Case PDF
/api/v1/cases/:id/pdfReturns the opinion as a PDF with its processing material appended: metadata, the citation with parallel cites, good-law status with the basis for it, and the extracted analysis. This is the URL handed out as retrievalUrl and pdfUrl elsewhere in the API, so those links work directly in a browser. :id must be an opinion id.
curl -L https://lawdiver.com/api/v1/cases/2812209/pdf \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-o windsor.pdfResponse headers
A PDF body cannot carry the JSON usage envelope, so operation and unit counts travel in headers. Prefer X-LawDiver-*; X-LawTools-* is still emitted for older clients and CORS exposes both.
Content-Type: application/pdf
Content-Disposition: inline; filename="United States v. Windsor.pdf"
X-Request-Id: req_Ab3xK9pQ
X-LawDiver-Operation: case_retrieval
X-LawDiver-Charge-Units: 1
X-LawTools-Operation: case_retrieval
X-LawTools-Charge-Units: 1Idempotency-Key — store the bytes on your side when you need a safe retry, and re-fetch when currency matters.Usage
/api/v1/usageYour call volume by operation and the limits in force for your key (rateLimitPerMinute, dailyRequestLimit, maxCasesPerSearch).
curl "https://lawdiver.com/api/v1/usage?days=30" \
-H "Authorization: Bearer $LAWDIVER_API_KEY"{
"consumer": { "name": "Acme Legal", "email": "[email protected]", "status": "active" },
"periodDays": 30,
"since": "2026-07-14T00:00:00.000Z",
"byOperation": [
{ "operation": "case_search", "calls": 412, "units": 3180 },
{ "operation": "case_retrieval", "calls": 96, "units": 88 }
],
"limits": {
"rateLimitPerMinute": 60,
"dailyRequestLimit": 1000,
"maxCasesPerSearch": 50
},
"requestId": "req_Ab3xK9pQ"
}| Field | Type | Description |
|---|---|---|
days | query | Look-back window, 1–365, default 30. |
calls vs units | integer | Calls is requests made; units is work counted on the ledger (for search, one unit per completed call; for retrieval and cite-check, authorities or citations/pages). They differ when a call records several units or none. |
limits | object | Account ceilings: rateLimitPerMinute, dailyRequestLimit, and maxCasesPerSearch. |
This is also the fastest way to tell a connectivity problem from a credentials problem: if GET /api/v1 answers but GET /api/v1/usage returns invalid_api_key, the network is fine and the key is not.
Bulk upload
/api/v1/bulkAsync — one combined resultUpload a JSON file of ordinary API calls. The upload returns a job id immediately. When the job finishes, GET the result URL and you receive every call, in order, in one JSON document.
Bulk upload attempts every call 3 times before giving up. The second and third attempts run when the first one times out, returns a server error, or finishes as a degraded search. That retry is what raises the quality of a large run: a complex search that dies once under load often completes on the next try. Calls that are simply invalid, or that miss for real, are not repeated.
When usage on the API is low, bulk upload runs several calls at once. A quiet file can finish faster than sending the same calls one by one from your own loop. When usage is high, the same file runs one call at a time so it does not pile more work onto the load that is already causing timeouts. Each call inside the file is still a metered API call and still has the same completion deadline as a call you send yourself.
Upload
Send application/json with a requests array, or upload that same JSON as multipart field file. A top-level JSON array is accepted too. Paths may be /api/v1/search or the short form /search.
| Field | Type | Description |
|---|---|---|
requestsrequired | array | Ordered calls. The result document keeps this order. |
requests[].id | string | Your label for the row. Defaults to the index. |
requests[].methodrequired | GET | POST | The verb that endpoint already uses. |
requests[].pathrequired | string | Path, with an optional query string. |
requests[].query | object | Query parameters. Merged with any query string already on path. |
requests[].body | object | JSON body for POST. The same object you would send to that endpoint alone. |
requests[].idempotencyKey | string | Optional. Applied to the first attempt only. Later attempts re-run the work so a degraded or timed-out first answer is not replayed. |
curl -X POST https://lawdiver.com/api/v1/bulk \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"requests": [
{
"id": "immunity",
"method": "POST",
"path": "/api/v1/search",
"body": {
"query": "qualified immunity",
"jurisdiction": { "type": "federal_circuit", "circuit": "11" },
"limit": 5
}
},
{
"id": "cite",
"method": "POST",
"path": "/api/v1/citecheck/cite",
"body": { "citation": "570 U.S. 744" }
}
]
}'curl -X POST https://lawdiver.com/api/v1/bulk \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-F "[email protected];type=application/json"The upload response carries jobId, statusUrl, and resultUrl. Poll the status URL every few seconds. completedCount advances as calls finish.
One output
When status is completed, GET the result URL. The body is a single document: succeeded, failed, and results in upload order. Each row has your id, how many attempts ran (1–3), ok, the HTTP status, and the response that endpoint would have returned on its own.
{
"jobId": "…",
"status": "completed",
"requestCount": 2,
"succeeded": 2,
"failed": 0,
"maxAttempts": 3,
"results": [
{
"index": 0,
"id": "immunity",
"method": "POST",
"path": "/api/v1/search",
"attempts": 2,
"ok": true,
"httpStatus": 200,
"response": { "results": [ ], "requestId": "req_…" }
}
],
"requestId": "req_…"
}ok: true means the last attempt finished inside the time limit without a degraded search or a deadline. ok: false after 3 attempts means the call still timed out or errored; response is the last body received. Read it — a partial answer can still be there — and do not treat it as a clean miss.
not_found until the job is completed or failed. The status URL stays small. The result URL is the one output.Recipes
Cite check a document, end to end
Upload, poll, download. Note the polling ceiling: a job that never finishes must fail your code rather than loop forever. Wait until status === 'completed' before reading job.counts — until then those fields are null.
import { readFile } from 'node:fs/promises';
// 1. Upload
const form = new FormData();
form.append('file', new Blob([await readFile('brief.pdf')], { type: 'application/pdf' }), 'brief.pdf');
const started = await fetch(BASE + '/citecheck/document', {
method: 'POST',
headers: { Authorization: `Bearer ${KEY}` }, // no Content-Type: fetch sets the boundary
body: form,
}).then((r) => r.json());
// 2. Poll. 5s matches pollAfterSeconds; the cap turns a stuck job into an error.
let job = started;
for (let i = 0; i < 120 && (job.status === 'queued' || job.status === 'processing'); i++) {
await new Promise((r) => setTimeout(r, 5000));
job = await call(`/citecheck/jobs/${started.jobId}`);
}
if (job.status !== 'completed') throw new Error(`Cite check ${job.status}: ${job.error ?? 'timed out'}`);
console.log(`${job.citationCount} citations over ${job.pageCount} pages`, job.counts);
// 3. Download the report
const pdf = await fetch(`${BASE}/citecheck/jobs/${started.jobId}/report`, {
headers: { Authorization: `Bearer ${KEY}` },
}).then((r) => r.arrayBuffer());Email the cite-check results page
Pass delivery=email_link and one or more emails (repeat the field or comma-separate). Recipients receive a secure link to the interactive results webpage when the check finishes. Polling and the PDF report still work on the same job.
const form = new FormData();
form.append('file', new Blob([await readFile('brief.pdf')], { type: 'application/pdf' }), 'brief.pdf');
form.append('delivery', 'email_link');
form.append('emails', '[email protected]');
form.append('emails', '[email protected]');
const started = await fetch(BASE + '/citecheck/document', {
method: 'POST',
headers: { Authorization: `Bearer ${KEY}` },
body: form,
}).then((r) => r.json());
// resultsUrl is the same link emailed to every recipient (opaque, 7-day expiry).
console.log(started.delivery, started.resultsUrl, started.emails);Agent search: card + excerpts + good-law
One search call that returns enough for a tool-using model to reason: analysis card when present, opinion excerpts (or the full text under 10k characters), and the good-law report with negative-treatment evidence. Keep limit small when opinionText is on.
const found = await call<{
results: Array<{
caseName: string;
citation: string | null;
goodLaw: { status: string; negative: boolean; negativeCitations: unknown[] };
caseCard: { summaryAi: string | null } | null;
opinion: { mode: string; text: string } | null;
}>;
}>('/search', {
query: 'can a landlord withhold a deposit for ordinary wear and tear',
jurisdiction: { type: 'one_state_plus_federal', state: 'FL' },
limit: 5,
include: { caseCard: true, opinionText: true, goodLawReport: true },
opinionTextMaxChars: 10000,
});
for (const r of found.results) {
if (r.goodLaw.negative) console.warn('BAD LAW', r.caseName, r.goodLaw.status);
console.log(r.caseName, r.citation, r.caseCard?.summaryAi?.slice(0, 120));
}Retrieve a case, handling did-you-mean
Resolution can need two calls. When the first returns did_you_mean, present the candidates and call again with the chosen caseId.
let hit = await call<any>('/cases/retrieve', { query: 'Smith v. Jones' });
if (hit.status === 'did_you_mean') {
// Present hit.candidates to a human. Auto-picking the top candidate is a
// product decision — it can silently return a case nobody asked for.
const chosen = hit.candidates[0];
hit = await call<any>('/cases/retrieve', { query: 'Smith v. Jones', caseId: chosen.caseId });
}
if (hit.status === 'not_found') {
console.log('No match.', hit.corpusCaveat ?? '');
} else {
const pdf = await fetch(hit.case.pdfUrl, {
headers: { Authorization: `Bearer ${KEY}` },
}).then((r) => r.arrayBuffer());
}Pull a statute by section number
Cite-check confirms a statute exists; POST /statutes/retrieve returns the section body when you pass a Bluebook citation with a section number (or an authorityKey from cite-check).
const pulled = await call<any>('/statutes/retrieve', {
query: '42 U.S.C. § 1983',
});
if (pulled.status === 'ok') {
console.log(pulled.statute.heading, pulled.statute.bodyChars);
// pulled.statute.body — full section text
}Run a batch with bulk upload
Every API call has a completion deadline. When usage is high, a complex search can time out before it finishes. POST /api/v1/bulk takes a file of calls, attempts each one three times, and returns one JSON document when the job completes. When usage is low, the same file runs calls in parallel and can finish faster than a serial loop. See Bulk upload and Time limits.
const started = await call<any>('/bulk', {
requests: [
{
id: 'q1',
method: 'POST',
path: '/api/v1/search',
body: {
query: 'qualified immunity',
jurisdiction: { type: 'federal_circuit', circuit: '11' },
limit: 5,
},
},
{
id: 'cite',
method: 'POST',
path: '/api/v1/citecheck/cite',
body: { citation: '570 U.S. 744' },
},
],
});
let status = started;
while (status.status === 'queued' || status.status === 'processing') {
await new Promise((r) => setTimeout(r, (status.pollAfterSeconds ?? 5) * 1000));
status = await fetch(started.statusUrl, {
headers: { Authorization: `Bearer ${KEY}` },
}).then((r) => r.json());
}
const output = await fetch(started.resultUrl, {
headers: { Authorization: `Bearer ${KEY}` },
}).then((r) => r.json());
// output.results — one row per uploaded call, in order
console.log(output.succeeded, output.failed);Retry safely after a timeout
When a call times out you cannot tell whether it landed. On POST /search, POST /citecheck/cite, POST /cases/retrieve, and POST /statutes/retrieve, an idempotency key makes the retry return the original answer without re-running the work.
const key = `search-${crypto.randomUUID()}`; // one key per distinct request
async function withRetry<T>(path: string, body: unknown): Promise<T> {
for (let attempt = 0; attempt < 3; attempt++) {
try {
return await call<T>(path, body, key); // same key: at most one execution
} catch (err) {
if (attempt === 2) throw err;
await new Promise((r) => setTimeout(r, 1000 * 2 ** attempt));
}
}
throw new Error('unreachable');
}idempotency_conflict (409). PDF download and most other routes do not honour the header.Prefer the dedicated Python, examples, and GitHub sections below for runnable samples.
Python
A minimal requests session. Same auth header as TypeScript; raise on HTTP errors and read requestId from the JSON body when a call fails.
import os, requests
BASE = "https://lawdiver.com/api/v1"
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['LAWDIVER_API_KEY']}"
res = session.post(f"{BASE}/citecheck/cite", json={"citations": ["570 U.S. 744", "999 F.3d 1"]})
res.raise_for_status()
payload = res.json()
for item in payload["results"]:
print(item["citationAsWritten"], "->", item["verdict"])
if item["verdict"] == "likely_valid":
for cand in item["candidates"]:
print(" did you mean:", cand["bluebookCitation"])
print("units:", payload["usage"]["quantity"])Examples
Boolean search over federal opinions. Reuse the same Bearer key for every endpoint under /api/v1.
curl -X POST https://lawdiver.com/api/v1/search \
-H "Authorization: Bearer $LAWDIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "\"qualified immunity\" AND \"clearly established\"",
"jurisdiction": { "type": "all_federal" },
"searchType": "boolean",
"limit": 10
}'GitHub
Official client examples and a tester live in public repositories:
Support
Include the requestId from the failing response in any support request. It resolves to the exact log line and ledger row, which turns most questions into a one-look answer. For a higher rate limit or an additional key, ask — those are per-account settings rather than plan tiers.
Client examples and issue tracking live on #github.
MCP
The same API key authenticates the hosted Model Context Protocol server at https://lawdiver.com/mcp (Streamable HTTP). search_cases uses the same boolean grammar as POST /api/v1/search: NOT, BUT NOT, and % are one exclusion. Claude web and desktop also get interactive view_case / view_authority viewers for opinions, statutes, regulations, and court rules. Tool catalog: GET https://lawdiver.com/mcp/toolspec.json. Setup and client config: /products/mcp; Claude guide: /products/mcp/connect-claude. Discovery also lists POST /mcp on GET /api/v1. The check_citation tool shares the REST cite-check path, including specialty tax resolve — see Cite check — specialty authorities.