Court records API
A court records API retrieves the case information courts publish online: docket entries, parties, case status, hearing dates and attorney details. Zenrows runs each court portal's search form in a Browser session or a Fetch request, gets through Imperva, DataDome and Cloudflare, and returns every docket as JSON to store and refresh.
Updated
{
"court": "Superior Court of Example County",
"state": "CA",
"case_number": "26-CV-004812",
"case_type": "Civil, breach of contract",
"filed_date": "2026-03-02",
"status": "active",
"department": "Dept. 14",
"parties": [
{ "role": "plaintiff", "name": "Example Supply LLC" },
{ "role": "defendant", "name": "Sample Builders Inc." }
],
"attorneys": [
{ "for": "plaintiff", "bar_number": "000000", "firm": "Example Law Group" }
],
"docket_entries": [
{ "date": "2026-03-02", "entry": "Complaint filed" },
{ "date": "2026-05-18", "entry": "Answer filed" },
{ "date": "2026-10-09", "entry": "Case management conference set" }
],
"next_hearing": { "date": "2026-11-17", "type": "Case management conference" },
"source_url": "https://courts.example.gov/case/26-CV-004812",
"fetched_at": "2026-10-17T07:15:44Z"
}
What legal data teams collect from courts
Two shapes of work: find new cases by party name or filing date, and follow tracked ones until they close.
| Job | Data you collect | Typical sources |
|---|---|---|
| Docket monitoring | New entries, rulings, hearing dates, status | State trial court portals, county clerk case search |
| Litigation checks for due diligence | Cases by party, type, filing date, disposition | State court name search, county civil and small claims indexes |
| Attorney and bar data | Bar number, admission date, license status, firm, public discipline | State bar directories: California, Texas, Florida, New York |
| Judgment and lien checks | Amount, creditor, filing date, satisfaction status | County clerk and recorder indexes |
| Legal analytics | Motion types, time to ruling, department, outcomes | Docket histories on the same cases over months |
| Published opinions | Text, citation, court, decision date | State appellate opinion pages, Justia |
Why court records scraping breaks
Portals offer a search box, not a case list, often behind bot protection.
Each query must look like a member of the public's.
No case URL until you submit a name or number
Browser submits the form in Playwright or Puppeteer; Fetch runs short flows with page actions (fill, click)
A blank page or challenge loop after a few searches
Zenrows' stealth gets through all three; each search reads as a visitor
Name searches stop at a fixed count; common names hide cases
Split into prefixes (Aa, Ab, Ac) run in parallel sessions
Next-page posts hidden form state; a copied URL returns nothing
Browser pages through in one session, keeping cookies and form state
New entries and continued hearings outdate last week's copy
Batch re-fetches every open case on your schedule
How to build a court records API
- Map each court's search: fields, result cap, pagination style, stable case URLs or not.
- Run searches in Browser with Puppeteer or Playwright, paging through results and saving each case URL with its number.
- Fetch case pages directly with Adaptive Stealth Mode, pulling the docket with CSS selectors or Extract.
- Refresh open cases with Batch daily: diff docket entries with the last run, close out final dispositions.
// npm install puppeteer-core
const puppeteer = require("puppeteer-core");
(async () => {
const browser = await puppeteer.connect({
browserWSEndpoint: "wss://browser.zenrows.com?apikey=YOUR_ZENROWS_API_KEY",
});
const page = await browser.newPage();
await page.goto(CASE_SEARCH_URL, { waitUntil: "networkidle2" });
// example selectors: replace with the court portal's own
await page.type("#partyName", "Sample Builders");
await page.click("#searchButton");
const cases = [];
while (true) {
await page.waitForSelector("table#caseResults");
cases.push(...(await page.$$eval("table#caseResults tbody tr", (rows) =>
rows.map((r) => ({
caseNumber: r.cells[0].innerText.trim(),
filed: r.cells[2].innerText.trim(),
link: r.querySelector("a") ? r.querySelector("a").href : null,
}))
)));
const next = await page.$("a.next-page");
if (!next) break;
await Promise.all([page.waitForNavigation(), next.click()]);
}
console.log(cases.length, cases[0]);
await browser.close();
})();curl -X POST "https://async.api.zenrows.com/v1/jobs" \
-H "X-API-Key: YOUR_ZENROWS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "regular",
"status": "closed",
"zenrows_params": { "mode": "auto", "extract": "auto" },
"tasks": [
{ "url": "CASE_URL_1", "external_id": "26-CV-004812" },
{ "url": "CASE_URL_2", "external_id": "26-CV-005107" }
]
}'npx -y @zenrows/cli init
# Check how one case page extracts, then refresh every open case as one job
zenrows extract CASE_URL --autoparse
zenrows batch create open-cases.jsonl --wait
zenrows batch results <job-id> --out dockets.jsonl# Connect once
claude mcp add zenrows -e ZENROWS_API_KEY=YOUR_ZENROWS_API_KEY -- npx -y @zenrows/mcp
# Then ask:
Use Zenrows to open the county court case search at CASE_SEARCH_URL, search
the party name "Sample Builders", page through every result, and return each
case number, filing date, case type and case page URL.Which Zenrows product fits
- Search by party name and paginate BrowserPlaywright or Puppeteer keeps session, cookies and form state across pages
- Look up a case by number FetchPage actions fill, search and wait for the docket in one request
- Read dockets across different court systems ExtractThe docket as JSON, no parser per court
- Refresh every open case each morning BatchThousands of case URLs in one job, tagged by case number
What success looks like
| Measure | What good looks like | How to check it |
|---|---|---|
| Docket lag | New entries stored within one refresh cycle | Filing date against first-stored time |
| Search completeness | Every prefix search stays under the result cap | Flag queries that hit the cap; split further |
| Docket completeness | Entry count per case matches the court's page | Weekly sample against the live docket |
| Match precision | Name matches confirmed by a second identifier | Matches without a case number or address |
| Court coverage | Parsed dockets from every court on your roadmap | Parsed cases per court against plan |
Court records API FAQ
-
A few. CourtListener, from the Free Law Project, covers opinions and the federal dockets in its RECAP archive; some state judiciaries publish bulk data. Most state and county courts offer only a search page, which a Zenrows-built API reads directly, for the courts and fields you choose.
-
PACER needs your own account and charges per page. A Browser session can run your logged-in workflow, with your credentials and fees. A common split: PACER for federal dockets, Zenrows for state and county portals, where most civil and criminal cases are filed.
-
Courts cap name searches, so split each into two-letter prefixes that stay under the cap. Run them in parallel Browser sessions, save case URLs with their numbers, and dedupe before fetching dockets.
-
Court records are public by default in most US jurisdictions, and collecting them is routine in legal analytics, due diligence and journalism. Some are later sealed or expunged, and dockets name private individuals, so privacy and consumer reporting rules may apply. Respect each court's terms and ask your legal team.
-
Case number, court, type, filing date, status, parties and roles, attorneys with bar numbers, judge, and docket entries with date, description and document link where published, usually with hearings and dispositions. Normalize party names and case types: each system labels them differently.
-
Resubmit open case URLs to Batch daily, diff entries and hearings with the last run, and drop cases with a final disposition to a monthly check for appeals or post-judgment activity.
-
Yes. Bar directories publish name, bar number, admission date, status, firm and address, often with public discipline. Key on bar number, refresh monthly, and join to cases through the bar numbers on dockets.