Data Management API
Who should read this — Operators and integrators working with R2 raw datasets and metadata snapshots. See API overview for authentication.
Overview
Section titled “Overview”R2 Raw Dataset and Metadata Snapshot/Synchronization API for pipeline data management and GitHub SSOT sync.
Datasets API
Section titled “Datasets API”Base path: /api/v1/datasets
- GET /api/v1/datasets — List datasets (
country,categoryquery). - GET /api/v1/datasets/stats — Dataset statistics.
- GET /api/v1/datasets/:country/:category/:date — List chunks for a specific date partition.
- GET /api/v1/datasets/:country/:category/:date/:chunk — Retrieve a specific chunk.
- POST /api/v1/datasets — Save a dataset (
EnhancedResearchDataset). - DELETE /api/v1/datasets/:country/:category/:date/:chunk — Delete chunk.
Metadata API
Section titled “Metadata API”Base path: /api/v1/metadata
- GET /api/v1/metadata/snapshot — Full snapshot metadata (for GitHub Actions synchronization).
- POST /api/v1/metadata/sync — Synchronize snapshot to GitHub.
- GET /api/v1/metadata/by-country/:country — Metadata by country.
- GET /api/v1/metadata/tasks — List/status of metadata tasks.
Authentication
Section titled “Authentication”Send API credentials in the Authorization header. See API overview.
Next steps
Section titled “Next steps”- Infrastructure API — Queue batch processing.
- R2 operations standard — Storage conventions.
- Implementation:
src/routes/datasets.ts,src/routes/metadata.ts