pull Medicare claims data via the CMS Blue Button 2.0 API

domain: cms-blue-button · 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 https://bluebutton.cms.gov/developers/ to obtain a client_id and client_secret for the sandbox environment.
  2. Implement the OAuth2 authorization code flow using the sandbox authorization URL; beneficiaries log in with their MyMedicare.gov credentials to grant consent.
  3. Exchange the authorization code for an access token and extract the patient identifier from the token response or the /v2/connect/userinfo endpoint.
  4. Request the patient's claims data by calling the FHIR endpoints: /v2/fhir/Patient, /v2/fhir/ExplanationOfBenefit, /v2/fhir/Coverage using the Bearer token.
  5. Handle paginated Bundle responses with next links; ExplanationOfBenefit queries can return hundreds of claim records.
  6. For production access, complete CMS's production approval process including a security review and data use agreement before handling real beneficiary data.

Known gotchas

Related routes

Access CMS Blue Button 2.0 API to retrieve Medicare claims data for a beneficiary
fhir · 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