Documentation · CourtListener Search

ReadMe

How to set up and use the CourtListener Search tool — search federal court cases, dockets, judges, and opinions without PACER fees

What It Does

Case / Docket Search

Find cases by party name, judge, or court across all federal jurisdictions.

search tab

Case Law Search

Search published opinions and decisions by keyword or natural language with semantic search.

semantic search

Judge Lookup

Find federal judges by name and court. Returns bio, affiliations, and positions.

search tab

Judge Profile

One-click bio, positions, and recent assigned dockets for a single judge.

featured

Judge Disclosures

View a judge's financial disclosure filings — investments, positions, gifts, debts, and reimbursements by year.

new

RECAP Archive

Access free PACER documents through the RECAP archive — no PACER fees.

free pacer

Court Directory

Browse all available federal courts by jurisdiction type.

search tab

CSV Export

Download any result set as CSV with one click — including judge docket lists.

all tabs

Responsive Design

Works on desktop, tablet, and mobile. Pagination for large result sets.

ui
Setup
1

Get Your API Token

Sign up for a free account at CourtListener's API page and grab your token.

2

Configure Your Token

Copy .env.example to .env and paste your token:

cp .env.example .env # edit .env and replace your-token-here with your real token

app.py auto-loads .env on startup. The file is gitignored so the token stays local.

3

Install Dependencies

pip install fastapi uvicorn requests
4

Run the Backend Server

python app.py

The server starts on http://localhost:8000. Open /search.html for the web interface or /docs for the interactive API explorer.

Usage
1

Select a search type from the tabs: Cases, Case Law, Judges, Judge Profile, Judge Disclosures, RECAP Archive, or Courts.

2

Enter your search criteria and optionally pick a court from the dropdown to narrow results.

3

Click Search to submit. Results appear below with pagination controls.

4

Click Export CSV in the results header to download the current result set.

Semantic Search

On the Case Law tab, click the &/? toggle to switch between keyword and semantic search. Semantic search finds cases by meaning — e.g., "tenant evicted for having a dog" finds pet-related housing cases, not just results containing those exact words. Wrap terms in "quotes" for hybrid keyword + semantic matching.

Judge Profile & Disclosures

The Judge Profile tab returns a single judge's bio, positions, and recent dockets in one view. The Judge Disclosures tab shows their financial disclosure filings — investments, outside positions, gifts, debts, and reimbursements organized by year.

API Endpoints
Endpoint Description
GET /api/search/casesDocket search by party, judge, court
GET /api/search/opinionsCase law search — add &semantic=true for semantic search
GET /api/search/judgesJudge lookup by name
GET /api/judge-profileSingle-judge bio + recent assigned dockets
GET /api/judge-disclosuresJudge financial disclosures (investments, gifts, debts)
GET /api/search/recapRECAP archive search
GET /api/courtsList all federal courts
GET /api/case/{id}Get single case details
GET /api/healthBackend health check

Example Requests

# Search cases by party curl "http://localhost:8000/api/search/cases?party=Apple&limit=10" # Search case law (keyword) curl "http://localhost:8000/api/search/opinions?query=patent&court=cafc&limit=10" # Search case law (semantic — finds cases by meaning) curl "http://localhost:8000/api/search/opinions?query=tenant+evicted+for+having+a+dog&semantic=true&limit=10" # Find judges curl "http://localhost:8000/api/search/judges?name=Roberts&limit=10" # Pull a full judge profile in one call curl "http://localhost:8000/api/judge-profile?name=Tanya+Chutkan&max_cases=25" # Get a judge's financial disclosures curl "http://localhost:8000/api/judge-disclosures?name=Chutkan"

Response Format

All successful responses return:

{ "status": "success", "total": 42, "page": 1, "count": 20, "results": [ ... ], "timestamp": "2024-04-27T14:30:00.000Z" }
Limitations
Token Required

All requests require a valid COURTLISTENER_TOKEN. If the token is not set, searches fail with a 503 error.

Deployment

Architecture

The frontend and backend are deployed separately:

Frontend Deploys

Pushing to main on GitHub auto-deploys the HTML files via GitHub Pages. No extra steps needed for frontend changes.

Backend Deploys — Manual

The VM has no git repo — backend files were copied manually. Pushing to GitHub does not update the API server.

Updating the Backend

# SSH into the VM gcloud compute ssh courtlistener --zone=us-west1-b --project=subtxtpress # Backend files live at ~/courtlistener cd ~/courtlistener # Copy updated files (e.g. via scp or paste) # Then restart the server sudo systemctl restart courtlistener # or however the process is managed

To streamline this, you could initialize a git repo on the VM (git init + add a remote) so future updates are just git pull.

Troubleshooting

"CourtListener API not initialized" (503)

The COURTLISTENER_TOKEN environment variable is not set. Make sure your .env file exists and contains a valid token, then restart app.py.

CORS Errors in Browser Console

Make sure app.py is running and the API base URL in search.html matches your backend URL (http://localhost:8000 for local dev).

Slow Searches

Query complexity, result set size, and CourtListener server load all affect speed. Try narrowing your search with more specific filters.

Project Files
FilePurpose
search.htmlInteractive web interface
app.pyFastAPI backend (auto-loads .env)
.env.exampleToken template — copy to .env
courtlistener_toolkit.pyCore Python client library
courtlistener_explorer.pyAlternative CLI tool
Resources

Open Search Tool