REST API for DDI (Data Documentation Initiative), an international standard for describing statistical and social science data.
- Follow the roadmap
- Issues — Report bugs or give feedback (feature requests, API improvements).
- Discussions — Share use cases, ask questions, and discuss with the DDI community.
This API provides access to DDI metadata resources.
Recommended entry points: GET /ddi/v1/items (full ItemCatalog) and GET /ddi/v1/items/{itemIdentifier} (one object, polymorphic — URN, agency:id:version in the path, or plain id + agencyID / version query). Query parameters for the list are the same union as on the per-type list endpoints. Prefer /variables, /concepts, etc. when you already know the type.
For detailed API usage, endpoints, and examples, see the Mock API Endpoints Documentation.
Identifiers follow an URN-first rule (see ddi-rest.yaml):
- DDI URN (
urn:ddi:{agency}:{id}:{version}): identifies a resource unambiguously; no extra query parameters are required. - Plain ID: meaningful only within a DDI agency;
agencyIDandversionquery parameters are required on the same request (path or list filters). - There is no global lookup by plain ID alone across agencies or versions.
If a plain ID is used without both agencyID and version, the API responds with 400 Bad Request.
Examples in the mock endpoints guide use agencyID=example.agency and version=1.0.0 for plain identifiers.
The API specification is available in the ddi-rest.yaml file in OpenAPI 3.1.1 format.
- Swagger UI: View on GitHub Pages
To view and test the API specification locally:
- Swagger Editor: Open https://editor.swagger.io/ and paste the contents of
ddi-rest.yamlor load it directly from the repository - Local Swagger UI: Run
yarn build:swaggerandyarn preview:swaggerto start a local Swagger UI server - Local Mock Server: Run
yarn mockto start a mock API server for testing
The API supports DDI-specific response formats only. Use the Accept header to specify your preferred format:
DDI JSON Format (default):
# DDI JSON format (default - no Accept header needed)
curl https://api.example.com/ddi/v1/variables
# Explicit DDI JSON request
curl -H "Accept: application/vnd.ddi.structure+json;version=3.3" https://api.example.com/ddi/v1/variablesDDI XML Format:
# DDI XML format (requires Accept header)
curl -H "Accept: application/vnd.ddi.structure+xml;version=3.3" https://api.example.com/ddi/v1/variablesSupported Content Types:
application/vnd.ddi.structure+json;version=3.3- DDI JSON format (default if no Accept header)application/vnd.ddi.structure+xml;version=3.3- DDI XML format
Note:
- If no
Acceptheader is provided, the API returns DDI JSON format by default. - Generic formats (
application/json,application/xml,text/xml) are not supported and will return a406 Not Acceptableerror.