# US Federal Court Documents | RECAP PDFs and Docket Entries (`s-r/us-court-documents`) Actor

Retrieve federal court documents from public RECAP dockets: main filings, attachments, PDF links, availability and optional extracted text. Join cases to documents using stable public identifiers.

- **URL**: https://apify.com/s-r/us-court-documents.md
- **Developed by:** [SR](https://apify.com/s-r) (community)
- **Categories:** Business, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 court document rows

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

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

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

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

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

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

# README

## US federal court documents: RECAP PDFs and docket entries

Retrieve federal court documents from public CourtListener RECAP dockets, with main filings, attachments, observed PDF links and stable identifiers. Start with a docket ID to list the public filings in one case, or use a query to discover matching documents across cases, then hand the rows to litigation diligence or litigation finance screens. The actor returns structured document rows that can be joined to the cases returned by CourtListener Court Records Scraper.

### What federal court documents can you retrieve?

The actor reads publicly accessible docket entries and creates one row for each numbered main document and each listed attachment. A filing with twelve attachments therefore produces thirteen separate rows when attachments are enabled. Every row carries its filing date, case identity, document number, description and source URL whenever the source supplies those values. PDF links are copied from the source rather than constructed from document numbers.

Documents that exist on a docket but have no public RECAP copy remain useful records. By default, they are delivered with `is_available: false` and `pdf_url: null`. This lets diligence workflows distinguish an unavailable filing from a missing docket entry. Set `available_only: true` to deliver only rows with an observed PDF URL. The actor does not buy documents on PACER, access sealed material or download PDF files into your storage.

### Input

Supply `docket_id` or `query`. A docket ID comes from a CourtListener docket URL or the `docket_id` and `case_id` fields of a case record. For example, the public Angela Patent docket is `45814286`. A useful first input is:

```json
{"docket_id":45814286,"max_items":100}
```

Use `document_number` for an exact main filing number, including its attachments when enabled. This recorded example requests the filing and attachments numbered 1904 in Apple v. Samsung:

```json
{"docket_id":4178089,"document_number":1904,"max_items":100}
```

You can also supply `document_number_min` and `document_number_max` for an inclusive entry range. These filters require a docket ID. Use either the exact number or a range. `include_attachments` defaults to true; disabling it returns main documents only.

`filed_after` and `filed_before` accept valid dates in YYYY-MM-DD form. Both boundaries are inclusive and always refer to the document filing date. `sort` accepts `date_asc` or `date_desc` and controls source document date ordering. Attachments stay grouped with their entry.

A `query` uses public RECAP search syntax. When combined with `docket_id`, it searches within that case. Without a docket ID, it searches across cases and accepts a `court` filter containing lowercase CourtListener court IDs. Date filters still apply to document dates in either search mode.

`max_items` limits the total delivered rows, including attachments, across continuation requests. It defaults to 100 and accepts values from 1 through 5000. `maxItems` is an alias. If you supply both names, their values must agree. `include_text` requests available extracted document text and the numeric source document ID.

### Output

The default dataset contains `court_document` rows. Their `document_id` uses public coordinates: `recap:<docket_id>:<document_number>`. Attachments include the attachment suffix, such as `recap:4178089:1904-1`. These coordinates match the related CourtListener scraper. They are distinct from `source_document_id`, which is the numeric RECAP identifier obtained from a document page when enrichment is requested.

Core fields include `source`, `fetched_at`, `document_id`, `case_id`, `case_name`, `docket_number`, `court_id`, `document_type`, `document_number`, `description`, `filing_date`, `page_count`, `pdf_url` and `url`. Additional fields describe attachment numbers, public availability, Internet Archive links and PACER identifiers when displayed. `pacer_price_usd` is source metadata; the actor performs no purchase.

Missing values remain null and appear in `unavailable_fields`. Docket pages do not expose page counts or full document text. Search results can expose page counts while lacking a direct PDF link. Optional document enrichment supplies available text and source links. An image-only document can have a PDF but no extracted text. Upload timestamps have no timezone suffix because the docket source does not reliably supply a timezone.

A recorded example, requested with `{"docket_id": 45814286, "document_number": 109, "max_items": 1}` and trimmed to the fields most integrations read:

```json
{
  "source": "us-court-documents",
  "_type": "court_document",
  "record_type": "court_document",
  "document_id": "recap:45814286:109",
  "docket_id": 45814286,
  "case_name": "Angela Patent",
  "docket_number": "10-32921",
  "court_id": "cob",
  "court": "United States Bankruptcy Court, D. Colorado",
  "entry_number": 109,
  "document_number": "109",
  "document_type": "PACER Document",
  "description": "Chapter 13 Trustee Final Report and Account. (Kiel, Douglas) (Entered: 03/11/2016)",
  "filing_date": "2016-03-11",
  "url": "https://www.courtlistener.com/docket/45814286/109/angela-patent/",
  "pdf_url": "https://storage.courtlistener.com/recap/gov.uscourts.cob.319795/gov.uscourts.cob.319795.109.0.pdf",
  "is_available": true,
  "pacer_price_usd": 0.3,
  "unavailable_fields": ["attachment_number", "page_count", "source_document_id", "document_text", "snippet"]
}
```

The same row with its attachment suffix reads `recap:4178089:1904-1`, which is how a main filing and its exhibits arrive when `include_attachments` is left on.

The run output also includes warnings, partial status, source search counts and continuation information. Search counts describe source matches and do not promise that every matching document is accessible through the search interface.

### Use cases

Litigation diligence teams use the docket mode to inventory one case end to end: every numbered filing, every attachment, the filing date of each and the link to the document itself, so a reviewer can read what was actually filed instead of guessing from the docket text. Litigation finance desks run the same inventory across many dockets at once, ordered by date, to see how a matter developed over time and which documents exist before committing capital. Law firms and corporate legal teams watch a case they already know by docket ID and keep the public coordinates of each filing in their own system. Researchers and journalists search across cases for a phrase such as a motion to compel and then follow the docket IDs they discover into a complete document set.

### Federal court documents compared with PACER and with case search

PACER is the official route to federal court documents and charges per document viewed, which needs an account and a per-case budget. This actor performs no purchase: it delivers what the public RECAP archive already holds, reports `is_available: false` for filings whose contents were never contributed, and shows `pacer_price_usd` only as source metadata.

Searching CourtListener yourself is free but returns a limited selection of documents per case, and the raw API needs your own key and paging code. This actor wraps that paging into continuation cursors, keeps the document identities stable across pages and returns one consistent row shape.

Case-oriented scrapers answer a different question: they return rows about a case, such as its caption, docket number, parties and filing date, without the list of documents filed in it. Where those rows tell you a case exists, these rows tell you what was filed, with attachments and PDF links. The related CourtListener Court Records Scraper supplies the cases, opinions and citations; this actor supplies the filings, and both sides share the same case identifiers so the two datasets join without mapping.

### Completeness and continuation

Docket mode follows the public next-page links and retains document identities across pages. Public search shows a limited selection of documents per case: approximately one hundred within a single case and usually only a few per case across cases. Search responses carry a warning and partial status. Follow a discovered docket ID without a query to retrieve its complete publicly listed document set, subject to your requested row limit.

Large requests continue in pieces. The Apify integration follows continuation tokens and combines delivered records. REST clients repeat the original filters with `cursor` set to `next_cursor` until it is null. Keep the other inputs unchanged. A partial response can also report unavailable enrichment or source limitations; inspect its warnings even after pagination finishes.

### Pricing

Billing follows delivered document rows. Each delivered main filing or attachment counts as one `court_document` event. When requested, a delivered non-empty extracted text counts as one `document_text` event. Failed enrichment and missing text do not count as text events. Empty results and validation failures produce no document rows. Check the actor's current Pricing tab for event rates before running a large collection.

The non-paying account limit is ten delivered rows per run, and text enrichment is disabled for that tier. This delivery limit includes attachments. It is a volume limit and does not change how delivered-row events are counted.

### FAQ

#### Do I need a CourtListener API key or PACER account?

No. The actor uses public records available without supplying either account. Availability depends on what the public RECAP archive contains.

#### Why is a document listed without a PDF?

The public docket establishes that the filing exists, while its contents may not have been contributed to RECAP. Keep those rows for docket completeness or enable `available_only` to exclude them.

#### Can I retrieve every matching document through search?

Public search limits how many documents it displays per case. Search is useful for discovery. For a complete case inventory, use docket mode without a query and follow continuation until completion.

#### Is extracted text the original PDF?

No. It is the text exposed by the public document page and may contain extraction errors or be unavailable. Use the source PDF link to inspect the original filing and verify quotations.

# Actor input Schema

## `docket_id` (type: `integer`):

CourtListener docket ID. Supply this or query. Joins courtlistener-scraper case_id.

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

Public RECAP search syntax. With docket_id searches within that case; otherwise returns a limited selection per matching case.

## `court` (type: `array`):

Lowercase CourtListener court ID or list; only for query without docket_id.

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

Inclusive document filing date, YYYY-MM-DD. Always filters entry dates, including search mode.

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

Inclusive document filing date, YYYY-MM-DD.

## `document_number` (type: `integer`):

Exact main entry number; requires docket_id. Includes its attachments when requested.

## `document_number_min` (type: `integer`):

Inclusive minimum entry number; requires docket_id, cannot combine with document_number.

## `document_number_max` (type: `integer`):

Inclusive maximum entry number; requires docket_id, cannot combine with document_number.

## `available_only` (type: `boolean`):

Deliver only documents with an observed PDF link. Search mode resolves document pages to check availability.

## `include_attachments` (type: `boolean`):

Include attachment rows with their own document coordinates.

## `include_text` (type: `boolean`):

Fetch document pages for available extracted text and numeric source IDs. Large requests continue with a cursor.

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

Document filing date order. Search uses entry_date_filed ordering; docket entries retain source date order, with attachments grouped under their entry.

## `max_items` (type: `integer`):

Total delivered document rows across all cursor pieces. Defaults to 100 when omitted.

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

Alias for max_items. If both are supplied their values must agree.

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

Opaque next_cursor from the previous response. Repeat all other inputs unchanged.

## Actor input object example

```json
{
  "docket_id": 45814286,
  "document_number": 109,
  "available_only": false,
  "include_attachments": true,
  "include_text": false,
  "sort": "date_asc",
  "max_items": 100
}
```

# Actor output Schema

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

Delivered document rows.

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

Counts and source warnings.

# 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 = {
    "docket_id": 45814286,
    "document_number": 109
};

// Run the Actor and wait for it to finish
const run = await client.actor("s-r/us-court-documents").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 = {
    "docket_id": 45814286,
    "document_number": 109,
}

# Run the Actor and wait for it to finish
run = client.actor("s-r/us-court-documents").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 '{
  "docket_id": 45814286,
  "document_number": 109
}' |
apify call s-r/us-court-documents --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,s-r/us-court-documents"
        }
    }
}
```

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/iAzcQjiwrsxxnh2wi/builds/shmDBoo6f1S18jPjd/openapi.json
