API Documentation
← API overview

Medicare Spending

2 endpoints · every section below is generated from the API catalog

GET/api/v1/medicare-spending

Search

Available on FreeFull reference →

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

ParameterTypeRequiredDescription
searchstringNomaximum length 500
spending_keystringNomaximum length 200
brand_namestringNomaximum length 200
generic_namestringNomaximum length 300
manufacturerstringNomaximum length 200
yearstringNomaximum length 50
min_spendingnumberNoLower bound on total spending.
max_spendingnumberNoUpper bound on total spending.
pagenumberNoMin 1; default 1 (min 1; default 1)
Range: 1 to ∞
limitnumberNoRange 1-100; default 20 (range 1-100; default 20)
Range: 1 to 100
sortstringNoDefault total_spending (default total_spending)
Allowed values: total_spending, key, brand
orderstringNoDefault 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"
GET/api/v1/medicare-spending/:key

Details

Available on FreeFull reference →

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

ParameterTypeRequiredDescription
key(path)stringYes

Example request

curl -H "x-api-key: YOUR_API_KEY" \
  "https://app.caelrith.com/api/v1/medicare-spending/{key}"