explaingit

basedcryptoji/clerk

23PythonAudience · developerComplexity · 3/5ActiveLicenseSetup · moderate

TLDR

A Python client that queries US federal court records via the x402 standard, paying tiny USDC amounts on Base per request instead of using API keys.

Mindmap

mindmap
  root((Clerk))
    Inputs
      Case query strings
      USDC transaction hash
      Base wallet address
    Outputs
      Case results
      Docket details
      Judge profiles
      Opinions and transcripts
    Use Cases
      Legal research agent
      Docket monitoring bot
      Judge profile lookup
    Tech Stack
      Python
      httpx
      x402
      Base USDC

Things people build with this

USE CASE 1

Build an AI agent that searches federal case dockets on demand

USE CASE 2

Look up judge profiles and opinions from a Python script

USE CASE 3

Pull oral argument transcripts into a RAG pipeline

USE CASE 4

Run a docket monitor that polls 94 federal courts for new filings

Tech stack

Pythonhttpxx402USDCBase

Getting it running

Difficulty · moderate Time to first run · 30min

Full access requires a Base wallet plus USDC for per-query payments, though a free demo mode works with just pip install.

MIT licensed, free to use, modify, and ship commercially as long as the copyright notice stays in the code.

In plain English

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.

Copy-paste prompts

Prompt 1
Install Clerk and run a free demo search for cases mentioning antitrust in the Ninth Circuit
Prompt 2
Set up a Base wallet, send a 0.001 USDC payment, and pass the transaction hash into the Clerk client
Prompt 3
Show me the delegated signer pattern with a cold wallet and a gas-only signer wallet for Clerk
Prompt 4
Write an agent that fetches full docket details for a given case number using Clerk endpoints
Prompt 5
Explain how the x402 HTTP 402 Payment Required flow retries the request after USDC payment
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.