Prerequisites
Three things before your first query:
# 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.
Primary query endpoint. Returns current docket status including all new filings since your last_checked timestamp. $0.99 per query.
| Parameter | Type | Required | Description |
|---|---|---|---|
| case_id | string | required | Federal case number e.g. 1:24-cv-01234 |
| court_code | string | required | Court identifier e.g. nysd, deb, cand |
| last_checked | string | required | ISO 8601 timestamp of your last query |
| document_types | array | optional | Filter by type: motion, order, judgment |
| callback_url | string | optional | Webhook URL for async delivery |
Lightweight change detection. Returns changed: true/false only. Designed for high-frequency polling loops where bandwidth matters. $0.99 per query.
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.
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"
}'
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")
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");
"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.
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.
| Code | Meaning | Charged |
|---|---|---|
| 402 | Payment absent, invalid, or insufficient | No |
| 400 | Malformed request or missing fields | No |
| 404 | Case not found in specified court | No |
| 422 | Court code not recognized or not covered | No |
| 429 | Rate limit exceeded — retry_after field included | No |
| 503 | PACER or CM/ECF unavailable | No |
| 200 | Successful query | Yes — $0.99 |
Rate limits
Limits apply per Solana wallet address. Generous relative to legitimate monitoring workflows.
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.