WritersLogic Verifiable AI Agent Hub Precedent Search API

The Precedent Search API from WritersLogic Verifiable AI Agent Hub — 1 operation(s) for precedent search.

GitHub OpenAPI

Operations 1

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/writerslogic-com:writerslogic-com-precedent-search-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

writerslogic-com-precedent-search-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: WritersLogic Verifiable AI Agent Hub Precedent Search API
  version: 2.0.0
  description: Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.
  contact:
    name: WritersLogic
    url: https://writerslogic.com/agents
    email: agents@writerslogic.com
servers:
- url: https://agents.writerslogic.com
tags:
- name: Precedent Search
paths:
  /api/v1/precedent-search:
    post:
      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.


        Price: 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
      tags:
      - Precedent Search
components:
  securitySchemes:
    x402:
      type: apiKey
      in: header
      name: PAYMENT-SIGNATURE
      description: x402 v2 payment payload (base64) sent after a 402 challenge
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY