# CourtListener Scraper (`maximedupre/courtlistener`) Actor

Search public CourtListener opinions, federal RECAP dockets, and oral arguments with one full-text query. Filter supported records by court, dates, judges, citations, or docket numbers, then save structured records with source links.

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

## Pricing

$0.90 / 1,000 court records

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

### ⚖️ Search CourtListener case law and dockets

Legal researchers, compliance teams, journalists, and developers can search public CourtListener records with one full-text query. Get structured opinions, federal RECAP dockets, or oral arguments with available court, date, citation, docket, and source-link data for review and downstream work.

- Search public RECAP records with **[Recap Pacer](https://apify.com/maximedupre/courtlistener/examples/recap-pacer)** and a focused full-text query.
- Review older public federal records with **[Recap Archive](https://apify.com/maximedupre/courtlistener/examples/recap-archive)** and source links.
- Find a case by party or case text with **[Free Court Case Lookup](https://apify.com/maximedupre/courtlistener/examples/free-court-case-lookup)**.
- Narrow a federal case search by court, date, or record type with **[How To Look Up Federal Court Cases](https://apify.com/maximedupre/courtlistener/examples/how-to-look-up-federal-court-cases)**.
- Search public records by a party or case name with **[Pacer Case Lookup By Name](https://apify.com/maximedupre/courtlistener/examples/pacer-case-lookup-by-name)**.

#### 📚 CourtListener records you can review

**What you get**

Each saved row is one CourtListener record. Choose opinions, Federal dockets / RECAP records, or Oral arguments. Rows include the case name, record type, record ID, and source URL, and can include court, date, status, and fields for the selected record type. CourtListener may not provide every field for every record, so optional fields can be empty or missing.

Opinion rows can include the author, panel, citations, citation count, opinion type, excerpts, a document URL, and full opinion text when requested and available. Docket rows can include docket details, judges, nature of suit, filing entries, document links, and page counts when CourtListener provides them. Oral-argument rows can include the panel, duration, text snippet, and audio URL.

The Actor returns public source data for research and review. It does not give legal advice, explain what the law means, or decide a case outcome.

#### ▶️ Search CourtListener records

**Run steps**

1. Choose a target: Opinions, Federal dockets / RECAP records, or Oral arguments.
2. Enter one full-text query, such as `habeas corpus` or a party name.
3. Add filters that match the target, such as a court, date range, judge, citation, docket number, or nature of suit.
4. For Opinions, choose the sort order and turn on full opinion text when you need it.
5. Set `Maximum records per run`, or leave it blank to return all available records until the source is exhausted.
6. Start the run and open the dataset or the run summary.

Each run uses one search setup. Filters for another record type are ignored. CourtListener controls which public records and fields are available for a match.

#### ⚙️ Input

**Input fields**

| Field | Type | What it does |
| --- | --- | --- |
| `target` | enum string | Chooses `opinions`, `dockets`, or `oralArguments`. |
| `query` | string | Required full-text words or phrase for the selected CourtListener record type. |
| `court` | string | Optionally limits matches to a CourtListener court or jurisdiction ID. |
| `judge` | string | For Opinions, filters by judge or author name. It is ignored for Federal dockets / RECAP records and Oral arguments. |
| `citation` | string | For Opinions, filters by citation. It is ignored for Federal dockets / RECAP records and Oral arguments. |
| `sortBy` | enum string | For Opinions, orders results by `relevance`, `dateFiled`, or `citationCount`. |
| `includeFullText` | boolean | For Opinions, asks for full opinion text when CourtListener provides it. It is ignored for Federal dockets / RECAP records and Oral arguments. |
| `natureOfSuit` | string | For Federal dockets / RECAP records, filters by nature of suit. It is ignored for Opinions and Oral arguments. |
| `docketNumber` | string | Filters Opinions and Federal dockets / RECAP records by docket number. It is ignored for Oral arguments. |
| `startDate` | string (`YYYY-MM-DD`) | Includes Opinions and Federal dockets / RECAP records filed on or after this date, or Oral arguments dated on or after it. |
| `endDate` | string (`YYYY-MM-DD`) | Includes Opinions and Federal dockets / RECAP records filed on or before this date, or Oral arguments dated on or before it. |
| `maxItems` | integer | Stops after this many records. Leave it empty to return all available records until the source is exhausted. |

`target` and `query` are required. Date values must use `YYYY-MM-DD`. Fields that do not apply to the selected target are ignored.

**Example input**

This is the public input from a successful current-beta default-style run:

```json
{
  "target": "opinions",
  "sortBy": "relevance",
  "includeFullText": false,
  "query": "habeas corpus",
  "maxItems": 1
}
```

#### 🧾 Output

**Run summary**

The Actor also publishes a run summary with links and counts:

| Field | Type | What it does |
| --- | --- | --- |
| `datasetUrl` | string | URL for the dataset that holds the returned records. |
| `returnedRecords` | string | Number of records saved in the dataset. |
| `sourceTotalAvailable` | string | Total matches reported by CourtListener, when available. |

**Opinion rows**

| Field | Type | What it does |
| --- | --- | --- |
| `recordType` | string | The record type, `opinion`. |
| `recordId` | string | Stable ID for the CourtListener record. |
| `caseName` | string | Name of the case. |
| `court` | object | Court and jurisdiction details for the record. |
| `court.name` | string | Name of the court. |
| `court.id` | string | CourtListener court or jurisdiction ID. |
| `court.jurisdiction` | string | Jurisdiction linked to the court. |
| `recordDate` | string | Filing date for the opinion. |
| `status` | string | Status reported by CourtListener. |
| `sourceUrl` | string | CourtListener page for the opinion. |
| `opinion` | object | Details available for the opinion. |
| `opinion.author` | string | Judge or author named for the opinion. |
| `opinion.panel` | string\[] | Judges listed on the opinion panel. |
| `opinion.dateArgued` | string | Date the case was argued, when given. |
| `opinion.documentUrl` | string | URL for downloading the opinion document. |
| `opinion.citations` | string\[] | Reporter citations listed for the opinion. |
| `opinion.citationCount` | integer | Number of citations reported for the opinion. |
| `opinion.opinionType` | string | Type of opinion reported by CourtListener. |
| `opinion.opinionCount` | integer | Number of opinions in the source case record, when given. |
| `opinion.syllabus` | string | Source-provided syllabus text, when available. |
| `opinion.proceduralHistory` | string | Source-provided procedural history, when available. |
| `opinion.excerpt` | string | Source-provided opinion excerpt, when available. |
| `opinion.fullText` | string | Full opinion text when requested and available. |

**Opinion example**

This is a shortened row from a successful current-beta opinion run with full opinion text requested. The `fullText` value is the public-copy omission marker `"..."`; the other shown values are from the returned row.

```json
{
  "recordType": "opinion",
  "recordId": "4521308",
  "caseName": "In re Habeas Corpus by Snyder",
  "court": {
    "name": "Supreme Court of Kansas",
    "id": "kan",
    "jurisdiction": "S"
  },
  "recordDate": "2018-07-27",
  "status": "Published",
  "sourceUrl": "https://www.courtlistener.com/opinion/4521308/in-re-habeas-corpus-by-snyder/",
  "opinion": {
    "author": "Stegall",
    "citations": [
      "422 P.3d 1152"
    ],
    "citationCount": 6,
    "opinionType": "combined-opinion",
    "opinionCount": 1,
    "excerpt": "\n\n\n  The opinion of the court was delivered by Stegall, J:\n \n\n  In May 2013, the Saline County District Court first found Clay Robert Snyder not competent to stand trial because of his intellectual disability. Since then, Snyder has cycled through competency detainment and involuntary commitment at least twice. Most recently in November 2016, the district court found Snyder was still not compete",
    "fullText": "...",
    "documentUrl": "http://www.kscourts.org/Cases-and-Opinions/Opinions/SupCt/2018/20180727/117167.pdf"
  }
}
```

**Docket rows**

| Field | Type | What it does |
| --- | --- | --- |
| `recordType` | string | The record type, `docket`. |
| `recordId` | string | Stable ID for the CourtListener record. |
| `caseName` | string | Name of the case. |
| `court` | object | Court and jurisdiction details for the record. |
| `court.name` | string | Name of the court. |
| `court.id` | string | CourtListener court or jurisdiction ID. |
| `court.jurisdiction` | string | Jurisdiction linked to the court. |
| `recordDate` | string | Filing date for the docket. |
| `status` | string | Status reported by CourtListener, when available. |
| `sourceUrl` | string | CourtListener page for the docket. |
| `docket` | object | Federal docket and RECAP details. |
| `docket.docketNumber` | string | Docket number reported by the source. |
| `docket.dateTerminated` | string | Date the docket was terminated, when given. |
| `docket.dateLastFiling` | string | Date of the latest docket filing, when given. |
| `docket.natureOfSuit` | string | Nature of suit for the docket, when available. |
| `docket.assignedJudges` | string\[] | Judges assigned to the docket. |
| `docket.referredJudges` | string\[] | Judges referred to the docket. |
| `docket.entries` | object\[] | Filing entries and documents listed for the docket. |
| `docket.entries[].entryId` | string | Stable ID for a docket entry. |
| `docket.entries[].entryNumber` | string | Docket entry number reported by the source. |
| `docket.entries[].dateFiled` | string | Date the docket entry was filed. |
| `docket.entries[].description` | string | Source description of the docket entry. |
| `docket.entries[].pageCount` | integer | Number of pages in the entry, when given. |
| `docket.entries[].documents` | object\[] | Documents linked to the docket entry. |
| `docket.entries[].documents[].documentId` | string | Stable ID for the source document. |
| `docket.entries[].documents[].documentNumber` | string | Document number reported by the source. |
| `docket.entries[].documents[].description` | string | Source description of the document. |
| `docket.entries[].documents[].pageCount` | integer | Number of pages in the document, when given. |
| `docket.entries[].documents[].downloadUrl` | string | URL for downloading the document, when available. |
| `docket.entries[].documents[].sourceUrl` | string | Source page for the document, when useful. |

**Docket example**

This is an unshortened row from a successful current-beta docket run. Optional fields that CourtListener did not return are not added.

```json
{
  "recordType": "docket",
  "recordId": "8366557",
  "caseName": "Fuentes v. Habeas Corpus",
  "court": {
    "name": "District Court, S.D. New York",
    "id": "nysd",
    "jurisdiction": "FD"
  },
  "recordDate": "2018-11-30",
  "sourceUrl": "https://www.courtlistener.com/docket/8366557/fuentes-v-habeas-corpus/",
  "docket": {
    "docketNumber": "1:18-cv-11232",
    "dateTerminated": "2019-01-11",
    "natureOfSuit": "550 Prisoner - civil rights",
    "assignedJudges": [
      "Colleen McMahon"
    ],
    "entries": [
      {
        "entryId": "453256104",
        "entryNumber": "1",
        "dateFiled": "2018-11-30",
        "description": "COMPLAINT against D.O.D, Habeas Corpus, NYS DOCCS, The Pentagon, The VA. Document filed by Peter Fuentes. (ks) (Entered: 12/04/2018)",
        "documents": [
          {
            "documentId": "468143576",
            "documentNumber": "1",
            "description": "COMPLAINT against D.O.D, Habeas Corpus, NYS DOCCS, The Pentagon, The VA. Document filed by Peter Fuentes. (ks) (Entered: 12/04/2018)",
            "sourceUrl": "https://www.courtlistener.com/docket/8366557/1/fuentes-v-habeas-corpus/"
          }
        ]
      },
      {
        "entryId": "453256106",
        "dateFiled": "2018-11-30",
        "description": "Case Designated ECF. (ks)",
        "documents": [
          {
            "documentId": "468143578",
            "description": "Case Designated ECF. (ks)"
          }
        ]
      },
      {
        "entryId": "453256107",
        "entryNumber": "3",
        "dateFiled": "2018-12-04",
        "description": "ORDER DIRECTING PAYMENT OF FEE OR IFP APPLICATION: Plaintiff is directed to render payment of the filing fee or submit an IFP application to this Court's Pro Se Office within thirty (30) days of the date of this Order. The Clerk of Court is directed to assign this matter to my docket. The Court certifies, pursuant to 28 U.S.C. § 1915(a)(3), that any appeal from this Order would not be taken in good faith, and therefore in forma pauperis status is denied for the purpose of an appeal. See Coppedge v. United States, 369 U.S. 438, 444 (1962). Filing Fee due by 1/3/2019. In Forma Pauperis (IFP) Application due by 1/3/2019. (Signed by Judge Colleen McMahon on 12/4/2018) (Attachments: # 1 IFP application)(keb) Transmission to Docket Assistant Clerk for processing. (Entered: 12/04/2018)",
        "documents": [
          {
            "documentId": "468143579",
            "documentNumber": "3",
            "description": "ORDER DIRECTING PAYMENT OF FEE OR IFP APPLICATION: Plaintiff is directed to render payment of the filing fee or submit an IFP application to this Court's Pro Se Office within thirty (30) days of the date of this Order. The Clerk of Court is directed to assign this matter to my docket. The Court certifies, pursuant to 28 U.S.C. § 1915(a)(3), that any appeal from this Order would not be taken in good faith, and therefore in forma pauperis status is denied for the purpose of an appeal. See Coppedge v. United States, 369 U.S. 438, 444 (1962). Filing Fee due by 1/3/2019. In Forma Pauperis (IFP) Application due by 1/3/2019. (Signed by Judge Colleen McMahon on 12/4/2018) (Attachments: # 1 IFP application)(keb) Transmission to Docket Assistant Clerk for processing. (Entered: 12/04/2018)",
            "sourceUrl": "https://www.courtlistener.com/docket/8366557/3/fuentes-v-habeas-corpus/"
          }
        ]
      }
    ]
  }
}
```

**Oral-argument rows**

| Field | Type | What it does |
| --- | --- | --- |
| `recordType` | string | The record type, `oralArgument`. |
| `recordId` | string | Stable ID for the CourtListener record. |
| `caseName` | string | Name of the case. |
| `court` | object | Court and jurisdiction details for the record. |
| `court.name` | string | Name of the court. |
| `court.id` | string | CourtListener court or jurisdiction ID. |
| `court.jurisdiction` | string | Jurisdiction linked to the court. |
| `recordDate` | string | Argument date for the oral argument. |
| `status` | string | Status reported by CourtListener, when available. |
| `sourceUrl` | string | CourtListener page for the oral argument. |
| `oralArgument` | object | Details available for the oral argument. |
| `oralArgument.durationSeconds` | integer | Length of the oral argument in seconds, when given. |
| `oralArgument.panel` | string\[] | Judges listed for the oral argument. |
| `oralArgument.textSnippet` | string | Text snippet from the oral argument, when available. |
| `oralArgument.audioUrl` | string | URL for downloading the oral-argument audio. |

**Oral-argument example**

This is an unshortened row from a successful current-beta oral-argument run.

```json
{
  "recordType": "oralArgument",
  "recordId": "106003",
  "caseName": "Sherrod Brown v. FCC",
  "court": {
    "name": "Court of Appeals for the Fourth Circuit",
    "id": "ca4",
    "jurisdiction": "F"
  },
  "recordDate": "2026-08-07",
  "sourceUrl": "https://www.courtlistener.com/audio/106003/sherrod-brown-v-fcc/",
  "oralArgument": {
    "durationSeconds": 4655,
    "panel": [
      "Robert Bruce King",
      "James Andrew Wynn jr"
    ],
    "textSnippet": "The Honorable, the Judges of the United States Court of Appeals for the Fourth Circuit. Oyez, oyez, oyez. All persons having any manner or form of business before the Honorable of the United States Court of Appeals for the Fourth Circuit are admonished to draw a nod and give their attention till the Court is now sitting. The Honorable, the Judges of the United States Court of Appeals for the Fourth Circuit are admonished to draw a nod and give their attention till the Court is now sitting. We",
    "audioUrl": "http://www.ca4.uscourts.gov/OAarchive/mp3/26-1785-20260807.mp3"
  }
}
```

#### 💳 Pricing

**How charging works**

The Actor uses pay-per-event pricing. The current charge is `$0.0009` for each opinion, federal docket, or oral argument that is successfully saved to the dataset. The charge follows the saved public record, not a separate setup step.

Set `maxItems` when you want a smaller result set. Leave it blank to return all available records until the source is exhausted; the number of saved records then depends on the matches CourtListener provides.

#### 🔌 Integrations

**Use with Apify**

Start runs in Apify Console or through the Apify API, then use `datasetUrl` to read the default dataset or export it from Apify. The Actor does not send records directly to outside services.

https://www.youtube.com/watch?v=bNACk1\_S\_6w\&list=PLObrtcm1Kw6MUrlLNDbK9QRg8VDJg0gOW\&index=4

#### ❓ FAQ

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

No. This Actor searches the public CourtListener service without a source credential field. CourtListener still controls public availability and rate limits.

##### Can I search opinions, RECAP dockets, and oral arguments?

Yes. Choose the matching value in `target`: `opinions`, `dockets`, or `oralArguments`. Filters that do not apply to that target are ignored.

##### Can I search for a party or case name?

Yes. Put the party or case name in `query`. For Opinions and Federal dockets / RECAP records, you can also use `docketNumber` when you know it.

##### Can I request full opinion text?

For Opinions, set `includeFullText` to `true`. Full text is returned only when CourtListener provides it for the opinion.

##### Why is a field empty or missing?

CourtListener does not provide every legal field for every record. Check the record's `sourceUrl` when you need to confirm a value.

##### How many records can a run return?

Set `maxItems` to stop after a chosen number of records. Leave it blank to return all available records until the source is exhausted; this schema does not set a fixed maximum.

##### Can one run use more than one search setup?

No. Each run uses one target, one query, and one set of filters. Start another run for a different search setup.

##### Does this Actor give legal advice?

No. It returns public CourtListener records and source links for research and review. It does not interpret the law or predict a case outcome.

### 📝 Changelog

**0.0: Initial release**

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~courtlistener/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Related Actors

- [Harris County Court Records Scraper](https://apify.com/maximedupre/harris-county-court-records-scraper) — Search public local probate and civil cases by party, attorney, company, or filing date.
- [Federal Register Scraper — Rules & Regulations](https://apify.com/maximedupre/federal-register) — Find official rules, notices, and agency documents alongside court research.
- [FCC ECFS Filings](https://apify.com/maximedupre/fcc-ecfs) — Review public FCC proceeding filings, filer details, and document links.
- [CourtListener Scraper — 16 Fields, Opinions & Dockets](https://apify.com/themineworks/courtlistener-court-records) — Compare another CourtListener search for opinions and dockets.
- [CourtListener Federal Docket Scraper — RECAP API](https://apify.com/nexgendata/courtlistener-federal-docket-scraper) — Focus on federal docket numbers, parties, and filing activity.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

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

Choose the CourtListener record type to search.

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

For Opinions, filter by a judge or author name. Leave blank for Federal dockets / RECAP records and Oral arguments; this value is ignored there.

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

For Opinions, filter by a citation. Leave blank for Federal dockets / RECAP records and Oral arguments; this value is ignored there.

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

For Opinions, choose the order of results. Leave blank for Federal dockets / RECAP records and Oral arguments; this value is ignored there.

## `includeFullText` (type: `boolean`):

For Opinions, request the full opinion text when CourtListener provides it. Leave this off for Federal dockets / RECAP records and Oral arguments; the value is ignored there.

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

For Federal dockets / RECAP records, filter by nature of suit. Leave blank for Opinions and Oral arguments; this value is ignored there.

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

Enter words or a phrase to search the selected CourtListener record type.

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

Optionally enter a CourtListener court or jurisdiction ID to narrow matching records.

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

Optionally enter a docket number to filter Opinions and Federal dockets / RECAP records. This value is ignored for Oral arguments.

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

For Opinions and Federal dockets / RECAP records, use the filing date. For Oral arguments, use the argument date. Include records on or after this date. Enter YYYY-MM-DD.

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

For Opinions and Federal dockets / RECAP records, use the filing date. For Oral arguments, use the argument date. Include records on or before this date. Enter YYYY-MM-DD.

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

Stop after this many records. Leave it blank to return all available records until the source is exhausted.

## Actor input object example

```json
{
  "target": "opinions",
  "sortBy": "relevance",
  "includeFullText": false,
  "query": "habeas corpus",
  "maxItems": 1
}
```

# Actor output Schema

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

URL for the dataset with the returned records.

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

Number of records saved in the dataset.

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

Total matches reported by CourtListener, when available.

# 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 = {
    "target": "opinions",
    "sortBy": "relevance",
    "query": "habeas corpus",
    "maxItems": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/courtlistener").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 = {
    "target": "opinions",
    "sortBy": "relevance",
    "query": "habeas corpus",
    "maxItems": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/courtlistener").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 '{
  "target": "opinions",
  "sortBy": "relevance",
  "query": "habeas corpus",
  "maxItems": 1
}' |
apify call maximedupre/courtlistener --silent --output-dataset

```

## MCP server setup

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

```

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/ZZQ0hKomtAeQsEUJx/builds/qdkCoKEoiUf4QBTQa/openapi.json
