Analytics Platform Availability (API)
When you request streaming analytics through the LabelGrid public API and filter by a single platform, the response tells you whether that platform actually reports the metric you asked for. This lets your integration distinguish “no data yet” from “this platform never reports this metric.”
The availability field
Section titled “The availability field”Add a platform filter to any analytics request — for example filter[platform]=SPOTIFY — and the response includes an availability field alongside the usual data:
available— the platform reports this metric;datais populated as normal.not_available_for_platform— the platform doesn’t report this metric.datais returned empty. This is expected behaviour, not an error.
The availability field appears only when you filter by a single platform. Requests with no platform filter return data exactly as before, with no availability key.
The shape of data is unchanged — availability is added next to it, so existing integrations keep working without modification.
Standalone metric endpoints
Section titled “Standalone metric endpoints”Each standalone analytics endpoint returns a single top-level availability value next to its data:
{ "availability": "not_available_for_platform", "data": []}The analytics summary endpoint
Section titled “The analytics summary endpoint”The /analytics/summary endpoint returns several sections at once. It carries a parallel availability map with one entry per section, so you can tell which sections the platform reports and which come back empty:
{ "availability": { "streams": "available", "listeners": "available", "streams_by_country": "available", "streams_by_gender": "available", "streams_by_age": "available", "saves": "not_available_for_platform" }, "data": { }}Which platforms report which metrics
Section titled “Which platforms report which metrics”Platform (filter[platform]) | Metrics reported |
|---|---|
SPOTIFY | All analytics metrics |
APPLE_MUSIC (ITUNES is also accepted) | Streams, listeners, streams by country, streams by gender, and streams by age |
For Apple Music, any metric outside that list returns not_available_for_platform with empty data. Spotify reports every analytics metric.
Handling it in your integration
Section titled “Handling it in your integration”- Read
availabilitybefore treating an emptydataas “no activity.” An empty result withnot_available_for_platformmeans the platform doesn’t report that metric at all. - When you request multiple metrics at once via
/analytics/summary, check the matching key in theavailabilitymap for each section. - If you don’t filter by platform, there’s no
availabilityfield — the response is the combined view across platforms, exactly as before.
Related
Section titled “Related”- API Overview — authentication, endpoints, and the full reference
- Analytics — the analytics dashboard and what each tab shows
Not using LabelGrid yet?
Everything you just read about is available on our platform.
See what LabelGrid can do →