docs: measurements + measurement-jobs resources (chat#1796 contract)
Merged
SW
4mo ago+273+273+012345678901234567890123456789-446-446-012345678901234567890123456789
The contract (docs-first) for chat#1796 — consolidate the /research play-count surface into two REST resources. Head of the docs → api → skill merge order.
New endpoints
GET /research/tracks/{id}/measurements— the measurement series;granularity=daily(series),aggregate=run_rate&window=365d(derived projection). Replacestrack/historic-stats+track/playcount-deltas.GET /research/albums/{id}/measurements?latest=true— latest per-track counts. Replacesplaycounts.POST /research/measurement-jobs{ scope, source: "current" | "historical" }→ 202 + pollableGET /research/measurement-jobs/{id}.currentreplacessnapshots;historicalis the backfill seed (replaces the never-builtbackfillverb).
Deprecations
track/historic-stats, track/playcount-deltas, playcounts, snapshots marked deprecated: true with a migration note pointing at the new resource.
Changes
api-reference/openapi/research.json— 4 path operations + 8 schemas (additive diff; the 7 "deletions" are descriptions re-prefixed with the deprecation note).- 4 frontmatter-only MDX pages +
docs.jsonCatalog nav entries.
Validation
mintlify openapi-check→ valid.- All 98
$refs resolve; 4 new paths present; 4 legacy ops flagged deprecated.
Summary by cubic
Consolidates the research play-count APIs into two REST resources and a single ingest job. Removes the old RPC endpoints and aligns with chat#1796.
-
New Features
GET /api/research/tracks/{id}/measurements— daily series; supportsaggregate=run_rate&window=365d.{id}accepts ISRC or Spotify track id.GET /api/research/albums/{id}/measurements?latest=true— latest per-track counts for an album.POST /api/research/measurement-jobs(source: "current" | "historical") — create ingest jobs; poll status viaGET /api/tasks/runs.
-
Migration
- Replace
GET /api/research/track/historic-statswithGET /api/research/tracks/{id}/measurements?granularity=daily. - Replace
GET /api/research/track/playcount-deltaswithGET /api/research/tracks/{id}/measurements?aggregate=run_rate. - Replace
GET /api/research/playcountswithGET /api/research/albums/{id}/measurements?latest=true. - Replace
POST /api/research/snapshotswithPOST /api/research/measurement-jobs(source:"current"). Usesource:"historical"for deep backfill.
- Replace
Summary by CodeRabbit
-
New Features
- Added track measurement endpoints providing time-series data with optional aggregation options
- Added album measurement endpoints for latest per-track measured counts
- Added ability to enqueue asynchronous measurement jobs for current and historical data capture
-
Documentation
- Updated API reference documentation to reflect new measurement endpoints
- Reorganized Research API navigation structure