iceBeats Audio API
Documentation and playground for library, top stats and playback logging.
Base URL:
https://icebeats.io
Authentication
External integrators need an API key for top stats and play logging.
Your own pages on the same domain can keep working without a key (same-site via Origin/Referer/Host).
API key required:
•
GET /api/stats_top.php•
POST /api/track_play.phpPublic:
•
GET /library.json•
GET /api/health.php
X-API-Key
X-API-Key: DIN_NYCKEL
Same-site requests from icebeats.io and icejockey.app may be allowed without an API key depending on endpoint.
Overview
| Method | Path | Access | Description |
|---|---|---|---|
GET |
/library.json |
Public | Returns the full library with tracks and metadata. |
GET |
/api/health.php |
Public | Simple health check for the API and related systems. |
GET |
/api/stats_top.php |
Protected | Returns the most played tracks for the selected period. |
POST |
/api/track_play.php |
Protected | Logs a playback event for stats and sync. |
Endpoints
GET
/library.json
Public
Returns the full library with tracks and metadata.
Example response
{
"baseUrl": "https://icebeats.io",
"items": [
{
"id": "goal_horn_1",
"title": "Goal Horn",
"artist": "iceBeats",
"genre": "Mål",
"image": "/covers/goal-horn.webp",
"url": "/tracks/goal-horn.mp3",
"createdAt": 1740000000
}
]
}
GET
/api/health.php
Public
Simple health check for the API and related systems.
Example response
{
"ok": true,
"checks": {
"library": { "ok": true, "updated": 1740000000 },
"db": { "ok": true },
"storage": { "ok": true }
}
}
GET
/api/stats_top.php
Protected
Returns the most played tracks for the selected period.
Parameters
| Field | Required | Description |
|---|---|---|
range | No | week eller month |
limit | No | 1–50 |
client_id | No | Valfritt klient-id |
Example response
{
"ok": true,
"range": "week",
"days": 7,
"clientId": "arena_1",
"updatedAt": "2026-03-06T08:00:00Z",
"top": [
{
"trackId": "goal_horn_1",
"plays": 42,
"msTotal": 123000,
"lastTs": 1741248000,
"title": "Goal Horn",
"artist": "iceBeats",
"genre": "Mål",
"image": "/covers/goal-horn.webp",
"url": "/tracks/goal-horn.mp3"
}
]
}
POST
/api/track_play.php
Protected
Logs a playback event for stats and sync.
Parameters
| Field | Required | Description |
|---|---|---|
track_id | Yes | Unikt spår-id |
client_id | No | Klient eller integration |
event_key | No | Typ av event, t.ex. goal eller library_play |
played_ms | No | Spelad tid i millisekunder |
title | No | Titel för spåret |
artist | No | Artistnamn |
track_url | No | Delbar URL till spårsidan |
Example response
{
"ok": true,
"trackId": "goal_horn_1",
"logged": true
}
Quick test (Playground)
Fill in an API key if you want to test protected endpoints.
Fetch top list from stats_top.php
Post a test log to track_play.php
Response
{}
Examples
With API key
# top week (requires key) curl -s "https://icebeats.io/api/stats_top.php?range=week&limit=10&client_id=arena_1" \ -H "X-API-Key: DIN_NYCKEL" # log play (requires key) curl -s -X POST "https://icebeats.io/api/track_play.php" \ -H "X-API-Key: DIN_NYCKEL" \ -F "track_id=goal_horn_1" \ -F "client_id=arena_1" \ -F "event_key=goal_home" \ -F "played_ms=5000" \ -F "title=Goal Horn" \ -F "artist=iceBeats" \ -F "track_url=https://icebeats.io/track/?id=goal_horn_1"
Without API key
# library (public) curl -s "https://icebeats.io/library.json" # health (public) curl -s "https://icebeats.io/api/health.php"
Rate limiting
External requests are rate limited per API key or IP. Please dedupe play logging per track/client.
Tip: log only if the track has played at least 5 seconds and at most once/minute per track and client.