{"id":"precedent-search","title":"Case-law precedent search (CourtListener, US)","description":"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.","roi":"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.","audience":"legal-ip","channels":["x402","mcp","rapidapi","apify"],"endpoint":{"method":"POST","url":"https://agents.writerslogic.com/api/v1/precedent-search","path":"/api/v1/precedent-search","contentType":"application/json"},"price":{"amount":"1.00","currency":"USDC","network":"base","perCall":true,"failedCallsCharged":false},"inputSchema":{"type":"object","additionalProperties":false,"required":["question"],"properties":{"question":{"type":"string","minLength":20,"maxLength":2000,"description":"The legal issue and key facts. Quote a phrase to require it verbatim in the search."},"courts":{"type":"array","maxItems":10,"items":{"type":"string","pattern":"^[a-z0-9]{2,20}$"},"description":"CourtListener court ids such as \"scotus\", \"ca9\", \"cal\", \"calctapp\". Omit to search all courts."},"filed_after":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Earliest filing date, YYYY-MM-DD."},"filed_before":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Latest filing date, YYYY-MM-DD."},"max_results":{"type":"integer","minimum":1,"maximum":8,"description":"Default 5."},"include_excerpts":{"type":"boolean","description":"Default true. When false, the holding passage text is omitted from the output (quote_verified and quote_offset are still reported)."}}},"resultSchema":{"type":"object","properties":{"status":{"type":"string","enum":["ok","no_precedent_found"]},"question_sha256":{"type":"string"},"queries_used":{"type":"array","items":{"type":"string"},"description":"Free-text queries sent to CourtListener; court and date filters are applied separately."},"courts":{"type":"array","items":{"type":"string"}},"precedents":{"type":"array","items":{"type":"object","properties":{"case_name":{"type":"string"},"citations":{"type":"array","items":{"type":"string"}},"court":{"type":"string"},"court_id":{"type":"string"},"date_filed":{"type":"string"},"precedential_status":{"type":"string"},"cluster_id":{"type":"integer"},"opinion_id":{"type":"integer"},"opinion_type":{"type":"string","description":"CourtListener type of the opinion read, such as 020lead; a quote from a dissent or concurrence is not the court's holding."},"url":{"type":"string"},"source_sha256":{"type":"string","description":"SHA-256 of the CourtListener opinions API response the text was derived from."},"source_chars":{"type":"integer"},"truncated_source":{"type":"boolean","description":"The model saw head and tail halves of an opinion over the character cap; quotes are verified against the full text."},"relevance":{"type":"integer"},"issue_match":{"type":"string","enum":["direct","analogous","background"]},"holding_quote":{"anyOf":[{"type":"string","description":"Verbatim passage, or null when not verified or include_excerpts is false."},{"type":"null"}]},"quote_verified":{"type":"boolean"},"quote_offset":{"anyOf":[{"type":"integer","description":"UTF-16 offset of the quote in the NFC form of the full opinion text; null when unverified."},{"type":"null"}]},"why_relevant":{"type":"string"},"challenged":{"anyOf":[{"type":"string","description":"Reason a skeptical second pass thought the opinion off point, or null."},{"type":"null"}]}}}},"candidates_seen":{"type":"array","items":{"type":"object","description":"case_name, cluster_id, court_id, date_filed, text_read for every search candidate."}},"llm":{"type":"object","description":"selection {provider, model} (null when no model call was needed) and adversarial ok|unavailable|skipped."},"not_a_citator":{"type":"boolean"},"notice":{"type":"string"},"limits":{"type":"object"}}},"outputSchema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["ok","no_precedent_found"]},"question_sha256":{"type":"string"},"queries_used":{"type":"array","items":{"type":"string"},"description":"Free-text queries sent to CourtListener; court and date filters are applied separately."},"courts":{"type":"array","items":{"type":"string"}},"precedents":{"type":"array","items":{"type":"object","properties":{"case_name":{"type":"string"},"citations":{"type":"array","items":{"type":"string"}},"court":{"type":"string"},"court_id":{"type":"string"},"date_filed":{"type":"string"},"precedential_status":{"type":"string"},"cluster_id":{"type":"integer"},"opinion_id":{"type":"integer"},"opinion_type":{"type":"string","description":"CourtListener type of the opinion read, such as 020lead; a quote from a dissent or concurrence is not the court's holding."},"url":{"type":"string"},"source_sha256":{"type":"string","description":"SHA-256 of the CourtListener opinions API response the text was derived from."},"source_chars":{"type":"integer"},"truncated_source":{"type":"boolean","description":"The model saw head and tail halves of an opinion over the character cap; quotes are verified against the full text."},"relevance":{"type":"integer"},"issue_match":{"type":"string","enum":["direct","analogous","background"]},"holding_quote":{"anyOf":[{"type":"string","description":"Verbatim passage, or null when not verified or include_excerpts is false."},{"type":"null"}]},"quote_verified":{"type":"boolean"},"quote_offset":{"anyOf":[{"type":"integer","description":"UTF-16 offset of the quote in the NFC form of the full opinion text; null when unverified."},{"type":"null"}]},"why_relevant":{"type":"string"},"challenged":{"anyOf":[{"type":"string","description":"Reason a skeptical second pass thought the opinion off point, or null."},{"type":"null"}]}}}},"candidates_seen":{"type":"array","items":{"type":"object","description":"case_name, cluster_id, court_id, date_filed, text_read for every search candidate."}},"llm":{"type":"object","description":"selection {provider, model} (null when no model call was needed) and adversarial ok|unavailable|skipped."},"not_a_citator":{"type":"boolean"},"notice":{"type":"string"},"limits":{"type":"object"}}},"_provenance":{"type":"object","description":"C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance"}},"required":["data","_provenance"]},"example":{"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},"openapiOperation":{"operationId":"precedent_search","summary":"Case-law precedent search (CourtListener, US)","description":"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.\n\nPrice: 1.00 USDC on Base (x402).","x-x402-price-usdc":"1.00","x-x402-amount":"1000000","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"1.00"}},"x-audience":"legal-ip","x-sample-url":"https://agents.writerslogic.com/api/v1/samples/precedent-search","security":[{"x402":[]},{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["question"],"properties":{"question":{"type":"string","minLength":20,"maxLength":2000,"description":"The legal issue and key facts. Quote a phrase to require it verbatim in the search."},"courts":{"type":"array","maxItems":10,"items":{"type":"string","pattern":"^[a-z0-9]{2,20}$"},"description":"CourtListener court ids such as \"scotus\", \"ca9\", \"cal\", \"calctapp\". Omit to search all courts."},"filed_after":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Earliest filing date, YYYY-MM-DD."},"filed_before":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Latest filing date, YYYY-MM-DD."},"max_results":{"type":"integer","minimum":1,"maximum":8,"description":"Default 5."},"include_excerpts":{"type":"boolean","description":"Default true. When false, the holding passage text is omitted from the output (quote_verified and quote_offset are still reported)."}}},"example":{"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}}}},"responses":{"200":{"description":"Paid result with provenance","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["ok","no_precedent_found"]},"question_sha256":{"type":"string"},"queries_used":{"type":"array","items":{"type":"string"},"description":"Free-text queries sent to CourtListener; court and date filters are applied separately."},"courts":{"type":"array","items":{"type":"string"}},"precedents":{"type":"array","items":{"type":"object","properties":{"case_name":{"type":"string"},"citations":{"type":"array","items":{"type":"string"}},"court":{"type":"string"},"court_id":{"type":"string"},"date_filed":{"type":"string"},"precedential_status":{"type":"string"},"cluster_id":{"type":"integer"},"opinion_id":{"type":"integer"},"opinion_type":{"type":"string","description":"CourtListener type of the opinion read, such as 020lead; a quote from a dissent or concurrence is not the court's holding."},"url":{"type":"string"},"source_sha256":{"type":"string","description":"SHA-256 of the CourtListener opinions API response the text was derived from."},"source_chars":{"type":"integer"},"truncated_source":{"type":"boolean","description":"The model saw head and tail halves of an opinion over the character cap; quotes are verified against the full text."},"relevance":{"type":"integer"},"issue_match":{"type":"string","enum":["direct","analogous","background"]},"holding_quote":{"anyOf":[{"type":"string","description":"Verbatim passage, or null when not verified or include_excerpts is false."},{"type":"null"}]},"quote_verified":{"type":"boolean"},"quote_offset":{"anyOf":[{"type":"integer","description":"UTF-16 offset of the quote in the NFC form of the full opinion text; null when unverified."},{"type":"null"}]},"why_relevant":{"type":"string"},"challenged":{"anyOf":[{"type":"string","description":"Reason a skeptical second pass thought the opinion off point, or null."},{"type":"null"}]}}}},"candidates_seen":{"type":"array","items":{"type":"object","description":"case_name, cluster_id, court_id, date_filed, text_read for every search candidate."}},"llm":{"type":"object","description":"selection {provider, model} (null when no model call was needed) and adversarial ok|unavailable|skipped."},"not_a_citator":{"type":"boolean"},"notice":{"type":"string"},"limits":{"type":"object"}}},"_provenance":{"type":"object","description":"C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance"}},"required":["data","_provenance"]}}}},"400":{"description":"Invalid request (no payment consumed)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}},"401":{"description":"Invalid X-API-KEY","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}},"402":{"description":"Payment required or invalid","content":{"application/json":{"schema":{"type":"object","description":"x402 v2 PaymentRequired (also base64 in the PAYMENT-REQUIRED header)","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"code":{"type":"string"},"resource":{"type":"object"},"accepts":{"type":"array","items":{"type":"object"}},"extensions":{"type":"object"}}}}}},"502":{"description":"Upstream failure; the payment is released or not settled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}}}},"links":{"docs":"https://agents.writerslogic.com/docs/precedent-search/","docsJson":"https://agents.writerslogic.com/docs/precedent-search.json","sample":"https://agents.writerslogic.com/api/v1/samples/precedent-search","openapi":"https://agents.writerslogic.com/openapi.json","catalog":"https://agents.writerslogic.com/api/v1/catalog","verifyProvenance":"https://agents.writerslogic.com/api/v1/verify-provenance","index":"https://agents.writerslogic.com/docs/index.json"}}