# CourtListener Court Opinions Scraper — US Case Law API (`compute-edge/courtlistener-opinions-scraper`) Actor

Scrape US court opinions from CourtListener (Free Law Project). Search by keyword, court, date range, and sort order. Returns case name, citations, judge, docket number, status, and opinion URL.

- **URL**: https://apify.com/compute-edge/courtlistener-opinions-scraper.md
- **Developed by:** [Compute Edge](https://apify.com/compute-edge) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Court Opinions Scraper — US Case Law API

Extract structured data from **CourtListener**, the largest open-access repository of US court opinions maintained by the **Free Law Project**. This Actor taps the CourtListener REST API to retrieve federal and state court opinions, including **Supreme Court decisions**, circuit court rulings, district court opinions, and thousands of other jurisdictions — with filtering by keyword, court, filing date, and sort order.

CourtListener indexes over **6 million court documents** spanning decades of US case law. It is used by legal researchers, litigation support teams, law firms, compliance departments, and legal technology companies to access authoritative, structured **case law data** without per-query pricing walls. Whether you are building a **legal intelligence platform**, enriching a **RAG pipeline** with case law, or monitoring a specific court's recent output, this Actor delivers clean, flattened JSON records ready for downstream use.

### Key Features

- **Full-text search** — Search across case names, opinion text, and metadata using CourtListener's powerful search index
- **Court filtering** — Narrow results to any US court by its identifier (e.g., `scotus`, `ca9`, `nyed`, `txnd`)
- **Date range filtering** — Filter opinions filed after or before specific dates
- **Multiple sort orders** — Sort by date filed (newest/oldest), relevance score, or citation count
- **Pagination handled automatically** — Follows cursor-based pagination to retrieve up to 5,000 records per run
- **No API key required** — Anonymous access to the CourtListener public API
- **Rate-limit resilient** — Built-in 1.5-second delays between requests plus automatic 429 retry

### Output Data Fields

| Field | Type | Description |
|-------|------|-------------|
| `caseName` | string | Short case name (e.g., "Roe v. Wade") |
| `caseNameFull` | string | Full official case name |
| `court` | string | Court name (e.g., "Supreme Court of the United States") |
| `courtId` | string | Court identifier (e.g., scotus, ca9) |
| `citation` | string | Citation string(s) joined with "; " (e.g., "410 U.S. 113") |
| `citeCount` | integer | Number of times this opinion has been cited |
| `dateFiled` | string | Date the opinion was filed (YYYY-MM-DD) |
| `docketNumber` | string | Official docket number |
| `judge` | string | Authoring judge name(s) |
| `status` | string | Publication status (e.g., Published, Unpublished) |
| `suitNature` | string | Nature of suit classification |
| `snippet` | string | Text excerpt from the opinion (HTML stripped) |
| `opinionUrl` | string | Full URL to the opinion on CourtListener |
| `clusterId` | integer | Internal CourtListener cluster ID for cross-referencing |

### How to scrape CourtListener court opinions

1. Go to the **CourtListener Court Opinions Scraper** page on the Apify Store.
2. Click **Try for free** or **Start** to open the Actor.
3. In the **Search Query** field, enter keywords relevant to your research — for example: `patent infringement software`, `Fourth Amendment search and seizure`, or `antitrust monopoly`. Leave this field empty to retrieve the most recently filed opinions across all courts.
4. (Optional) Enter a **Court ID** to limit results to a specific court. Common values:
   - `scotus` — US Supreme Court
   - `ca9` — 9th Circuit Court of Appeals
   - `ca2` — 2nd Circuit Court of Appeals
   - `nyed` — Eastern District of New York
   - `txnd` — Northern District of Texas
5. (Optional) Set **Filed After** and **Filed Before** to limit results to a specific date window (format: MM/DD/YYYY). Example: `01/01/2024` to `12/31/2024`.
6. Choose an **Order By** option — newest first, oldest first, most relevant, or most cited.
7. Set **Max Results** (default: 200). Each page retrieves 20 opinions; for large queries, increase this up to 5,000.
8. Click **Start** and wait for the run to complete (typically 10–60 seconds for 200 results).
9. Download your results as JSON, CSV, or Excel from the **Dataset** tab.

### Input example

```json
{
    "query": "patent infringement",
    "court": "cafc",
    "filedAfter": "01/01/2024",
    "orderBy": "dateFiled desc",
    "maxResults": 100
}
````

For recent Supreme Court opinions (no query needed):

```json
{
    "court": "scotus",
    "orderBy": "dateFiled desc",
    "maxResults": 50
}
```

### Output example

```json
{
    "caseName": "Apple Inc. v. Samsung Electronics Co.",
    "caseNameFull": "Apple Inc. v. Samsung Electronics Co., Ltd.",
    "court": "Court of Appeals for the Federal Circuit",
    "courtId": "cafc",
    "citation": "839 F.3d 1034",
    "citeCount": 312,
    "dateFiled": "2016-10-07",
    "docketNumber": "2015-1171",
    "judge": "Moore",
    "status": "Published",
    "suitNature": "Patent",
    "snippet": "This case returns to us after a partial grant of certiorari by the Supreme Court...",
    "opinionUrl": "https://www.courtlistener.com/opinion/4109294/apple-inc-v-samsung-electronics-co/",
    "clusterId": 4109294
}
```

### Pricing

This Actor calls the CourtListener public API — no browser required, minimal compute.

- **Cost per 200 results**: approximately $0.003–$0.006 depending on run duration
- **Per-result pricing**: $0.003/result
- **API rate limit delay**: 1.5 seconds per page (20 results), so 200 results ≈ 15 seconds of API time

### Use Cases

- **Legal research automation** — Pull opinions matching specific legal theories or case facts for litigation research
- **Citation analysis** — Identify the most-cited opinions in a jurisdiction or subject area using `citeCount`
- **Compliance monitoring** — Track new opinions from specific courts relevant to your regulatory environment
- **LegalTech / RAG pipelines** — Feed structured case law into LLM applications for legal Q\&A and document analysis
- **Law firm business development** — Monitor courts where opposing counsel or a target client is active
- **Academic research** — Analyze trends in judicial output by court, date range, or legal topic

### FAQ

#### Do I need a CourtListener API key?

No. The CourtListener API allows anonymous access at a lower rate limit. This Actor uses anonymous access and includes built-in polite delays (1.5 seconds between page requests) to stay within those limits. If you need higher throughput, you can obtain a free CourtListener API token at [courtlistener.com](https://www.courtlistener.com/sign-in/) and pass it as a custom header — though for most use cases, anonymous access is sufficient.

#### What happens if I hit the rate limit (429)?

The Actor automatically detects 429 responses, sleeps for 5 seconds, and retries once. If the retry also fails, it stops gracefully and returns all records collected so far. Your dataset will not be empty — you will receive however many records were fetched before the limit was reached.

#### How many opinions are in CourtListener?

CourtListener (operated by the Free Law Project) indexes over 6 million federal and state court opinions, covering hundreds of jurisdictions from the 1700s to the present day. The database grows continuously as new opinions are filed.

#### Can I filter by specific case types or legal topics?

Yes — use the **Search Query** field with natural language or legal terminology. Examples: `employment discrimination Title VII`, `Section 230 immunity`, `copyright fair use`. You can also combine this with a **Court ID** to narrow results further.

### Other Scrapers by SeatSignal

- [CISA KEV Scraper](https://apify.com/seatsignal/cisa-kev-scraper) — Extract CISA Known Exploited Vulnerabilities catalog data
- [OSHA Inspections Scraper](https://apify.com/seatsignal/osha-inspections-scraper) — Extract OSHA workplace safety inspection data
- [FDA OpenFDA Scraper](https://apify.com/seatsignal/fda-openfda-scraper) — Extract FDA drug and device safety data

### Legal Disclaimer

This Actor accesses publicly available data from the CourtListener platform, operated by the Free Law Project (a 501(c)(3) nonprofit). Court opinions are public records. No authentication bypass, scraping of private data, or terms-of-service violation is involved. Users are responsible for ensuring their use of the extracted data complies with applicable laws and regulations. For support, contact the Actor developer through the Apify Store.

# Actor input Schema

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

Full-text search query across case names, opinion text, and metadata. Leave empty to retrieve the most recent opinions. Examples: 'patent infringement', 'Fourth Amendment', 'antitrust'.

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

Filter by court identifier. Examples: scotus (Supreme Court), ca9 (9th Circuit), nyed (E.D. New York), txnd (N.D. Texas). See CourtListener's court list for all IDs.

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

Only include opinions filed on or after this date. Format: MM/DD/YYYY. Example: 01/01/2024.

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

Only include opinions filed on or before this date. Format: MM/DD/YYYY. Example: 12/31/2024.

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

Sort order for results.

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

Maximum number of opinion records to return. Each page returns up to 20 results. Set to 0 for unlimited (may be slow for large queries).

## Actor input object example

```json
{
  "query": "",
  "court": "",
  "filedAfter": "",
  "filedBefore": "",
  "orderBy": "dateFiled desc",
  "maxResults": 200
}
```

# Actor output Schema

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

No description

# 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 = {
    "orderBy": "dateFiled desc",
    "maxResults": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("compute-edge/courtlistener-opinions-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 = {
    "orderBy": "dateFiled desc",
    "maxResults": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("compute-edge/courtlistener-opinions-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 '{
  "orderBy": "dateFiled desc",
  "maxResults": 200
}' |
apify call compute-edge/courtlistener-opinions-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CourtListener Court Opinions Scraper — US Case Law API",
        "description": "Scrape US court opinions from CourtListener (Free Law Project). Search by keyword, court, date range, and sort order. Returns case name, citations, judge, docket number, status, and opinion URL.",
        "version": "0.1",
        "x-build-id": "dqVxg2azcDxU2Vnue"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/compute-edge~courtlistener-opinions-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-compute-edge-courtlistener-opinions-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/compute-edge~courtlistener-opinions-scraper/runs": {
            "post": {
                "operationId": "runs-sync-compute-edge-courtlistener-opinions-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/compute-edge~courtlistener-opinions-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-compute-edge-courtlistener-opinions-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Full-text search query across case names, opinion text, and metadata. Leave empty to retrieve the most recent opinions. Examples: 'patent infringement', 'Fourth Amendment', 'antitrust'.",
                        "default": ""
                    },
                    "court": {
                        "title": "Court ID",
                        "type": "string",
                        "description": "Filter by court identifier. Examples: scotus (Supreme Court), ca9 (9th Circuit), nyed (E.D. New York), txnd (N.D. Texas). See CourtListener's court list for all IDs.",
                        "default": ""
                    },
                    "filedAfter": {
                        "title": "Filed After (MM/DD/YYYY)",
                        "type": "string",
                        "description": "Only include opinions filed on or after this date. Format: MM/DD/YYYY. Example: 01/01/2024.",
                        "default": ""
                    },
                    "filedBefore": {
                        "title": "Filed Before (MM/DD/YYYY)",
                        "type": "string",
                        "description": "Only include opinions filed on or before this date. Format: MM/DD/YYYY. Example: 12/31/2024.",
                        "default": ""
                    },
                    "orderBy": {
                        "title": "Order By",
                        "enum": [
                            "dateFiled desc",
                            "dateFiled asc",
                            "score desc",
                            "citeCount desc"
                        ],
                        "type": "string",
                        "description": "Sort order for results.",
                        "default": "dateFiled desc"
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum number of opinion records to return. Each page returns up to 20 results. Set to 0 for unlimited (may be slow for large queries).",
                        "default": 200
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
