# Court Case Scraper — US Court Opinions & Dockets (`hichemdev/courtlistener-scraper`) Actor

Scrape US federal and state court records from CourtListener: case name, court, docket number, date filed, judge, attorneys, citations, citation count, precedential status and opinion snippets. Search by keyword, court, judge or date. Covers over 10 million legal documents. No API key.

- **URL**: https://apify.com/hichemdev/courtlistener-scraper.md
- **Developed by:** [Hichem Ben Moussa](https://apify.com/hichemdev) (community)
- **Categories:** Business, Developer tools, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 cases

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Court Case Scraper — US Court Opinions, Dockets & Judges

Scrape **US federal and state court records** — opinions, dockets, oral arguments and judge profiles — from CourtListener's public database of over **10 million** legal documents maintained by the Free Law Project.

Search by keyword, court, judge or date filed, then export case names, docket numbers, citations, citation counts and opinion snippets to JSON, CSV or Excel.

No API key required. A free CourtListener token is optional and raises your rate limit.

### What you get

| Field | Description |
|---|---|
| `caseName` | Full case name, e.g. *Roe v. Wade* |
| `court` | Court that issued the decision |
| `courtId` | CourtListener court code, e.g. `scotus`, `ca9`, `cand` |
| `docketNumber` | Official docket number |
| `dateFiled` | Filing / decision date |
| `judge` | Judge or panel |
| `attorney` | Attorneys of record, when published |
| `citation` | Reporter citations, e.g. `410 U.S. 113` |
| `citeCount` | How many later cases cite this one — a direct precedent-weight signal |
| `status` | Precedential status (Published, Unpublished, Errata…) |
| `snippet` | Text excerpt with your search terms in context |
| `suitNature` | Nature of suit |
| `absoluteUrl` | Link to the full record on CourtListener |

### Example input

```json
{
  "query": "qualified immunity",
  "searchType": "o",
  "court": "ca9",
  "filedAfter": "2023-01-01",
  "minCitations": 1,
  "maxResults": 100
}
```

Leave `query` empty and set only a court and date range to pull everything a court filed in a window.

#### Search types

| Value | Searches |
|---|---|
| `o` | Case-law opinions (default) |
| `r` | Dockets and filings (RECAP) |
| `rd` | Individual PACER documents |
| `oa` | Oral-argument audio |
| `p` | Judges |

### Example output

```json
{
  "caseName": "In Re '318 Patent Infringement Litigation",
  "court": "District Court, D. Delaware",
  "courtId": "ded",
  "docketNumber": "1:03-cv-00120",
  "dateFiled": "2008-09-26",
  "citeCount": 1,
  "status": "Published",
  "snippet": "...the claimed method of treatment...",
  "absoluteUrl": "https://www.courtlistener.com/opinion/..."
}
```

### Who uses this

- **Law firms** — precedent research, tracking how a doctrine develops in one circuit
- **Litigation analytics** — judge tendencies, case volume by court and nature of suit
- **Legal-tech products** — seeding a case-law corpus without scraping PACER
- **Journalists and researchers** — following a docket or a line of cases over time
- **Compliance teams** — monitoring new filings that name an industry or statute

### Rate limits and the optional token

The actor works with no credentials. CourtListener rate-limits anonymous traffic, so for large pulls create a free account at courtlistener.com, copy your API token and paste it into the **API token** field — the actor then sends it and you get a much higher quota.

### Pricing

Pay per result. You are charged for the records you actually receive, so a search that returns nothing costs nothing beyond the run start.

### Notes

- Data comes from CourtListener / the Free Law Project, which publishes US court records that are in the public domain.
- `citeCount` reflects citations inside CourtListener's corpus, which is the best available open proxy for precedent weight but is not identical to a commercial citator's count.
- Fields such as `judge`, `attorney` and `citation` are only as complete as the court's own published record — expect gaps on older or unpublished decisions.
- This is an unofficial actor and is not affiliated with CourtListener or the Free Law Project.

# Actor input Schema

## `query` (type: `string`):

Full-text search across case law, e.g. "patent infringement", "qualified immunity", a party name or a citation.

## `searchType` (type: `string`):

Which CourtListener collection to search.

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

Court ID to restrict to, e.g. "scotus" (Supreme Court), "ca9" (9th Circuit), "cafc" (Federal Circuit). Space-separate several.

## `judge` (type: `string`):

Judge name to filter by, e.g. "Gorsuch".

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

Only opinions filed on or after this date. Format MM/DD/YYYY or YYYY-MM-DD.

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

Only opinions filed on or before this date.

## `citedGt` (type: `integer`):

Only return opinions cited more than this many times — a useful proxy for landmark cases.

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

How to sort the results.

## `apiToken` (type: `string`):

A free token from courtlistener.com raises the rate limit substantially. Recommended for large runs.

## `maxResults` (type: `integer`):

Maximum number of records to scrape.

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

Optional. The CourtListener API is public and works without a proxy.

## Actor input object example

```json
{
  "query": "patent infringement",
  "searchType": "o",
  "orderBy": "score desc",
  "maxResults": 25,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

All scraped items as JSON.

## `overview` (type: `string`):

Browse results in the Apify Console.

# 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 = {
    "query": "patent infringement",
    "court": "",
    "judge": "",
    "filedAfter": "",
    "filedBefore": "",
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("hichemdev/courtlistener-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 = {
    "query": "patent infringement",
    "court": "",
    "judge": "",
    "filedAfter": "",
    "filedBefore": "",
    "maxResults": 25,
}

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

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

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

```

## CLI example

```bash
echo '{
  "query": "patent infringement",
  "court": "",
  "judge": "",
  "filedAfter": "",
  "filedBefore": "",
  "maxResults": 25
}' |
apify call hichemdev/courtlistener-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hichemdev/courtlistener-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/MgiMC252yATJb9zqQ/builds/t5ejiM9UZ0hdEuU2I/openapi.json
