Legal research is expensive. Westlaw and LexisNexis cost hundreds per month. Google Scholar covers some case law but has no API and limited filtering. If you need structured access to court opinions -- case names, judges, citations, docket numbers, opinion text -- your options narrow fast.
CourtListener, maintained by the Free Law Project, is the largest free repository of US court opinions. It covers the Supreme Court, all federal circuit and district courts, bankruptcy courts, and most state courts. Millions of opinions, fully searchable, with citation data and downloadable documents.
The catch: CourtListener's API is functional but requires pagination handling, response parsing, and familiarity with their court ID system. If you just need 100 opinions matching a search query, it's more setup than it should be.
What you get from each opinion
Every result includes:
- caseName -- full case name (e.g., "Gonzalez v. Google LLC")
- court and courtId -- the court that issued the opinion (e.g., "scotus", "ca9" for Ninth Circuit, "dcd" for D.C. District)
- dateFiled -- when the opinion was filed
- docketNumber -- the case docket number
- judge -- the judge or panel
- citations -- formal case citations (e.g., "598 U.S. 617")
- citeCount -- how many other opinions cite this one (useful for finding landmark cases)
- status -- Published or Unpublished
- opinionUrl -- direct link to the opinion on CourtListener
- snippet -- text excerpt from the opinion
- downloadUrl -- direct PDF download link
The citeCount field is particularly useful. Sorting by citation count surfaces the most influential opinions on any topic.
Use cases
Legal research -- find all published opinions mentioning "artificial intelligence" from federal circuit courts in the last two years. Filter by court, date range, and publication status.
Litigation analysis -- track how frequently a particular case is cited. Build a citation network around a key precedent. Identify which courts and judges are most active in a given area of law.
Compliance monitoring -- watch for new opinions in specific courts on regulatory topics. If your business is affected by TCPA litigation, Section 230 rulings, or patent law developments, you can set up regular queries.
Journalism -- research court decisions on public interest topics. The structured data makes it straightforward to build timelines, count cases by court or year, and identify trends.
Academic research -- build datasets of court opinions filtered by date, court, subject matter, and citation count. Export to CSV for statistical analysis.
Searching via API
I built an Apify actor that wraps CourtListener and returns clean, flat JSON. Here's how to call it from Python:
import requests
API_TOKEN = "your_apify_token"
# Search for AI-related opinions from federal circuit courts
run = requests.post(
f"https://api.apify.com/v2/acts/pink_comic~courtlistener-legal-opinions/runs?token={API_TOKEN}",
json={
"query": "artificial intelligence",
"dateFrom": "2023-01-01",
"status": "Published",
"maxResults": 50
}
).json()
print(f"Run started: {run['data']['id']}")
Fetch the results once the run completes:
dataset_id = run["data"]["defaultDatasetId"]
items = requests.get(
f"https://api.apify.com/v2/datasets/{dataset_id}/items?token={API_TOKEN}"
).json()
for opinion in items:
print(f"{opinion['dateFiled']} | {opinion['caseName']}")
print(f" Court: {opinion['court']} | Cited {opinion['citeCount']} times")
print(f" {opinion['opinionUrl']}")
Example queries
Supreme Court opinions on First Amendment since 2020:
{
"query": "First Amendment",
"court": "scotus",
"dateFrom": "2020-01-01",
"maxResults": 50
}
Ninth Circuit patent infringement cases:
{
"query": "patent infringement",
"court": "ca9",
"status": "Published",
"maxResults": 100
}
All published opinions mentioning "Section 230" in 2024:
{
"query": "Section 230",
"dateFrom": "2024-01-01",
"dateTo": "2024-12-31",
"status": "Published",
"maxResults": 200
}
Data source
All data comes from CourtListener, a free public resource maintained by the Free Law Project. No API key required on the data source side.
The actor is here: CourtListener Court Opinions Search
It's part of a collection of public data tools I maintain, covering government records, SEC filings, business registrations, and regulatory data. If you're working with legal or government data programmatically, take a look.
Top comments (0)