Announcing the Data Commons SDMX API

We are excited to announce the Data Commons SDMX API, a new way to discover and retrieve statistical observations. Last year, we introduced tools for bringing SDMX data into Data Commons. The new API complements those tools by making Data Commons observations available through an SDMX interface.

What is SDMX?

SDMX (Statistical Data and Metadata eXchange) is a global standard for exchanging statistical data and metadata. It provides a common language and structure for indicators such as population, employment, and GDP. SDMX is widely used by statistical agencies, central banks, and international organizations.

Key features

Data Commons supports a focused set of SDMX 3.0 API GET requests. Key features include:

  • A single Data Commons dataflow: Data Commons statistical observations are exposed under agency DC, dataflow DF_OBS, and version 1.0.0 (the standard identification parameters required by the SDMX REST API).
  • Discover available data: The Availability API shows which entities and metadata are available for selected statistical variables, without retrieving observations. Results are returned in SDMX-JSON 2.0.0.
  • Retrieve observations: The Data API returns observations for selected variables, entities, and dates in SDMX-CSV 2.0.0.
  • Use the same Data Commons concepts: Statistical variables, entities, and DCIDs are shared with the Data Commons Knowledge Graph and other Data Commons APIs. No separate mapping is needed when moving between interfaces.
  • Support multi-entity observations: In addition to traditional single-entity observations, the API supports statistical variables defined over multiple entity dimensions.
  • Flexible component filtering: We chose SDMX 3.0 for its component-based filtering, which lets clients select values using named c[...] parameters. Data Commons extends this approach with Knowledge Graph relationships. For example, you can combine observationAbout.containedInPlace+ and observationAbout.typeOf to select all counties contained in California without listing every county DCID.

Example: Discover and retrieve California county populations

First, use the Availability API to find counties in California that have population data:

curl -g \
'https://api.datacommons.org/sdmx/v3/availability/dataflow/DC/DF_OBS/1.0.0/*/observationAbout?c[variableMeasured]=Count_Person&c[observationAbout.containedInPlace%2B]=geoId/06&c[observationAbout.typeOf]=County' \
-H 'X-API-Key: YOUR_API_KEY'

Then use the Data API to retrieve the latest available population observations for those counties:

curl -g \
'https://api.datacommons.org/sdmx/v3/data/dataflow/DC/DF_OBS/1.0.0/*?c[variableMeasured]=Count_Person&c[observationAbout.containedInPlace%2B]=geoId/06&c[observationAbout.typeOf]=County&c[TIME_PERIOD]=LATEST' \
-H 'X-API-Key: YOUR_API_KEY'

Response excerpt (selected columns):

observationAboutmeasurementMethodprovenanceTIME_PERIODOBS_VALUEfacetId
geoId/06001CensusACS5yrSurveydc/base/CensusACS5YearSurvey20241649473.010169881228856630405
geoId/06001WikidataPopulationdc/base/WikidataPopulation2020-04-011682353.012850099660527362240

Both rows describe the same county, but come from different sources and measurement methods. Data Commons uses metadata called facets to distinguish these observation series. LATEST returns the latest available observation for each facet, so the dates can differ.

Get started

To get started, visit the SDMX API overview, consult the Availability API documentation and Data API documentation, and obtain a Data Commons API key.

What’s next?

This launch delivers an initial set of SDMX 3.0 capabilities. Looking ahead, planned directions include:

  • Adding more operators for component filters to support richer query constraints.
  • Returning Data API results in SDMX-JSON alongside SDMX-CSV.
  • Broadening support for additional observation attributes to supply richer context with each data point.

Together with our SDMX ingestion tools, this launch supports SDMX data exchange in both directions. We look forward to seeing what you build!