# US Court Records Scraper: Case Law & Dockets (`glitchbound/courts-scraper`) Actor

Search US federal and state case law, PACER dockets, judges and oral arguments through CourtListener. Returns case name, court, filing date, docket number, citations, cite count, judges and an opinion snippet. Free open data, while PACER itself charges per page.

- **URL**: https://apify.com/glitchbound/courts-scraper.md
- **Developed by:** [Daniel Meshulam](https://apify.com/glitchbound) (community)
- **Categories:** Lead generation, Automation, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## US Court Records Scraper: Case Law & Dockets

Search US federal and state courts for opinions, dockets, judges and oral
arguments, as structured rows.

```json
{ "queries": ["copyright fair use"], "resultType": "o", "orderBy": "citeCount desc" }
```

Free. No key. PACER, the official system, charges per page.

### Four indexes

| `resultType` | |
|---|---|
| `o` | **Case law opinions**: the published decisions |
| `r` | **PACER dockets and filings**: federal case activity |
| `p` | **Judges**: the judiciary database |
| `oa` | **Oral argument recordings** |

### The nesting that trips other Actors

A CourtListener v4 search result is a **cluster**: one case, and the actual
opinions hang off it in a nested `opinions` array. Read only the top level and
you get case names with no citation, no opinion type and no text, which is
exactly what the existing Actors in this niche return.

Here the cluster and its first opinion are flattened into one row, so
`citations`, `opinionType`, `opinionCount` and `snippet` are all present.

### Filters that make it usable

```json
{
  "queries": ["trade secret misappropriation"],
  "court": "ca9",
  "filedAfter": "2023-01-01",
  "orderBy": "citeCount desc"
}
```

- `court` takes CourtListener ids: `scotus`, `ca9`, `cand`, `nysd`
- `filedAfter` / `filedBefore` bound the date range
- `orderBy` supports **most cited**, which is how you find the controlling
  authority rather than the most recent noise

Every row also carries `totalMatches`, so you know how much you are seeing out of
how much exists.

### Use cases

- **Legal research**: precedent by topic, ranked by how often it is cited
- **Litigation monitoring**: new filings naming a company or a patent
- **Compliance and risk**: has this counterparty been sued, and for what
- **Journalism**: track a case across dockets and opinions
- **Academic**: citation networks and judicial output

### Pricing

Charged per record returned. A query that matches nothing, or one CourtListener
rejects, produces an `error` row and costs **$0.00**.

### Notes

- **Not legal advice.** This returns public records. Verify anything you rely on against the official source.
- Coverage is what the Free Law Project has digitised. It is very deep for federal appellate and Supreme Court material, thinner for some state trial courts.
- `snippet` is the search excerpt CourtListener returns, not the full opinion text. Full text is available at the `url` on each row.

### FAQ

#### Is it legal to scrape US court records?

These are public records. Court opinions and dockets are published by the courts
themselves, and this Actor reads them through the Free Law Project's
CourtListener API rather than by scraping court websites.

#### Do I need a PACER account or a CourtListener API key?

No. PACER charges per page for federal docket access; the material here is the
Free Law Project's mirror and index of it, and no key is required.

#### Can I get the full text of an opinion?

Not in the row itself. `snippet` is CourtListener's search excerpt. Every row
carries a `url` to the full opinion, which is the right place to read it. Full
opinions run to tens of thousands of words and returning them per row would be
neither useful nor cheap.

#### How do I find the leading case on a topic rather than the newest one?

Set `orderBy` to `citeCount desc`. Recency is the wrong sort for legal research:
the case that matters is usually the one everyone else cites.

#### Which courts can I filter to?

`court` takes CourtListener court ids: `scotus` for the Supreme Court, `ca1`
through `ca11` and `cadc` for the federal circuits, and district ids like `cand`
or `nysd`. Coverage is deepest for federal appellate and Supreme Court material
and thinner for some state trial courts.

#### Can I monitor for new filings about a company?

Yes. Run it on a schedule with `resultType: "r"` for dockets, your company name
as the query, and `filedAfter` set to the last run date.

# Actor input Schema

## `queries` (type: `array`):

What to search for, one per line. Free text, a party name, or a citation. Quote a phrase to match it exactly: "fair use".

## `resultType` (type: `string`):

Which CourtListener index to search.

## `court` (type: `string`):

Restrict to one court by its CourtListener id, e.g. scotus for the Supreme Court, ca9 for the Ninth Circuit, cand for N.D. Cal. Leave empty for all courts.

## `filedAfter` (type: `string`):

Only records filed on or after this date (YYYY-MM-DD).

## `filedBefore` (type: `string`):

Only records filed on or before this date (YYYY-MM-DD).

## `orderBy` (type: `string`):

Ordering of results.

## `maxResultsPerQuery` (type: `integer`):

Cap per query.

## `proxyConfiguration` (type: `object`):

Proxy settings.

## `maxItems` (type: `integer`):

A hard ceiling on rows for the entire run, across every target. The per-target limits above cap each one separately, so fifty targets at twenty each is still a thousand rows; this caps the total. The run stops cleanly when it is reached and nothing beyond that point is fetched or charged. Leave empty for no ceiling.

## Actor input object example

```json
{
  "queries": [
    "copyright fair use"
  ],
  "resultType": "o",
  "orderBy": "score desc",
  "maxResultsPerQuery": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Case name, court, filing date, docket number, citations, cite count and opinion snippet.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "queries": [
        "copyright fair use"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("glitchbound/courts-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "queries": ["copyright fair use"] }

# Run the Actor and wait for it to finish
run = client.actor("glitchbound/courts-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "queries": [
    "copyright fair use"
  ]
}' |
apify call glitchbound/courts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=glitchbound/courts-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/0r67dLt4obiJKlNQ2/builds/0bIgZSly9ZKdBs2bB/openapi.json
