Prerequisites

Three things before your first query:

# 1. A Solana wallet funded with USDC
# 2. x402 client library installed
npm install x402

# 3. A federal case ID and court code to monitor
# Example: case_id="1:24-cv-01234", court_code="nysd"

No API key. No account registration. Your Solana wallet address is your identifier for rate limiting. Payment is authentication.

Endpoints

DocketLayer exposes three endpoints. Two require payment. One is always free.

GET /v1/case

Primary query endpoint. Returns current docket status including all new filings since your last_checked timestamp. $0.99 per query.

ParameterTypeRequiredDescription
case_idstringrequiredFederal case number e.g. 1:24-cv-01234
court_codestringrequiredCourt identifier e.g. nysd, deb, cand
last_checkedstringrequiredISO 8601 timestamp of your last query
document_typesarrayoptionalFilter by type: motion, order, judgment
callback_urlstringoptionalWebhook URL for async delivery
GET /v1/monitor

Lightweight change detection. Returns changed: true/false only. Designed for high-frequency polling loops where bandwidth matters. $0.99 per query.

GET /v1/status Free

Returns API operational status and current court coverage. No payment required. Use to verify connectivity and check coverage before paid queries.

Quick example

Your first query in three languages. The x402 client handles the payment flow automatically — your agent sees a single function call.

# Check coverage first (free)
curl https://api.docketlayer.com/v1/status

# Query a case
curl -X GET "https://api.docketlayer.com/v1/case" \
  -H "x402-payment: YOUR_USDC_PAYMENT" \
  -H "Content-Type: application/json" \
  -d '{
    "case_id": "1:24-cv-01234",
    "court_code": "nysd",
    "last_checked": "2026-01-01T00:00:00Z"
  }'
from x402 import PaymentClient
import os

client = PaymentClient(
  private_key=os.environ["SOLANA_PRIVATE_KEY"],
  network="solana-mainnet",
  currency="USDC"
)

result = client.get(
  "https://api.docketlayer.com/v1/case",
  json={
    "case_id": "1:24-cv-01234",
    "court_code": "nysd",
    "last_checked": "2026-01-01T00:00:00Z"
  }
).json()

if result["changed"]:
  print(result["new_filings"])
else:
  print("No changes")
import { createPaymentClient } from "x402";

const client = createPaymentClient({
  privateKey: process.env.SOLANA_PRIVATE_KEY,
  network: "solana-mainnet",
  currency: "USDC"
});

const result = await client.fetch(
  "https://api.docketlayer.com/v1/case",
  { body: JSON.stringify({
    case_id: "1:24-cv-01234",
    court_code: "nysd",
    last_checked: "2026-01-01T00:00:00Z"
  })}
).then(r => r.json());

console.log(result.changed ? result.new_filings : "No changes");
Response
{
  "case_id": "1:24-cv-01234",
  "court_code": "nysd",
  "changed": true,
  "queried_at": "2026-04-13T09:00:00Z",
  "new_filings": [{
    "filing_id": "nysd-2024-01234-0042",
    "filing_type": "order",
    "description": "Order granting motion to dismiss",
    "filed_at": "2026-04-13T08:47:22Z",
    "filed_by": "Judge Sarah Johnson",
    "document_url": "https://ecf.nysd.uscourts.gov/doc1/...",
    "document_access": "pacer_auth_required"
  }],
  "query_cost": 0.99,
  "coverage_status": "full"
}

x402 payment flow

DocketLayer uses the x402 protocol. Payment happens within the HTTP request cycle — your agent never leaves the function call.

# Step 1 — agent calls endpoint without payment
GET /v1/case → 402 Payment Required
# Response includes: amount, recipient wallet, accepted currency

# Step 2 — x402 client constructs USDC transaction
# Signs with agent wallet private key
# Retries request with payment proof in Authorization header

# Step 3 — DocketLayer verifies payment, returns data
GET /v1/case → 200 OK + docket JSON

# All of this happens in a single client.get() call

DocketLayer is also compatible with the Machine Payments Protocol (MPP). MPP clients query DocketLayer without modification — x402 and MPP are backwards compatible.

Error handling

DocketLayer never charges for failed queries. Build your agent to handle these gracefully.

CodeMeaningCharged
402Payment absent, invalid, or insufficientNo
400Malformed request or missing fieldsNo
404Case not found in specified courtNo
422Court code not recognized or not coveredNo
429Rate limit exceeded — retry_after field includedNo
503PACER or CM/ECF unavailableNo
200Successful queryYes — $0.99

Rate limits

Limits apply per Solana wallet address. Generous relative to legitimate monitoring workflows.

60 requests / minute / wallet
10,000 requests / day / wallet

# Rate limited responses include:
{ "retry_after": "2026-04-13T10:00:00Z" }

For very high query volumes, distribute load across multiple wallets. Each wallet operates independently against these limits.

Full documentation

Everything above is a summary. Full API reference, quickstart guides, wallet setup, and the walleted agent guide live at docs.docketlayer.com.