Skip to content

About

PACER scraper API: PACER Docket Details, PACER Docket Search as clean JSON. Python examples with requests, Scrapy, asyncio and the DataGuru SDK.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

PACER Scraper API

Scrape PACER with a JSON API. This repo has working Python examples for DataGuru's PACER scraper APIs: PACER Docket Details and PACER Docket Search.

DataGuru runs the scraping, proxies, retries and parsing, and returns clean JSON. You pay only for successful requests, from $0.0012 per request, out of a prepaid balance: no subscription. New accounts get $1.00 of free credit.

PACER APIs

API What it returns Price Page
PACER Docket Details Get a US federal court docket from PACER records in the free RECAP archive, with case name, docket number, court and the 30 most recent docket entries, their filing dates, docket text and document links. $0.0022 https://dataguru.cc/apis/pacer-docket-details/
PACER Docket Search Search US federal court filings from PACER records in the free RECAP archive by keyword, court, case name, docket number, party or filing date and get up to 20 of the newest matching documents with case names, courts, filing dates, text excerpts and docket links. $0.0012 https://dataguru.cc/apis/pacer-docket-search/

Quick start

  1. Create a free account and an API key at dashboard.dataguru.cc.
  2. Install and run:
git clone https://github.com/dataguru-cc/pacer-scraper-api.git
cd pacer-scraper-api
pip install -r requirements.txt
export DATAGURU_API_KEY="your key"
python examples/sdk_example.py pacer-docket-details

Examples

Every example covers all 2 PACER APIs. Pass an API name to run just one; with no name each script runs them all, and each call is billed at the price above.

File Style Run
examples/sdk_example.py DataGuru Python SDK (pip install dataguru-sdk), one function per API, saves JSON to output/ python examples/sdk_example.py
examples/requests_example.py Plain requests, synchronous python examples/requests_example.py
examples/async_example.py asyncio + httpx, concurrent with a limit python examples/async_example.py
examples/scrapy_spider.py Scrapy spider, items to JSON/CSV scrapy runspider examples/scrapy_spider.py -O pacer.json

All requests use the header Authorization: Api-Key YOUR_API_KEY. Errors return {"success": false, "error": {"code", "message", "request_id"}}, with HTTP 402 when the balance runs out and 429 (with Retry-After) when rate limited. Failed requests are not charged.

API reference

PACER Docket Details

Get a US federal court docket from PACER records in the free RECAP archive, with case name, docket number, court and the 30 most recent docket entries, their filing dates, docket text and document links.

Parameter Type Required Description
docket_url string yes RECAP docket URL from PACER Docket Search (e.g. https://www.courtlistener.com/docket/4214664/national-veterans-legal-services-program-v-united-states/) or its numeric docket ID.

Response fields: docket_id, case_name, docket_number, court_id, docket_url, latest_entry_date, source, returned_entries, free_documents, entries, error, plus _metadata

curl -X POST "https://api.dataguru.cc/api/v1/pacer/dockets/details" \
  -H "Authorization: Api-Key $DATAGURU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"docket_url": "https://www.courtlistener.com/docket/4214664/national-veterans-legal-services-program-v-united-states/"}'
Response schema

Values are type placeholders from the API's published schema, not real data.

{
  "docket_id": 0,
  "case_name": "string",
  "docket_number": "string",
  "court_id": "1234567890",
  "docket_url": "https://example.com/...",
  "latest_entry_date": "2026-01-01T12:00:00Z",
  "source": "string",
  "returned_entries": 0,
  "free_documents": 0,
  "entries": [
    {
      "entry_number": 0,
      "date_filed": "string",
      "description": "string",
      "document_url": "https://example.com/...",
      "free_document": false,
      "entry_url": "https://example.com/..."
    }
  ],
  "error": "string",
  "_metadata": {
    "request_id": "3f6c1a2e-8b4d-4c1e-9a7f-2d5e6b7c8d9e",
    "execution_time_ms": 842,
    "endpoint": "PACER Docket Details",
    "mode": "live",
    "format": "json",
    "timestamp": "2026-01-01T12:00:00+00:00"
  }
}

PACER Docket Search

Search US federal court filings from PACER records in the free RECAP archive by keyword, court, case name, docket number, party or filing date and get up to 20 of the newest matching documents with case names, courts, filing dates, text excerpts and docket links.

Parameter Type Required Description
case_name string no Only cases whose name matches this text, e.g. "Apple".
court string no Only these courts, as comma-separated court IDs, e.g. "nysd" or "cand,txwd".
docket_number string no Only the case with this docket number, e.g. "1:16-cv-00745".
filed_after string no Only documents filed on or after this date (YYYY-MM-DD).
filed_before string no Only documents filed on or before this date (YYYY-MM-DD).
limit integer no Maximum number of filings to return (1-20, newest first). For older filings, set filed_before. Default: 20.
nature_of_suit string no Only cases of this nature of suit, e.g. "Patent" or "Civil Rights".
party_name string no Only cases with a party of this name, e.g. "Amazon.com, Inc.".
query string no Search keywords in the filed documents, e.g. "motion to dismiss". Supports quoted phrases and AND/OR. Optional when case_name, docket_number or party_name is set.

Response fields: query, filters, sort, source, returned_results, results, error, plus _metadata

curl -X POST "https://api.dataguru.cc/api/v1/pacer/dockets/search" \
  -H "Authorization: Api-Key $DATAGURU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "motion to dismiss", "limit": 5}'
Response schema

Values are type placeholders from the API's published schema, not real data.

{
  "query": "string",
  "filters": {
    "court": "string",
    "case_name": "string",
    "docket_number": "string",
    "party_name": "string",
    "nature_of_suit": "string",
    "filed_after": "string",
    "filed_before": "string"
  },
  "sort": "newest",
  "source": "string",
  "returned_results": 0,
  "results": [
    {
      "case_name": "string",
      "court": "string",
      "date_filed": "string",
      "docket_id": 0,
      "document_number": 0,
      "attachment_number": 0,
      "snippets": [
        "string"
      ],
      "document_url": "https://example.com/...",
      "docket_url": "https://example.com/..."
    }
  ],
  "error": "string",
  "_metadata": {
    "request_id": "3f6c1a2e-8b4d-4c1e-9a7f-2d5e6b7c8d9e",
    "execution_time_ms": 842,
    "endpoint": "PACER Docket Search",
    "mode": "live",
    "format": "json",
    "timestamp": "2026-01-01T12:00:00+00:00"
  }
}

More

License

The example code is MIT licensed. Use of the DataGuru API is subject to the terms of service.

About

PACER scraper API: PACER Docket Details, PACER Docket Search as clean JSON. Python examples with requests, Scrapy, asyncio and the DataGuru SDK.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors