Build an AI agent that searches federal case dockets on demand
Look up judge profiles and opinions from a Python script
Pull oral argument transcripts into a RAG pipeline
Run a docket monitor that polls 94 federal courts for new filings
Full access requires a Base wallet plus USDC for per-query payments, though a free demo mode works with just pip install.
Clerk is a Python library that lets AI agents look up United States federal court records on demand. The authors say it covers more than 500 million records from 94 federal courts, across 11 endpoints such as case search, full docket details, judge profiles, opinions, and oral argument transcripts. Instead of asking for an API key or a monthly subscription, the service uses an emerging web standard called x402, where the server replies with an HTTP 402 Payment Required, the client pays a tiny amount of USDC on the Base blockchain, and the original request retries automatically. Installation is a normal pip install. Python 3.10 or higher is needed, and the only real dependency is the httpx HTTP client. The search endpoint runs in a free demo mode with a per-IP-per-hour cap, so you can try the library without any crypto setup. For full access you send a small USDC payment, currently $0.001 per query, from any wallet on Base such as MetaMask, and pass the transaction hash into the client when you create it. The library wraps that hash into the payment header the server checks against the on-chain transaction. There is also a token called $CLERK. Wallets holding more than one billion $CLERK on Base are detected automatically and given unlimited queries with no per-call payment. For production agent setups the README recommends a delegated signer pattern, where the main token-holding wallet stays cold and a fresh wallet, funded only with gas, does the actual signing for each request. The data is limited to public federal records, with no state courts and no sealed dockets, and the project is clear that the output is information only, not legal advice. The code is released under the MIT license.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.