Skip to main content

Official websites use .gov
A.gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
Alock () or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.

Guides

Blue Button is a standards-based API that gives access to Medicare claims data. Medicare claims offer a timely record of diagnoses, visits, treatments, and prescriptions. Use Blue Button to build apps for people on Medicare and the organizations that support them

Blue Button uses Fast Healthcare Interoperability Resources (FHIR) to share claims data. You can use various tools or client software to access the sandbox and production environments.

These pages provide step-by-step guides for every stage of building with Blue Button. Covers everything from authentication to production readiness.

  • Authentication & OAuth Set up OAuth 2.0, get tokens, handle refresh and revocation
  • Fetching Patient Data Make requests, read responses, work with identifiers and references
  • Working with Claims Understand ExplanationOfBenefit responses and decode claims data
  • Handling Pagination Navigate large result sets and build complete datasets
  • Building a Consent Flow Meet CMS requirements for user authorization and data transparency
  • Optimizing your App for Production Optimize queries, pass compliance checks, and prepare for launch

Environments

Sandbox vs. Production environments

Environment Access Base FHIR URL
Sandbox Available to everyone via test credentials. Contains test claims data. https://sandbox.bluebutton.cms.gov/v2/fhir/
Production Must complete steps for production credentials. Contains real Medicare enrollee data https://api.bluebutton.cms.gov/v3/fhir/

Sample applications

Use our sample applications to see how the API’s basic features work.

SDKs

Our Node and Python SDKs provide methods to build API calls and manage token refreshes.

Looking for U.S. government information and services?
Visit USA.gov