CDCPLACES 1.2.0

2026-02-16

I’m happy to announce the release of CDCPLACES 1.2.0. This package lets you query the CDC’s Population Level Analysis and Community Estimates (PLACES) API directly from R, returning health measure estimates for counties, census tracts, ZCTAs, and—new in this release—places (cities, towns, and census-designated places).

You can install it from CRAN with:

install.packages("CDCPLACES")

Or get the development version from GitHub:

devtools::install_github("brendensm/CDCPLACES")

This post walks through the highlights. The full changelog is in the NEWS file.

Place geography

The biggest addition in 1.2.0 is support for place-level data. PLACES has always published estimates for incorporated places and census-designated places, but the package only supported county, tract, and ZCTA queries. Now you can pull place-level data across all release years (2020–2025):

get_places(geography = "place", state = "MI", measure = "SLEEP")

Place geography also supports the geometry and age_adjust arguments, so you can map city-level estimates just as easily as counties:

get_places(geography = "place", state = "MI", measure = "SLEEP", geometry = TRUE)

2025 release data

The package now defaults to the 2025 release year, which is the latest available from CDC. All four geographies—county, tract, ZCTA, and place—are supported for 2025.

# 2025 is now the default
get_places(geography = "county", state = "OH", measure = "ACCESS2")

You can still query any prior year back to 2020 by setting the release argument.

Smarter API queries

Under the hood, the way queries are built has been rewritten. The package now constructs SQL IN operators instead of chaining LIKE/OR clauses, which produces shorter and more efficient API requests.

More importantly, ZCTA queries are now automatically batched. Some states have thousands of ZCTAs (Texas alone has roughly 2,000), and the previous approach could exceed Socrata’s URL length limit and fail silently. The package now detects when a query would be too long and splits it into multiple smaller requests behind the scenes.

Breaking changes

A few things to watch for when upgrading:

Reliability improvements

This release fixes a number of edge-case bugs that could cause confusing errors or silently wrong results:

Dataset discovery is now automated

The internal table of API endpoints used to be maintained by hand. In 1.2.0, data-raw/DATASET.R queries the Socrata Discovery API to programmatically find every PLACES dataset, making it straightforward to add new release years as CDC publishes them.

In addition, the GitHub repo for this package now has a GitHub action to check monthly for URL changes. If for some reason the underlying API URLs change for a specific year or data set, a GitHub issue will automatically be opened.

Other notes

The underlying data dictionary for the full range of available PLACES data measures and variables has not yet been updated by the PLACES team. This means that there is no additional information included for the 2025 release in this data frame (this is the data frame queried when running get_dictionary).

ZCTA-level data for the 2024 release of PLACES is currently unavailable. This is not posted as a public data set (even though it is present for other release years). I believe this may be due to a mistake during the 2025 release.

For both of these issues, I have contacted PLACES to see if updates will be made. I will update the package and this blog post accordingly.

Acknowledgments

I wanted to recognize that many of these updates were made possible by Claude Code. I would like to thank Garrick Aden-Buie from Posit specifically for sharing these Claude skills which helped immensely in the testing and review of this package update.

If you run into problems or have other ideas, please open an issue on GitHub. If you want to stay up to date with me and get notified when I post, consider subscribing to my newsletter.