Skip to main content
Legal citations must be verified before use. This page covers all citation-related endpoints: parsing citations from text, extracting them from documents, verifying they exist, and retrieving full content.

Verify citations

Check if a citation refers to a real case. Essential for catching AI hallucinations.
Endpoint
POST /legal/v1/verify
const result = await client.legal.verify({
  text: 'The Court held in Bush v. Gore, 531 U.S. 98 (2000)...'
});

console.log(result.summary);
// { total: 1, verified: 1, notFound: 0, multipleMatches: 0 }

for (const citation of result.citations) {
  if (citation.status === 'verified') {
    console.log(`✓ ${citation.case.name}: ${citation.case.url}`);
  } else {
    console.log(`✗ ${citation.original}: not found`);
  }
}

Response

{
  "summary": {
    "total": 1,
    "verified": 1,
    "notFound": 0,
    "multipleMatches": 0
  },
  "citations": [
    {
      "original": "531 U.S. 98",
      "span": { "start": 32, "end": 43 },
      "status": "verified",
      "verificationSource": "courtlistener",
      "confidence": 1,
      "normalized": "531 U.S. 98",
      "case": {
        "id": 118365,
        "name": "Bush v. Gore",
        "shortName": "Bush",
        "court": "scotus",
        "dateDecided": "2000-12-12",
        "parallelCitations": ["121 S. Ct. 525", "148 L. Ed. 2d 388"],
        "url": "https://www.courtlistener.com/opinion/118365/bush-v-gore/"
      }
    }
  ]
}

Verification statuses

StatusMeaning
verifiedCitation matches a real case in CourtListener (~10M cases)
not_foundNo match found — likely hallucination or typo
multiple_matchesMultiple possible matches — review candidates array
Each citation also includes verificationSource and confidence. CourtListener returns confidence: 1.0, while heuristic fallback uses a score based on the source verification signals.

Parse citations from text

Extract and parse Bluebook components from citation text. Use when you have text and need structured citation data.
Endpoint
POST /legal/v1/citations
const result = await client.legal.citations({
  text: 'See Roe v. Wade, 410 U.S. 113 (1973), overruled by Dobbs v. Jackson, 597 U.S. 215 (2022).'
});

for (const citation of result.citations) {
  console.log(`${citation.normalized}`);
  console.log(`  Volume: ${citation.components.volume}`);
  console.log(`  Reporter: ${citation.components.reporter}`);
  console.log(`  Page: ${citation.components.page}`);
  console.log(`  Found: ${citation.found}`);
}

Response

{
  "citations": [
    {
      "original": "410 U.S. 113",
      "span": { "start": 17, "end": 29 },
      "components": {
        "caseName": "Roe v. Wade",
        "volume": 410,
        "reporter": "U.S.",
        "page": 113,
        "year": 1973,
        "court": "scotus"
      },
      "normalized": "410 U.S. 113",
      "found": true
    }
  ]
}

Extract citations from URL

Fetch a document and extract all citations from it. Use when you have a URL and want to analyze what it cites.
Endpoint
POST /legal/v1/citations-from-url
Key difference from citations: This endpoint fetches content from a URL and categorizes citations by type (cases, statutes, regulations). The citations endpoint parses text you provide and returns Bluebook components.
const result = await client.legal.citationsFromUrl({
  url: 'https://www.courtlistener.com/opinion/118365/bush-v-gore/'
});

console.log(`Total citations: ${result.totalCitations}`);
console.log(`Cases: ${result.citations.cases.length}`);
console.log(`Statutes: ${result.citations.statutes.length}`);
console.log(`Regulations: ${result.citations.regulations.length}`);

// Most-cited authorities
for (const cite of result.citations.cases.slice(0, 5)) {
  console.log(`${cite.citation} (${cite.count} times)`);
}

Response

{
  "url": "https://www.courtlistener.com/opinion/118365/bush-v-gore/",
  "title": "Bush v. Gore, 531 U.S. 98 (2000)",
  "totalCitations": 15,
  "citations": {
    "cases": [
      { "type": "usReporter", "citation": "478 U.S. 109", "count": 3 },
      { "type": "federalReporter", "citation": "772 F.2d 1444", "count": 1 }
    ],
    "statutes": [
      { "type": "usc", "citation": "3 U.S.C. § 5", "count": 2 }
    ],
    "regulations": []
  },
  "externalLinks": ["https://www.law.cornell.edu/uscode/text/3/5"]
}

Citation types

TypeDescriptionExample
usReporterUS Supreme Court531 U.S. 98
federalReporterFederal Circuit Courts123 F.3d 456
stateReporterState Courts123 Cal.App.4th 456
uscUS Code42 U.S.C. § 1983
cfrCode of Federal Regulations29 C.F.R. § 1910.134

Get full text

Retrieve the full content of a legal document with optional highlights and summary.
Endpoint
POST /legal/v1/full-text
const doc = await client.legal.fullText({
  url: 'https://www.courtlistener.com/opinion/118365/bush-v-gore/',
  highlightQuery: 'equal protection',
  maxCharacters: 50000
});

console.log(doc.title);
console.log(`Length: ${doc.characterCount} chars`);

// Relevant passages
for (const highlight of doc.highlights) {
  console.log(`> ${highlight}`);
}

Parameters

ParameterTypeDescription
urlstringURL of the legal document
maxCharactersnumberMax characters to return (1,000-50,000, default 10,000)
highlightQuerystringQuery to highlight relevant passages
summaryQuerystringQuery to generate a focused summary

Resolve jurisdictions

Convert jurisdiction names to IDs for filtering searches and verification.
Endpoint
POST /legal/v1/jurisdictions
const result = await client.legal.jurisdictions({ name: 'california' });

for (const j of result.jurisdictions) {
  console.log(`${j.name} (${j.id}) - ${j.level}`);
}
// California (california) - state

// Use in search
const cases = await client.legal.find({
  query: 'wrongful termination',
  jurisdiction: 'california'
});

Available jurisdictions

IDNameLevel
us-federalUS FederalFederal
us-scotusUS Supreme CourtFederal
californiaCaliforniaState
new-yorkNew YorkState
texasTexasState
All 50 statesState

Common patterns

Verify AI output before display

async function safeDisplayCitation(aiGeneratedText: string) {
  const result = await client.legal.verify({ text: aiGeneratedText });
  
  if (result.summary.notFound > 0) {
    // AI hallucinated — find a real alternative
    const search = await client.legal.find({ 
      query: extractTopic(aiGeneratedText) 
    });
    return { warning: 'Citation corrected', cases: search.candidates };
  }
  
  return { verified: true, citations: result.citations };
}

Build a citation checker

async function checkBrief(documentUrl: string) {
  // Extract all citations from the brief
  const extracted = await client.legal.citationsFromUrl({ url: documentUrl });
  
  // Verify each case citation
  const results = [];
  for (const cite of extracted.citations.cases) {
    const verification = await client.legal.verify({ text: cite.citation });
    results.push({
      citation: cite.citation,
      count: cite.count,
      verified: verification.summary.verified > 0
    });
  }
  
  return results;
}

Get full context for a verified citation

const verification = await client.legal.verify({ text: '531 U.S. 98' });

if (verification.citations[0].status === 'verified') {
  const fullDoc = await client.legal.fullText({
    url: verification.citations[0].case.url,
    highlightQuery: 'holding'
  });
  
  console.log(fullDoc.highlights); // Key passages about the holding
}