Skip to content

Streams

List All Streams

http
GET /stream

Returns a list of all active streams. No auth required.

Example:

bash
curl https://api.radioreg.net/stream

Response:

json
[
  {
    "id": 1,
    "name": "Radio Example",
    "url": "https://stream.example.com/live",
    "tags": ["pop", "hits"],
    "organization": {
      "id": 1,
      "name": "Example Radio",
      "image": "https://cdn.radioreg.net/logos/example.png"
    },
    "song": {
      "title": "Blinding Lights",
      "artist": "The Weeknd",
      "cover": "https://cdn.example.com/cover.jpg",
      "songDuration": 200,
      "songStartedAt": 1730465520,
      "next": {
        "title": "Next Song",
        "artist": "Next Artist",
        "cover": null
      }
    },
    "isStreamOfTheMonth": false,
    "isNewcomerOfTheMonth": false,
    "isRecentPopularStream": false,
    "isTopVotedStream": false
  }
]

Song History

http
GET /stream/:id/history

Returns the current song, next song, and the last 3 played songs of a stream. No auth required.

Parameters:

NameTypeDescription
idintegerStream ID

Example:

bash
curl https://api.radioreg.net/stream/1/history

Response:

json
{
  "current": {
    "id": "ab399e04-9835-40aa-aad4-fb14e6e0e700",
    "title": "Blinding Lights",
    "artist": "The Weeknd",
    "cover": "https://cdn.example.com/cover.jpg"
  },
  "next": {
    "title": "Next Song",
    "artist": "Next Artist",
    "cover": null
  },
  "history": [
    {
      "id": 42,
      "title": "Song Name",
      "artist": "Artist Name",
      "cover": "https://cdn.example.com/cover.jpg",
      "playedAt": "2024-11-01T14:32:00.000Z"
    }
  ]
}

next is null if no next track is available.


Get Votes

http
GET /stream/:id/votes

Returns the vote counts for a stream. If a JWT is sent, the response also includes the user's own vote.

Parameters:

NameTypeDescription
idintegerStream ID

Example without auth:

bash
curl https://api.radioreg.net/stream/1/votes

Example with auth:

bash
curl https://api.radioreg.net/stream/1/votes \
  -H "Authorization: Bearer <token>"

Response:

json
{
  "upvotes": 42,
  "downvotes": 3,
  "score": 39,
  "userVote": "up"
}

userVote is null if not logged in or not yet voted.


Vote

http
POST /stream/:id/vote

Votes for or against a stream. Requires authentication. Voting the same type again removes the vote.

Parameters:

NameTypeDescription
idintegerStream ID

Request Body:

json
{
  "voteType": "up"
}
FieldTypeValues
voteTypestring"up" or "down"

Example:

bash
curl -X POST https://api.radioreg.net/stream/1/vote \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"voteType": "up"}'

Response:

json
{
  "message": "Vote saved"
}

Possible messages: "Vote saved", "Vote updated", "Vote removed".


Update Stream Data (Webhook)

http
POST /stream/update/:streamUUID

Updates the currently playing song data of a stream. Requires the Organization API Token.

This endpoint accepts the simple RadioReg format as well as native AzuraCast webhooks.

Parameters:

NameTypeDescription
streamUUIDstringUUID of the stream

Request Body:

json
{
  "title": "Song Name",
  "artist": "Artist Name",
  "art": "https://cdn.example.com/cover.jpg",
  "nextTitle": "Next Song",
  "nextArtist": "Next Artist",
  "nextArt": "https://cdn.example.com/next-cover.jpg",
  "songDuration": 214,
  "songStartedAt": 1730465520
}
FieldTypeRequiredDescription
titlestringnoCurrent song title
artiststringnoCurrent artist
artstringnoCover art URL
nextTitlestringnoNext song title
nextArtiststringnoNext artist
nextArtstringnoCover art URL of the next song
songDurationnumbernoSong duration in seconds
songStartedAtintegernoUnix timestamp of song start

Example:

bash
curl -X POST https://api.radioreg.net/stream/update/a1b2c3d4-e5f6-... \
  -H "Authorization: Bearer rr_org_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Blinding Lights",
    "artist": "The Weeknd",
    "songDuration": 200,
    "songStartedAt": 1730465520
  }'

RadioReg API