CMS — Centers for Medicare & Medicaid Services Data API

The Data API from CMS — Centers for Medicare & Medicaid Services — 4 operation(s) for data.

Operations 5

GET /data/{jobId}/{filename} Get data file #
GET /dataset/{datasetId}/data Get Dataset Data #
GET /dataset/{datasetId}/data-stats Get Dataset Statistics #
GET /datastore/query/{distributionId} Query Dataset Distribution #
GET /datastore/sql Run SQL Query #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/cms-gov:cms-gov-data-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

cms-gov-data-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cms Gov Data API
  version: '1.0'
  description: 'Operations tagged Data across 3 of this provider''s published API definitions: cms-data-api-openapi.yml, cms-gov-open-data-openapi.yml, cms-gov-provider-data-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://data.cms.gov/data-api/v1
  description: Production
- url: https://data.cms.gov/data.json
  description: DCAT catalog
- url: https://data.cms.gov/provider-data/api/1
  description: Production
tags:
- name: Data
paths:
  /data/{jobId}/{filename}:
    get:
      tags:
      - Data
      summary: Get data file
      description: Returns the NDJSON file of data generated by an export job, which can be found via the jobs/{jobId} response. Will be in the format .ndjson or -error.ndjson. Gzip is highly encouraged for faster downloads.
      operationId: serveData
      parameters:
      - name: jobId
        in: path
        description: ID of data export job
        required: true
        schema:
          type: integer
          format: int64
          x-go-name: JobID
        x-go-name: JobID
      - name: filename
        in: path
        description: Name of file to be downloaded
        required: true
        schema:
          type: string
          x-go-name: Filename
        x-go-name: Filename
      - name: Accept-Encoding
        in: header
        description: Encoding type to use
        schema:
          type: string
          enum:
          - gzip
          x-go-name: AcceptEncoding
        x-go-name: AcceptEncoding
      responses:
        '200':
          description: File of newline-delimited JSON FHIR objects
          headers:
            Content-Encoding:
              description: Header defining encoding type used
              schema:
                type: string
                enum:
                - gzip
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/NDJSON'
        '400':
          description: Malformed request. The body will contain a FHIR OperationOutcome resource in JSON format. https://www.hl7.org/fhir/operationoutcome.html.
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcomeResponse'
        '401':
          description: Unauthorized. The provided credentials are invalid for the requested resource.
          content: {}
        '404':
          description: The requested path was not found. The body will contain a FHIR OperationOutcome resource in JSON format. https://www.hl7.org/fhir/operationoutcome.html
          content:
            application/fhir+json:
              schema:
                $ref: '#/components/schemas/OperationOutcomeResponse'
      security:
      - bearer_token: []
  /dataset/{datasetId}/data:
    get:
      summary: Get Dataset Data
      operationId: getDatasetData
      description: Filtered data query against a dataset distribution.
      tags:
      - Data
      parameters:
      - name: datasetId
        in: path
        required: true
        schema:
          type: string
      - name: filter
        in: query
        schema:
          type: string
          description: Field filter expressions
      - name: keyword
        in: query
        schema:
          type: string
      - name: offset
        in: query
        schema:
          type: integer
      - name: size
        in: query
        schema:
          type: integer
          maximum: 5000
      - name: format
        in: query
        schema:
          type: string
          enum:
          - json
          - csv
          - tsv
      responses:
        '200':
          description: Dataset rows
    servers:
    - url: https://data.cms.gov/data-api/v1
      description: Production
    - url: https://data.cms.gov/data.json
      description: DCAT catalog
  /dataset/{datasetId}/data-stats:
    get:
      summary: Get Dataset Statistics
      operationId: getDatasetStats
      tags:
      - Data
      parameters:
      - name: datasetId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Row counts and column stats
    servers:
    - url: https://data.cms.gov/data-api/v1
      description: Production
    - url: https://data.cms.gov/data.json
      description: DCAT catalog
  /datastore/query/{distributionId}:
    get:
      summary: Query Dataset Distribution
      operationId: queryDistribution
      tags:
      - Data
      parameters:
      - name: distributionId
        in: path
        required: true
        schema:
          type: string
      - name: conditions
        in: query
        schema:
          type: string
      - name: limit
        in: query
        schema:
          type: integer
          maximum: 500
      - name: offset
        in: query
        schema:
          type: integer
      - name: format
        in: query
        schema:
          type: string
          enum:
          - json
          - csv
      responses:
        '200':
          description: Query results
    servers:
    - url: https://data.cms.gov/provider-data/api/1
      description: Production
  /datastore/sql:
    get:
      summary: Run SQL Query
      operationId: runSql
      description: Execute a constrained SQL query against the published provider datasets.
      tags:
      - Data
      parameters:
      - name: query
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Query results
    servers:
    - url: https://data.cms.gov/provider-data/api/1
      description: Production
components:
  schemas:
    OperationOutcomeResponse:
      type: object
      properties:
        Issue:
          type: object
          required:
          - Severity
          - Code
          - Diagnostics
          properties:
            Severity:
              description: 'Severity of the outcome: fatal | error | warning | information'
              type: string
            Code:
              description: Error or warning code
              type: string
            Diagnostics:
              description: Additional diagnostic information about the issue
              type: string
      x-go-package: github.com/CMSgov/bcda-app/bcda/models
    NDJSON:
      type: string
      x-go-package: github.com/CMSgov/bcda-app/bcda/models
  securitySchemes:
    basic_auth:
      type: http
      scheme: basic
    bearer_token:
      type: apiKey
      description: The Group and Patient endpoints require a Bearer Token. 1) Put your credentials in Basic Authentication, 2) Request a bearer token from /auth/token, 3) Put "Bearer {TOKEN}" in this field (no quotes) using the bearer token retrieved in step 2
      name: Authorization
      in: header
x-refined-from:
- cms-data-api-openapi.yml
- cms-gov-open-data-openapi.yml
- cms-gov-provider-data-openapi.yml