REST API for DDI (Data Documentation Initiative), an international standard for describing statistical and social science data.
- Roadmap — Plan and track the API roadmap on the DDI API GitHub Project.
- 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.
For detailed API usage, endpoints, and examples, see the Mock API Endpoints Documentation.
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.