# CourtListener Legal Cases Scraper (`ninhothedev/courtlistener-scraper`) Actor

$0.5/1K 🔥 Fast CourtListener scraper! US court opinions & dockets by keyword — case name, court, date & citations. No key. JSON, CSV, Excel or API in seconds. Pull cases for legal research & litigation intel ⚡

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

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## CourtListener Legal Cases Scraper ⚖️

Scrape **US court opinions, dockets and RECAP documents** from [CourtListener](https://www.courtlistener.com) — the free legal-research database from the Free Law Project. Get structured case data (**case name, court, date filed, citations, docket number, judge, status, snippet**) for legal research, case-law monitoring, litigation intelligence and compliance workflows.

**No API key. No login. Clean JSON. Cheap.**

***

### 💡 What it does

This actor queries the public CourtListener REST API (v4) with your full-text search terms, follows cursor pagination, and returns one clean, flat record per case/document. It runs on the free unauthenticated endpoint with polite rate-limiting — so it stays cheap and datacenter-friendly.

### ✨ Features

- 🔍 **Full-text search** across millions of US court opinions and federal filings
- 📚 **Four result types**: case-law opinions (`o`), RECAP filings (`r`), RECAP documents (`rd`), dockets (`d`)
- 📄 **Cursor pagination** — pulls up to 1,000 items per run across multiple queries
- 🧹 **Clean output** — HTML-stripped snippets, ISO dates, absolute URLs, citation arrays
- 🔑 **No API key required**
- ⚡ Lightweight (512 MB), fast, and inexpensive to run

### 📥 Input

| Field | Type | Description |
|-------|------|-------------|
| `mode` | select | Scraping mode (`search`). |
| `queries` | array | Full-text queries (case names, topics, parties, citations). Prefilled with `["copyright infringement","first amendment"]`. |
| `type` | select | `o` opinions · `r` RECAP filings · `rd` RECAP documents · `d` dockets. Default `o`. |
| `maxItems` | integer | Max results across all queries (1–1000). Default `100`. |

#### Example input

```json
{
  "mode": "search",
  "queries": ["copyright infringement", "trademark dilution"],
  "type": "o",
  "maxItems": 200
}
```

### 📤 Output

Each item:

```json
{
  "case_name": "In re \"The Exorcist\" Copyright Infringement Litigation",
  "court": "United States Judicial Panel on Multidistrict Litigation",
  "court_id": "jpml",
  "date_filed": "1976-04-22",
  "citations": ["411 F. Supp. 793", "1976 U.S. Dist. LEXIS 15456"],
  "docket_number": "MDL No. 246",
  "judge": null,
  "status": "Published",
  "snippet": "This copyright case concerns ...",
  "url": "https://www.courtlistener.com/opinion/8849630/in-re-the-exorcist-copyright-infringement-litigation/",
  "cluster_id": 8849630,
  "type": "o",
  "source": "courtlistener",
  "scraped_at": "2026-07-20T12:00:00+00:00"
}
```

### 🎯 Use cases

- **Legal research** — find relevant opinions and precedent by topic, party or citation
- **Case-law monitoring** — track new decisions on issues that matter to your practice
- **Litigation intelligence** — map dockets, judges and courts across a topic
- **Compliance** — watch regulatory and enforcement litigation over time

### 💰 Pricing

Roughly **$0.5 per 1,000 results** on top of Apify platform usage — one of the cheapest ways to get structured US case-law data at scale.

### 🔗 Related actors

- [SEC EDGAR Scraper](https://apify.com/ninhothedev/sec-edgar-scraper)
- [Federal Register Scraper](https://apify.com/ninhothedev/federal-register-scraper)
- [GLEIF Scraper](https://apify.com/ninhothedev/gleif-scraper)
- [OFAC Sanctions Scraper](https://apify.com/ninhothedev/ofac-sanctions-scraper)

### 🏷️ Keywords

courtlistener, legal cases scraper, court opinions, case law, us courts, dockets, recap, pacer, legal research, litigation intelligence, case law monitoring, judicial opinions, citations, free law project, legal data api, compliance monitoring

### ⚖️ Legal & data

Data is sourced from CourtListener / the Free Law Project public API, which publishes US court records that are in the public domain. Use responsibly and in accordance with CourtListener's [terms](https://www.courtlistener.com/terms/). This actor is not affiliated with or endorsed by the Free Law Project.

# Actor input Schema

## `mode` (type: `string`):

Scraping mode. Currently 'search' — run full-text queries against the CourtListener search API and paginate through results.

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

One or more full-text search queries (case names, legal topics, parties, citations, keywords). Each query is paginated until maxItems is reached.

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

CourtListener search type: o = case-law opinions, r = RECAP (federal filings/dockets), rd = RECAP documents, d = dockets.

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

Maximum number of cases/documents to scrape in total across all queries (1–1000).

## Actor input object example

```json
{
  "mode": "search",
  "queries": [
    "copyright infringement",
    "first amendment"
  ],
  "type": "o",
  "maxItems": 100
}
```

# 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 infringement",
        "first amendment"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/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 = { "queries": [
        "copyright infringement",
        "first amendment",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/courtlistener-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 infringement",
    "first amendment"
  ]
}' |
apify call ninhothedev/courtlistener-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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