NodeLink
API Reference

NodeLink Features

Exclusive NodeLink features and enhancements.

NodeLink Features

Features unique to NodeLink that extend beyond standard Lavalink compatibility.

Audio Mixer

Audio Mixer

FEATURE
mixer
Overlay auxiliary audio tracks (TTS, SFX) on top of the main playback.

Overview

The Audio Mixer allows you to play secondary audio tracks simultaneously with the main track. This is perfect for:

  • Voiceovers & TTS: Announce song names or read chat messages without stopping the music.
  • Sound Effects: Play airhorns, applause, or memes over the active track.
  • Background Music: Keep a low-volume ambient track running while playing other media.

The mixer works by intercepting the main audio stream and digitally mixing the PCM data from auxiliary sources before encoding. It features intelligent buffering to handle sources that download faster than real-time (like TTS) and automatic clamping to prevent audio distortion.

Endpoints

The mixer exposes a full REST API for managing layers:

  • POST /v4/sessions/:sessionId/players/:guildId/mix - Add a new layer
  • GET /v4/sessions/:sessionId/players/:guildId/mix - List active layers
  • PATCH /v4/sessions/:sessionId/players/:guildId/mix/:mixId - Update layer volume
  • DELETE /v4/sessions/:sessionId/players/:guildId/mix/:mixId - Remove a layer

WebSocket Events

Enhanced Track Metadata

Holo Tracks

CONFIG
enableHoloTracks
Automatically enriches tracks with comprehensive metadata when they start playing.

Overview

When enabled in config.js, NodeLink makes an additional API call to YouTube when a track starts, gathering rich metadata that would normally require multiple separate API calls. The enriched data includes channel information (name, subscribers, verified status), track details (views, publish date, keywords), media quality options, external links from the channel (Spotify, Instagram), and multiple thumbnail resolutions. All data is returned in the pluginInfo object with type: "holo" during the TrackStartEvent.

Configuration

// config.js
enableHoloTracks: true
# Docker environment variable
NODELINK_ENABLEHOLOTRACKS=true

Use Cases & Performance

Use Case

Ideal for music bots displaying rich embeds with artist info, applications showing detailed video metadata without extra API calls, and clients wanting comprehensive track information automatically.

Performance Impact

Adds one extra YouTube API request per track start (100-300ms latency). Only works for YouTube/YouTube Music sources. Uses ~5-20 KB extra bandwidth per track.

Example Response

Lyrics & Chapters

LoadLyrics

GET
/v4/loadlyrics
Load synced or unsynced lyrics from multiple sources automatically.

Query Parameters

encodedTrackstringRequired
Base64 encoded track string
langstring
Language code for lyrics (e.g., 'en', 'es', 'pt', 'ja')

Lyrics Sources

Source Priority

NodeLink automatically tries multiple sources in order until lyrics are found:

  1. YouTube Captions - Synced, timestamped lyrics from captions
  2. Musixmatch - Large database of synced lyrics
  3. LRCLib - Open-source community synced lyrics
  4. Genius - Community-sourced plain text lyrics

The source field in the response indicates which provider returned the lyrics.

Example Request

curl -X GET "http://your-server.com/v4/loadlyrics?encodedTrack=QAAAjQIAJVJpY2sgQXN0bGV5...&lang=en" \
     -H "Authorization: yourPassword"

Response

LoadChapters

GET
/v4/loadchapters
Retrieve chapter markers from YouTube videos.

Query Parameters

encodedTrackstringRequired
Base64 encoded track string (YouTube videos only)

Example Request

curl -X GET "http://your-server.com/v4/loadchapters?encodedTrack=QAAAAAMAM0hvdyB0byBBZGQgQ2hhcHRlcnMgdG8gWW91ciBWaWRlb3MgVXNpbmcgVGltZXN0YW1wcwAQWW91VHViZSBDcmVhdG9ycwAAAAAAATSYAAtiMUZvX01fdGo2dwABACtodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PWIxRm9fTV90ajZ3AQA2aHR0cHM6Ly9pLnl0aW1nLmNvbS92aV93ZWJwL2IxRm9fTV90ajZ3L3NkZGVmYXVsdC53ZWJwAAAHeW91dHViZQAAAAAAAAAA" \
     -H "Authorization: yourPassword"

Response

Direct Streaming

TrackStream

GET
/v4/trackstream
Stream audio directly from NodeLink without Discord voice connection.

Configuration

Feature Must Be Enabled

This feature must be explicitly enabled in your configuration:

// config.js
enableTrackStreamEndpoint: true

Query Parameters

encodedTrackstringRequired
Base64 encoded track string
itagnumber
Specific YouTube itag for quality/format selection (e.g., 251 for opus)

Example Request

curl -X GET "http://your-server.com/v4/trackstream?encodedTrack=QAAAAAMAM0hvdyB0byBBZGQgQ2hhcHRlcnMgdG8gWW91ciBWaWRlb3MgVXNpbmcgVGltZXN0YW1wcwAQWW91VHViZSBDcmVhdG9ycwAAAAAAATSYAAtiMUZvX01fdGo2dwABACtodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PWIxRm9fTV90ajZ3AQA2aHR0cHM6Ly9pLnl0aW1nLmNvbS92aV93ZWJwL2IxRm9fTV90ajZ3L3NkZGVmYXVsdC53ZWJwAAAHeW91dHViZQAAAAAAAAAA&itag=251" \
     -H "Authorization: yourPassword"

Use Cases

Common Applications

  • Radio/streaming applications that need raw audio
  • Bot audio recording and archiving systems
  • Audio preview functionality
  • Custom audio processing pipelines
  • Downloading tracks for offline playback

Security Warning

Enable this feature carefully as it allows direct audio downloads. Consider rate limiting and authentication.

Response

LoadStream

GET / POST
/v4/loadstream
Stream raw PCM audio for custom processing or recording.

Configuration

Feature Must Be Enabled

Enable the endpoint in config:

// config.js
enableLoadStreamEndpoint: true

Query / Body Parameters

encodedTrackstringRequired
Base64 encoded track string.
volumenumber
Volume 0 to 1000 (default: 100).
positionnumber
Start position in milliseconds.
filtersobject | string
JSON filters object (query can be JSON string).

Example Request

curl -X GET "http://your-server.com/v4/loadstream?encodedTrack=QAAAAAMAM0hvdyB0byBBZGQgQ2hhcHRlcnMgdG8gWW91ciBWaWRlb3MgVXNpbmcgVGltZXN0YW1wcwAQWW91VHViZSBDcmVhdG9ycwAAAAAAATSYAAtiMUZvX01fdGo2dwABACtodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PWIxRm9fTV90ajZ3AQA2aHR0cHM6Ly9pLnl0aW1nLmNvbS92aV93ZWJwL2IxRm9fTV90ajZ3L3NkZGVmYXVsdC53ZWJwAAAHeW91dHViZQAAAAAAAAAA&position=30000" \
     -H "Authorization: yourPassword" \
     --output track.pcm

Response

Monitoring & Metrics

Prometheus Metrics

GET
/v4/metrics
Detailed metrics in Prometheus format for monitoring and alerting.

Example Request

curl -X GET "http://your-server.com/v4/metrics" \
     -H "Authorization: yourPassword"

Metric Categories

Grafana Dashboard

Pre-configured Dashboard

See the Prometheus page for a complete Grafana dashboard with pre-configured panels for all NodeLink metrics.

Detailed Stats

GET
/v4/stats
Extended statistics with per-source and per-endpoint usage tracking.

Example Request

curl -X GET "http://your-server.com/v4/stats" \
     -H "Authorization: yourPassword"

Additional Fields

Enhanced Statistics

Beyond standard Lavalink stats, NodeLink includes detailedStats with granular usage metrics.

Response

Use Cases

Useful For

  • Identifying most used API endpoints
  • Tracking popular audio sources
  • Monitoring error rates per endpoint
  • Analyzing playback event distribution

Additional Filters

NodeLink includes additional audio filters beyond the standard Lavalink filters, all processed in real-time.

Echo

FILTER
echo
Creates delay-based repetitions with feedback control

Parameters

delaynumber
Delay time in milliseconds (0-5000ms)
feedbacknumber
Amount of signal fed back (0.0-1.0)
mixnumber
Dry/wet mix ratio (0.0-1.0)

Example Usage

{
  "filters": {
    "echo": {
      "delay": 500,
      "feedback": 0.3,
      "mix": 0.5
    }
  }
}

Chorus

FILTER
chorus
Simulates multiple voices with modulated delays

Parameters

ratenumber
LFO modulation rate in Hz
depthnumber
Modulation depth (0.0-1.0)
delaynumber
Base delay time in milliseconds (1-45ms)
mixnumber
Dry/wet mix ratio (0.0-1.0)
feedbacknumber
Feedback amount (0.0-0.95)

Example Usage

{
  "filters": {
    "chorus": {
      "rate": 1.5,
      "depth": 0.5,
      "delay": 25,
      "mix": 0.6,
      "feedback": 0.2
    }
  }
}

Compressor

FILTER
compressor
Dynamic range compression for balanced audio

Parameters

thresholdnumber
Threshold level in dB
rationumber
Compression ratio (1.0 = no compression)
attacknumber
Attack time in milliseconds
releasenumber
Release time in milliseconds
gainnumber
Makeup gain in dB

Example Usage

{
  "filters": {
    "compressor": {
      "threshold": -20,
      "ratio": 4,
      "attack": 10,
      "release": 100,
      "gain": 5
    }
  }
}

Highpass

FILTER
highpass
Attenuates low frequencies

Parameters

smoothingnumber
Smoothing factor (>1.0 to enable)

Example Usage

{
  "filters": {
    "highpass": {
      "smoothing": 20
    }
  }
}

Phaser

FILTER
phaser
Sweeps all-pass filters across frequency spectrum

Parameters

stagesnumber
Filter stages (2-12)
ratenumber
LFO rate in Hz
depthnumber
Modulation depth (0.0-1.0)
feedbacknumber
Feedback amount (0.0-0.9)
mixnumber
Dry/wet mix (0.0-1.0)
minFrequencynumber
Minimum sweep frequency in Hz
maxFrequencynumber
Maximum sweep frequency in Hz

Example Usage

{
  "filters": {
    "phaser": {
      "stages": 6,
      "rate": 0.5,
      "depth": 0.7,
      "feedback": 0.5,
      "mix": 0.5,
      "minFrequency": 200,
      "maxFrequency": 2000
    }
  }
}

Spatial

FILTER
spatial
Creates spatial audio using cross-channel delays

Parameters

depthnumber
Effect depth (0.0-1.0)
ratenumber
Modulation rate in Hz

Example Usage

{
  "filters": {
    "spatial": {
      "depth": 0.8,
      "rate": 0.3
    }
  }
}

Multi-Audio Track Support

NodeLink supports selecting specific audio tracks for videos that contain multiple audio streams (e.g., Netflix-style dubs, multi-language YouTube videos).

Audio Track Selector

FEATURE
audioTrackId
Select a specific audio language/track for playback.

How to use

1. Check for available tracks

When you load a track (especially from YouTube), the response includes an audioTracks array inside pluginInfo. This lists all available audio streams for that video.

"pluginInfo": {
    "audioTracks": [
        {
            "id": "en",
            "name": "English (Original)",
            "isDefault": true,
            "isAutoDubbed": false
        },
        {
            "id": "pt-br",
            "name": "Portuguese (Brazil)",
            "isDefault": false,
            "isAutoDubbed": true
        }
    ]
}

2. Select a track

By default, NodeLink plays the default/original audio. To play a different track (e.g., Portuguese dub), pass the audioTrackId in the track object when updating the player.

curl -X PATCH "http://your-server.com/v4/sessions/{sessionId}/players/{guildId}" \
     -H "Authorization: yourPassword" \
     -H "Content-Type: application/json" \
     -d '{
       "track": {
         "encoded": "...",
         "audioTrackId": "pt-br"
       }
     }'

Use Cases

  • Multi-language Videos: Allow users to switch between original audio and dubbed versions.
  • Descriptive Audio: Select audio tracks with descriptive commentary for accessibility.

Multi-Audio Track Support

NodeLink supports selecting specific audio tracks for videos that contain multiple audio streams (e.g., Netflix-style dubs, multi-language YouTube videos).

Audio Track Selector

FEATURE
audioTrackId
Select a specific audio language/track for playback.

How to use

1. Check for available tracks

When you load a track (especially from YouTube), the response includes an audioTracks array inside pluginInfo. This lists all available audio streams for that video.

To see this information, you must load the track using loadTracks.

"pluginInfo": {
    "audioTracks": [
        {
            "id": "en",
            "name": "English (Original)",
            "isDefault": true,
            "isAutoDubbed": false
        },
        {
            "id": "pt-br",
            "name": "Portuguese (Brazil)",
            "isDefault": false,
            "isAutoDubbed": true
        }
    ]
}

2. Select a track

By default, NodeLink plays the default/original audio. To play a different track (e.g., Portuguese dub), pass the audioTrackId in the track object when updating the player.

curl -X PATCH "http://your-server.com/v4/sessions/{sessionId}/players/{guildId}" \
     -H "Authorization: yourPassword" \
     -H "Content-Type: application/json" \
     -d '{
       "track": {
         "encoded": "...",
         "audioTrackId": "pt-br"
       }
     }'

Use Cases

  • Multi-language Videos: Allow users to switch between original audio and dubbed versions.
  • Descriptive Audio: Select audio tracks with descriptive commentary for accessibility.

Event Behavior

NodeLink modifies when certain events are emitted for better accuracy.

TrackStartEvent

EVENT
TrackStartEvent
Emitted only when audio stream actually begins

Behavior

Enhanced Accuracy

Unlike Lavalink which emits TrackStartEvent immediately when you call update player, NodeLink waits until the audio stream actually starts flowing. This means you receive the event only when playback truly begins.

This provides more accurate timing for tracking actual playback start times and prevents false positives when tracks fail to load after being queued.

YouTube Source Configuration

Update Config

PATCH
/v4/youtube/config
Updates the YouTube configuration (RefreshToken or VisitorData) in real-time.

Body

refreshTokenstring
New Refresh Token from Google OAuth.
visitorDatastring
Visitor Data (poToken context).

Example Request

curl -X PATCH "http://your-server.com/v4/youtube/config" \
     -H "Authorization: yourPassword" \
     -H "Content-Type: application/json" \
     -d '{
       "refreshToken": "1//0gN...",
       "visitorData": "Cgt..."
     }'

Response

Get Config

GET
/v4/youtube/config
Checks the current configuration state and optionally validates the token.

Query Parameters

validateboolean
If true, performs a real-time validation check with Google.

Response

OAuth

POST / GET
/v4/youtube/oauth
Exchange a Refresh Token for an Access Token. Useful for debugging or external use.

Methods Supported

refreshTokenstringRequired
Required for POST via body, or GET via query parameter.

Body (POST)

refreshTokenstringRequired
The refresh token to exchange.

Query Parameters (GET)

refreshTokenstringRequired
The refresh token to exchange.

Example Request (POST)

curl -X POST "http://your-server.com/v4/youtube/oauth" \
     -H "Authorization: yourPassword" \
     -H "Content-Type: application/json" \
     -d '{"refreshToken": "..."}'

Example Request (GET)

curl -X GET "http://your-server.com/v4/youtube/oauth?refreshToken=..." \
     -H "Authorization: yourPassword"

Response

On this page