Nyuki Music API Documentation

The complete developer guide for integrating our 24/7 live radio streams.

Core Concepts

The Nyuki API operates on a "true radio" model. Our servers continuously play music 24/7 across multiple stations. Your bot does not "play a song"; it tunes into the live broadcast at the exact moment the request is made. You cannot loop, pause, or restart a track from the client-side. The API enforces this to ensure a consistent, live experience for all users.

Authentication

To use the API, include your API key in the `Authorization` header for every request. You can generate keys from your Dashboard. Additionally, all requests must identify as a Node.js environment by including a valid `User-Agent`.


const axios = require('axios');

const api = axios.create({
    baseURL: 'https://nyukimusic.top/api',
    headers: {
        'Authorization': 'your-nyuki-api-key-here',
        'User-Agent': 'Your-Bot-Name/1.0 (Node.js)' // Must include 'Node.js' or 'axios'
    }
});
    

Endpoints


GET /stream/:station

Retrieves the live stream information for a specific station. This is the primary endpoint for playback.

Parameters

Success Response (200 OK)


{
  "message": "Live stream details retrieved successfully.",
  "streamUrl": "https://nyukimusic.top/static/lofi/song-03.mp3",
  "seek": "104.78" // Current playback time in seconds
}
    

POST /session/start

Notifies the API that your bot is starting a stream. This locks your API key to prevent concurrent use. This must be called after your bot has successfully joined a voice channel.

Request Body (JSON)


{
  "station": "lofi" // The station you are about to stream
}
    

Success Response (200 OK)


{
  "message": "Session started successfully."
}
    

POST /session/stop

Notifies the API that your bot has stopped streaming. This releases the lock on your API key, allowing it to be used again immediately.

Success Response (200 OK)


{
  "message": "Session stopped successfully."
}
    

GET /stations

Returns a list of all available stations on the API.

Success Response (200 OK)


{
    "stations": ["lofi", "chill", "phonks"]
}
    

GET /health

A public endpoint to check if the API server is online and running.

Success Response (200 OK)


{
    "status": "ok",
    "message": "Nyuki Music API is flying!"
}
    

Common Error Responses