Returns a paginated list of Medicare spending records with data and meta (page, limit, totalItems, totalPages). Call it to browse or filter spending by drug names, manufacturer, year, and spending range; supplying a search term switches to a text search over the records. Returns 400 for invalid query parameters, 503 when the data is unavailable on this deployment, and 500 on other failures.
Rate limit: medicareApiCallsPerDay · Free plan: 10/day
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| search | string | No | maximum length 500 |
| spending_key | string | No | maximum length 200 |
| brand_name | string | No | maximum length 200 |
| generic_name | string | No | maximum length 300 |
| manufacturer | string | No | maximum length 200 |
| year | string | No | maximum length 50 |
| min_spending | number | No | Lower bound on total spending. |
| max_spending | number | No | Upper bound on total spending. |
| page | number | No | Min 1; default 1 (min 1; default 1) Range: 1 to ∞ |
| limit | number | No | Range 1-100; default 20 (range 1-100; default 20) Range: 1 to 100 |
| sort | string | No | Default total_spending (default total_spending) Allowed values: total_spending, key, brand |
| order | string | No | Default desc (default desc) Allowed values: asc, desc |
Example request
curl -H "x-api-key: YOUR_API_KEY" \ "https://app.caelrith.com/api/v1/medicare-spending"
Returns the full spending record for a single Medicare spending entry identified by its key. Call it when you already have a key from a spending search and need the complete record. Returns 404 if no entry matches the key, and 500 on internal failure.
Rate limit: medicareApiCallsPerDay · Free plan: 10/day
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| key(path) | string | Yes |
Example request
curl -H "x-api-key: YOUR_API_KEY" \
"https://app.caelrith.com/api/v1/medicare-spending/{key}"