# CourtListener Scraper - US Court Opinions & Case Law (`themineworks/courtlistener-court-records`) Actor

Affordable CourtListener scraper: US court opinions, dockets & case law. $3/1,000 results, 25 free, pay-per-result, no subscription. Works in Claude, ChatGPT & any MCP-compatible AI agent.

- **URL**: https://apify.com/themineworks/courtlistener-court-records.md
- **Developed by:** [The Mine Works](https://apify.com/themineworks) (community)
- **Categories:** Business, Developer tools, MCP servers
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

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

## US Court Records Scraper — Opinions & Dockets (CourtListener)

Search **millions of US federal and state court opinions and dockets** from **CourtListener** (the Free Law Project) and get clean, structured JSON. Find case law and dockets by keyword, court, and date — with case name, court, judge, citations, docket number, and a direct link. Built for **legal research, litigation intelligence, compliance, and AI/legal-tech pipelines**. No API key required.

**Keywords:** CourtListener API, US court records, case law API, court opinions scraper, legal research API, PACER alternative, docket data, legal-tech data.

---

### Why this actor

CourtListener hosts one of the largest open collections of US case law and federal dockets, with an excellent API — but it uses cursor pagination and returns dozens of fields per result. This actor wraps it into one clean record per case, so you can go from a query to a usable table in seconds.

- **Opinions or dockets** — search published case law or RECAP federal dockets.
- **Filters** — keyword/phrase, specific court (`scotus`, `ca9`, `ded`…), and filing-date range.
- **Clean output** — case name, court, judge, citations, docket number, status, nature of suit, and a click-ready URL.
- **Deep pagination** — pull a handful or thousands.
- **No API key** — keyless by default; add a free CourtListener token for higher rate limits.

---

### What you can build

- **Litigation intelligence** — track all cases mentioning a company, patent, statute, or topic.
- **Legal research automation** — assemble a citation-ranked corpus on an issue.
- **Docket monitoring** — watch new filings in a court or matter on a schedule.
- **AI / legal-tech** — feed opinions into a RAG pipeline or case-summarization model.
- **Compliance & risk** — surface enforcement actions and rulings by topic.

---

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `query` | string | `patent infringement` | Words or quoted phrase. |
| `resultType` | enum | `opinions` | `opinions` (case law) or `dockets` (RECAP). |
| `court` | string | — | Restrict to a court id (e.g. `scotus`, `ca9`). |
| `dateFrom` / `dateTo` | string | — | Filing-date window `YYYY-MM-DD`. |
| `maxResults` | integer | 200 | Max records. |
| `apiToken` | string | — | Optional free CourtListener token (higher limits). |

#### Example

```json
{ "query": "\"summary judgment\"", "resultType": "opinions", "court": "ca9", "dateFrom": "2020-01-01", "maxResults": 500 }
````

***

### Output

```json
{
  "case_name": "In Re '318 Patent Infringement Litigation",
  "court": "District Court, D. Delaware",
  "court_id": "ded",
  "date_filed": "2008-09-26",
  "docket_number": "Civ. 05-356-SLR",
  "judge": "Sue L. Robinson",
  "citations": ["578 F. Supp. 2d 711"],
  "cite_count": 1,
  "status": "Published",
  "url": "https://www.courtlistener.com/opinion/2404252/in-re-318-patent-infringement-litigation/",
  "scraped_at": "2026-06-12T00:00:00.000Z"
}
```

A final `{"_type":"summary"}` record reports total matches and how many were returned.

***

### Pricing

**First 25 records free per account**, then **$0.003 per record**. Zero charge on empty searches. No monthly rental. No API key required (a free token just raises rate limits).

***

### FAQ

**Do I need a key?** No. Keyless by default; a free CourtListener token raises your rate limit for large pulls.

**Opinions vs dockets?** Opinions are published case law; dockets are RECAP federal case dockets. Pick with `resultType`.

**How do I restrict to a court?** Pass the CourtListener `court` id (e.g. `scotus`, `ca9`, `ded`).

**Is this legal?** Yes — CourtListener is the Free Law Project's open API for public court records.

# Actor input Schema

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

Words or a quoted phrase to search across case text (e.g. patent infringement, "summary judgment").

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

Opinions (case law) or RECAP dockets (federal case dockets).

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

Restrict to a court by CourtListener court id (e.g. scotus, ca9, ded). Leave empty for all courts.

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

Only cases filed on or after this date.

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

Only cases filed on or before this date.

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

Maximum number of records to return.

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

A free CourtListener token raises rate limits. Leave blank for keyless access (lower limits, fine for most runs).

## Actor input object example

```json
{
  "query": "patent infringement",
  "resultType": "opinions",
  "maxResults": 25,
  "apiToken": ""
}
```

# 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",
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("themineworks/courtlistener-court-records").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",
    "maxResults": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("themineworks/courtlistener-court-records").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 '{
  "query": "patent infringement",
  "maxResults": 25
}' |
apify call themineworks/courtlistener-court-records --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CourtListener Scraper - US Court Opinions & Case Law",
        "description": "Affordable CourtListener scraper: US court opinions, dockets & case law. $3/1,000 results, 25 free, pay-per-result, no subscription. Works in Claude, ChatGPT & any MCP-compatible AI agent.",
        "version": "0.1",
        "x-build-id": "S2gYMQUXLYBHKHGDi"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/themineworks~courtlistener-court-records/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-themineworks-courtlistener-court-records",
                "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/themineworks~courtlistener-court-records/runs": {
            "post": {
                "operationId": "runs-sync-themineworks-courtlistener-court-records",
                "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/themineworks~courtlistener-court-records/run-sync": {
            "post": {
                "operationId": "run-sync-themineworks-courtlistener-court-records",
                "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",
                "required": [
                    "query"
                ],
                "properties": {
                    "query": {
                        "title": "Search query",
                        "type": "string",
                        "description": "Words or a quoted phrase to search across case text (e.g. patent infringement, \"summary judgment\")."
                    },
                    "resultType": {
                        "title": "Result type",
                        "enum": [
                            "opinions",
                            "dockets"
                        ],
                        "type": "string",
                        "description": "Opinions (case law) or RECAP dockets (federal case dockets).",
                        "default": "opinions"
                    },
                    "court": {
                        "title": "Court ID",
                        "type": "string",
                        "description": "Restrict to a court by CourtListener court id (e.g. scotus, ca9, ded). Leave empty for all courts."
                    },
                    "dateFrom": {
                        "title": "Filed on/after (YYYY-MM-DD)",
                        "type": "string",
                        "description": "Only cases filed on or after this date."
                    },
                    "dateTo": {
                        "title": "Filed on/before (YYYY-MM-DD)",
                        "type": "string",
                        "description": "Only cases filed on or before this date."
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of records to return.",
                        "default": 200
                    },
                    "apiToken": {
                        "title": "CourtListener API token (optional)",
                        "type": "string",
                        "description": "A free CourtListener token raises rate limits. Leave blank for keyless access (lower limits, fine for most runs).",
                        "default": ""
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
