Access CMS Blue Button 2.0 API to retrieve Medicare claims data for a beneficiary

domain: fhir · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Register your application at bluebutton.cms.gov developer portal and obtain a client_id and client_secret for the sandbox environment.
  2. Implement the OAuth 2.0 authorization code flow: redirect the Medicare beneficiary to the CMS authorization endpoint; after consent, exchange the code for tokens at the token endpoint.
  3. Query the FHIR R4 endpoints with the access token; the Blue Button 2.0 API exposes ExplanationOfBenefit (EOB), Patient, and Coverage resources.
  4. Retrieve all EOBs for the beneficiary: GET [base]/ExplanationOfBenefit?patient=[id]&_count=50; paginate through results using Bundle next links; EOBs represent Medicare Part A, B, and D claims.
  5. Parse EOB.item[].productOrService for procedure codes (CPT/HCPCS), EOB.diagnosis[] for ICD-10 codes, EOB.item[].adjudication[] for payment amounts and adjustment reasons.
  6. Access Coverage resources via GET [base]/Coverage?patient=[id] to determine Part A, B, and D enrollment status and effective periods.

Known gotchas

Related routes

pull Medicare claims data via the CMS Blue Button 2.0 API
cms-blue-button · 6 steps · unrated
Retrieve Medicare claims data via CMS Blue Button 2.0 using authorization code OAuth flow
bluebutton.cms.gov · 6 steps · unrated
Retrieve a Medicare beneficiary's Part A, B, and D claims history using the CMS Blue Button 2.0 FHIR API
bluebutton.cms.gov · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans