canonical: https://jentic.com/apis/healthdata.gov/healthdata

# HealthData.gov Socrata Open Data API

The HealthData.gov Socrata Open Data API provides programmatic access to U.S. health datasets published by HHS, CDC, CMS, and other agencies, covering topics from COVID-19 and hospital capacity to Medicare and community health. Agents discover datasets through the catalog endpoint and query individual datasets with SoQL, the Socrata Query Language, returning results as JSON or CSV. An optional app token in the X-App-Token header raises rate limits but is not required for public data.

## For AI agents

Discover U.S. health datasets through the catalog and query them with SoQL, returning filtered JSON or CSV results for analysis.

## Scope

Does not write, upload, or modify datasets, and does not host non-health data. Use for discovering and querying HealthData.gov's public health datasets only.

## Capabilities

- Search and browse the dataset catalog to find relevant health datasets
- Query a specific dataset with SoQL, filtering and aggregating rows server-side
- Retrieve query results as JSON or CSV for direct loading into analysis tools
- Fetch a dataset's metadata to understand its columns before querying
- Read rows through the legacy views API for older dataset formats

## Use cases

### Agent-Driven Health Data Queries

An AI agent answering a health question finds the right dataset through the HealthData.gov catalog, then queries it with SoQL to pull only the rows it needs. Through Jentic the agent calls the catalog and resource endpoints directly, returning JSON it can reason over without a developer scripting the Socrata query flow.

Example prompt: Search the catalog for a hospital capacity dataset, then query its resource endpoint with a SoQL filter for one state

### Loading Health Datasets into Analytics Tools

Analysts pull government health data into notebooks and dashboards. The HealthData.gov API returns query results as JSON or CSV, so a pipeline can request a filtered slice of a dataset and load it directly without scraping the portal interface.

Example prompt: Query a dataset's CSV endpoint with a date filter and load the result into a dataframe

### Dataset Discovery and Schema Inspection

Before querying, a workflow needs to know what datasets exist and what columns they carry. The HealthData.gov catalog endpoint lists available datasets and the views metadata endpoint returns a dataset's schema, so an agent can pick the right dataset and build a valid SoQL query.

Example prompt: List catalog datasets matching 'Medicare', then fetch the metadata for the top result to read its columns

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/api/catalog/v1` | Search the dataset catalog |
| GET | `/resource/{datasetId}.json` | Query a dataset with SoQL, returning JSON |
| GET | `/resource/{datasetId}.csv` | Query a dataset, returning CSV |
| GET | `/api/views/{datasetId}.json` | Get metadata for a dataset |
| GET | `/api/views/{datasetId}/rows.json` | Get rows via the legacy views API |

## Key resources

- **Catalog** — Search and browse available datasets
- **Datasets (Resources)** — Query dataset rows with SoQL and return JSON or CSV
- **Dataset Metadata (Views)** — Retrieve a dataset's schema and read rows via the legacy views API

## Why Jentic

- **Setup:** Wiring HealthData.gov by hand means learning SoQL, discovering dataset ids through the catalog, and optionally registering an app token for the X-App-Token header. Through Jentic you install once, import the HealthData.gov Socrata API from the API Directory, store the optional token once, and your agent calls it.
- **Permission scoping:** The dataset id travels in the URL path (`/resource/{datasetId}.json`), so a rule can pin your agent to specific datasets, and every operation here is read-only. You choose the operations it may call, so it queries and reads catalog data and nothing else unless you add more.
- **Credential handling:** Your optional Socrata app token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'query a health dataset', and Jentic returns the matching Socrata operation with its input schema so the agent builds a valid SoQL request without browsing the portal.

## Related APIs

- **Socrata Open Data API (SODA)** — The generic Socrata Open Data API queries any Socrata portal with SoQL, where HealthData.gov is the health-focused instance of the same technology.
- **CMS API** — The CMS API exposes Medicare and Medicaid program data that complements the health datasets on HealthData.gov.
- **Data.gov API** — Data.gov catalogs U.S. government datasets across every domain, a wider index than HealthData.gov's health-only collection.

## FAQ

### What authentication does the HealthData.gov Socrata API use?

The HealthData.gov Socrata Open Data API accepts an optional application token passed in the X-App-Token header, per its OpenAPI spec. Public datasets can be queried without a token, but registering one raises your rate limits. Through Jentic the token is stored encrypted by your own Jentic One instance and injected at call time.

### Is there a HealthData.gov Socrata API MCP server?

You don't need an MCP server to give your agent the HealthData.gov Socrata API. Jentic connects it directly from the API Directory: import it, store your optional app token once, and your agent searches the catalog and queries datasets as it needs them. Nothing extra is loaded into the agent's context until a call is made.

### Can I limit what my agent is allowed to do with the HealthData.gov Socrata API?

Yes. Every operation here is read-only, and you choose which ones your agent may call, so you can allow catalog search and dataset queries and nothing else. Every call it makes is logged, so you can see which datasets it read.

### Can I query a specific dataset with SoQL through the HealthData.gov API?

Yes. The resource endpoint accepts SoQL, the Socrata Query Language, so an agent can filter, select, and aggregate rows server-side and receive only the data it needs as JSON or CSV.

### What are the rate limits for the HealthData.gov Socrata API?

Public requests are throttled by Socrata, and registering an app token to send in the X-App-Token header raises the limit. The OpenAPI spec does not state exact numbers, so check the Socrata documentation at https://dev.socrata.com for current throttling rules.

### How do I query HealthData.gov datasets through Jentic?

Search Jentic for 'query a health dataset', which returns the resource query operation with its input schema. Add the HealthData.gov Socrata API from the Jentic API Directory and store your optional app token once. To run it on your own infrastructure, install Jentic One from its GitHub repo.
