Patents and legal citations logo

Case-law precedent search (CourtListener, US)

$1.00 USDC per call · Legal and patents · POST /api/v1/precedent-search · Id precedent-search

Finds US court opinions most on point for a legal question or fact pattern: searches CourtListener's case-law index (optionally limited to courts and filing dates), reads the top opinions, and returns the best matches with a holding passage verified verbatim against the opinion text, plus citation, court, date, precedential status and a source hash. A second skeptical pass flags matches that look off point. It finds precedents for a question; it does not verify citations a brief already contains (use legal-cite-verifier for existence, name, year and quote checks). It is not a citator (no subsequent history or overruling check) and not legal advice. Coverage is limited to CourtListener's index; abstains with no_precedent_found rather than guessing.

What you get

Gets a researcher to a short list of on-point opinions with checkable quotes and source hashes in one call, instead of hours of keyword searching.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/precedent-search. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/precedent-search \
  -H 'content-type: application/json' \
  -d '{"question":"Does a warrantless search of a cell phone seized incident to a lawful arrest violate the Fourth Amendment?","courts":["scotus","ca9"],"max_results":3}'

Input

FieldTypeRequiredDescription
questionstring; length 20..2000yesThe legal issue and key facts. Quote a phrase to require it verbatim in the search.
courtsarray<string>; max 10 itemsnoCourtListener court ids such as "scotus", "ca9", "cal", "calctapp". Omit to search all courts.
filed_afterstringnoEarliest filing date, YYYY-MM-DD.
filed_beforestringnoLatest filing date, YYYY-MM-DD.
max_resultsinteger; 1..8noDefault 5.
include_excerptsbooleannoDefault true. When false, the holding passage text is omitted from the output (quote_verified and quote_offset are still reported).

Example request body

{
  "question": "Does a warrantless search of a cell phone seized incident to a lawful arrest violate the Fourth Amendment?",
  "courts": [
    "scotus",
    "ca9"
  ],
  "max_results": 3
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "ok", "no_precedent_found"no
question_sha256stringno
queries_usedarray<string>noFree-text queries sent to CourtListener; court and date filters are applied separately.
courtsarray<string>no
precedentsarray<object>no
candidates_seenarray<object>no
llmobjectnoselection {provider, model} (null when no model call was needed) and adversarial ok|unavailable|skipped.
not_a_citatorbooleanno
noticestringno
limitsobjectno

Pay and connect

Available through: x402 (USDC on Base), MCP, RapidAPI, Apify.

Machine-readable