CDC logo

Open data · Coming soon

US Health Data: CDC & HealthData.gov API

Search the open data of the CDC and HealthData.gov by keyword or dataset ID. Export the rows as JSON, CSV or Excel. You need no login or key.

Built and tested. Prices will be shown after release.

Coming soon to the Apify StoreFollow us on Apify

What you get, for example

recordTyperow
datasetId9bhg-hcku
datasetNameProvisional COVID-19 Deaths by Sex and Age

How it will work: 3 steps

  1. Follow us on ApifyThe tool is built and waits in the queue for the Apify Store. Apify is the cloud platform where our tools run.
  2. Paste your input and press StartNo code needed: you fill in a form (the input). It already has a working example. For example: data.cdc.gov in Portals. Each start is one run.
  3. Download the resultsWhen the run ends, the results are in a table (the dataset). Open Output, press Export and pick Excel or CSV. JSON and the API are there too.

This tool is an Apify Actor: a small program that runs on Apify. You can also run it on a schedule, for example every Monday. New to it? Read how it works, step by step and the 8 words you need first.

What it does

Search the open data portals of the CDC (data.cdc.gov) and HealthData.gov by keyword or dataset ID, and export the rows of the dataset as clean JSON, CSV or Excel.

  • Data rows mode (default): give a dataset ID or a search query. The Actor finds the dataset, reads its rows page by page and saves each row with every source column, plus the dataset ID, dataset name, portal, last update of the data and the time of reading.
  • Dataset search mode: list the datasets that match your keywords, with name, category, last update, licence, columns, page views and the API endpoint. No rows.
  • Search: both portals are searched separately and the matches are merged (alternating by relevance: CDC first, then HealthData.gov; or newest first, exact for up to 100 datasets). With the default maxDatasets: 1, rows come from the top CDC match; for a HealthData.gov table set domains to ["healthdata.gov"] or pick its ID in Dataset search mode.

Good for

  • Export a CDC table (COVID-19 deaths, vaccinations, measles, wastewater, overdose and many more) to CSV or Excel with a filter, without writing code.
  • Feed health statistics to a database, a notebook or an AI agent through the Apify API, with the same field names as the source.
  • Find which CDC or HHS dataset holds the numbers you need, and how fresh it is.

Not a good fit

  • Only data.cdc.gov and healthdata.gov. Other Socrata portals (cities, states) are not searched.
  • The Actor returns what the portal publishes. It does not fix, merge or interpret the numbers. Many CDC datasets are provisional or no longer updated; check datasetUpdatedAt.
  • Some HealthData.gov entries are only links to files on other websites. They have no rows in the API; you get a free status row instead.
  • Up to 50,000 rows per run. Very wide or slow datasets can stop earlier (see Pricing and limits).

Who uses it

Health researchers

Export a CDC table to Excel with a filter, without code.

Data engineers

Send health numbers to a database with the source field names.

Journalists

Find which dataset holds the numbers you need and how fresh it is.

Price

Prices will be shown after release.

Questions

Do I need a login or an API key?

No. Both portals are public. A Socrata app token is optional.

Why are some numbers null?

The source has no value there. The tool never turns a missing value into 0.

Is the data up to date?

It reads the portal live. How fresh it is depends on the dataset.

Does it search other city or state portals?

No. It searches data.cdc.gov and healthdata.gov only.

Can I get the same output as the website export?

The column names are the API field names, which can differ from the titles on the website. The values are the same; numbers are typed unless you set typedValues: false.

Details

Step by step on Apify
  1. Open the Input tab.
  2. Type keywords in Search query (searchQuery), for example covid vaccinations. Or paste a dataset ID such as 9bhg-hcku into Dataset IDs or URLs (datasetIds).
  3. Keep Max results (maxRows) at the prefilled 20, or set up to 50,000.
  4. Click Start.
  5. Open the Output tab. Check datasetName on the first row: it tells you which dataset matched your words.
Use cases
TaskInputYou getKey fieldsNext step
Export one known CDC table with a filterdatasetIds + wheredata rowsource columns, datasetName, datasetUpdatedAtCSV / Excel download, API
Quick look at data on a topicsearchQuerydata rowsource columns, datasetNameDataset view, API
Find the right dataset firstmode: datasets + searchQuerydataset recorddatasetId, datasetName, datasetUpdatedAt, columns, apiEndpointthen run Data rows mode with that datasetId
Totals without downloading rowsdatasetIds + select with count(*), sum(...)one data rowyour aggregate columnsAPI, AI agent
Tips for better results
  • Use dataset search mode first to find the right dataset.
  • Check the last update date of a dataset. Some datasets are old.
  • Set domains to healthdata.gov when you want a HealthData.gov table.
Limits and good to know
  • Up to 50,000 rows per run (tested on an earlier build with the same row reader: 50,000 rows of a CDC dataset in 32 seconds)
  • The Actor stops reading the source 250 seconds after the start, so a run fits the default 5-minute timeout. Very wide or slow datasets can stop earlier: a 135-column HealthData.gov dataset needed 204 seconds for 20,000 rows, so a bigger request on it reaches the limit. Then the run ends with CAPPED, and the dataset's outcome in RUN_SUMMARY is stopped with DEADLINE_REACHED; run again with a where filter on a date or ID to get the next part
  • Up to 20 dataset IDs and 20 datasets from a search per run
  • The source has no published quota. If it answers HTTP 429, the Actor waits and retries; your own free Socrata app token (appToken) raises the limit

For developers

Sample result

One result from a real test run, in JSON. Real values change from run to run. In Excel or CSV each field is a column.

one result · JSON
{
  "recordType": "row",
  "status": "ok",
  "datasetId": "9bhg-hcku",
  "datasetName": "Provisional COVID-19 Deaths by Sex and Age",
  "domain": "data.cdc.gov",
  "datasetUpdatedAt": "2023-09-27T14:43:31.000Z",
  "rowNumber": 1,
  "sourceUrl": "https://data.cdc.gov/resource/9bhg-hcku.json?%24where=state+%3D+%27California%27&%24order=%3Aid&%24limit=21&%24offset=0",
  "fetchedAt": "2026-10-17T13:26:07.250Z",
  "data_as_of": "2023-09-27T00:00:00.000",
  "start_date": "2020-01-01T00:00:00.000",
  "end_date": "2023-09-23T00:00:00.000",
  "group": "By Total",
  "year": null,
  "month": null,
  "state": "California",
  "sex": "All Sexes",
  "age_group": "All Ages",
  "covid_19_deaths": 109248,
  "total_deaths": 1178346,
  "pneumonia_deaths": 125177,
  "influenza_deaths": 1753,
  "footnote": null
}
Data fields (28)
FieldTypeMeaning
recordTypestringrow = one data row of a dataset; dataset = one catalog record (Dataset search mode); status = free not_found / no_rows / error row.
statusstringok for data rows and dataset records; not_found, no_rows or error for status rows.
statusCodestringMachine code on status rows, e.g. DATASET_NOT_FOUND, INVALID_DATASET_ID, SOURCE_BAD_REQUEST, RATE_LIMITED.
statusReasonstringPlain-English reason on status rows.
inputstringYour dataset ID or URL as given (status rows).
datasetIdstringSocrata 4x4 dataset ID, e.g. 3rge-nu2a.
datasetNamestringDataset title on the portal.
domainstringPortal: data.cdc.gov or healthdata.gov.
datasetUpdatedAtstringWhen the dataset rows were last updated by the publisher (ISO 8601); null if the portal does not say.
rowNumberintegerPosition of the row in this export, from 1 (data rows).
sourceUrlstringAPI URL the row or record was read from.
fetchedAtstringWhen the Actor read the data (ISO 8601).
metadataUpdatedAtstringWhen the dataset description or columns last changed (ISO 8601).
categorystringPortal category, e.g. Vaccinations.
licensestringDataset licence as published, e.g. Public Domain U.S. Government.
attributionstringPublisher named by the portal, e.g. Centers for Disease Control and Prevention.
permalinkstringHuman page of the dataset on the portal.
descriptionstringDataset description (Dataset search mode).
createdAtstringWhen the dataset was created (ISO 8601).
tagsarrayPortal tags.
columnsarrayColumns: name, fieldName (use it in where/select), dataType, description.
columnCountintegerNumber of data columns.
apiEndpointstringSODA endpoint of the dataset rows, e.g. https://data.cdc.gov/resource/3rge-nu2a.json.
searchQuerystringThe search query that found this dataset.
searchRankintegerPosition in the search results, from 1.
pageViewsLastMonthintegerPortal page views last month, as reported by the catalog.
pageViewsTotalintegerPortal page views in total.
downloadCountintegerDownloads, as reported by the catalog.
Input settings (12)

The main fields of the input form. With the API you send them as JSON.

SettingName in the APITypeExample value
Search querysearchQuerystring"covid vaccinations"
Dataset IDs or URLsdatasetIdsarray
Modemodestring"rows"
Max resultsmaxRowsinteger20
Filter rows (SoQL where)wherestring
Columns (SoQL select)selectstring
Sort rows (SoQL order)orderstring
Datasets to export from a searchmaxDatasetsinteger1
Portalsdomainsarray["data.cdc.gov", "healthdata.gov"]
Rank datasets bysortDatasetsBystring"relevance"
Typed numbers and booleanstypedValuesbooleantrue
Socrata app token (optional)appTokenstring

Start on Apify

Make a free Apify account: you get $5 of free usage every month. Missing a tool? Suggest it. We read every idea, but we do not promise to build it.

Apify links on this page are affiliate links. We may earn a commission. You pay the same price. Affiliate disclosure