Client configuration (token, base URL, language, ...).
OptionalaccountAccount uid, populated by Client.init.
API origin used to build request URLs.
Device descriptor used for queue requests.
Response language code.
OptionalmeAccount status, populated by Client.init.
OptionalonOptional hook for unmapped-field reports; see ClientOptions.onUnknownField.
Whether unknown-field warnings are enabled.
ReadonlyrequestThe HTTP transport.
OptionaltokenOAuth token used to authenticate requests, if any.
Fetch the account's experiment buckets.
The experiments, or null.
Fetch detailed experiment configuration for the account.
The detailed experiments, or null.
Change one or many of the current user's settings.
A single setting name, or a map of setting names to values.
Optionalvalue: string | number | booleanThe value, when paramOrData is a single setting name.
The updated user settings, or null.
Fetch the status of the authenticated account.
The account status, or null when the token is invalid.
Fetch an ad or an Alice shot to play after a track.
The upcoming track id.
Context identifier (for playlists, ownerId:playlistId).
OptionalprevTrackId: string | numberThe previous track id (optional for Alice shots).
Context kind. Defaults to playlist.
What to return after the track. Defaults to shot.
Where the context was entered from.
The shot event, or null.
Fetch one or many albums by id (without their track lists).
A single id or a list of ids.
The requested albums.
Fetch the disclaimer of an album.
The album id.
The disclaimer, or null.
Fetch entities similar to an album.
The album id.
The similar entities, or null.
Fetch the trailer of an album.
The album id.
The album trailer, or null.
Fetch a single album together with all of its tracks (grouped by volume).
The album id.
The album with its volumes, or null.
Fetch one or many artists by id.
A single id or a list of ids.
The requested artists.
Fetch the "about" block of an artist.
The artist id.
The about block, or null.
Fetch a page of compilations and albums the artist also appears on.
The artist id.
Page index (0-based). Defaults to 0.
Albums per page. Defaults to 20.
Sort key. Defaults to 'year'.
The page of albums, or null.
Fetch aggregate information about an artist.
The artist id.
The brief info, or null.
Fetch the artist-clips block of an artist.
The artist id.
The clips block, or null.
Fetch an artist's upcoming concerts.
The artist id.
The artist's concerts, or null.
Fetch a page of albums where the artist is the primary author.
The artist id.
Page index (0-based). Defaults to 0.
Albums per page. Defaults to 20.
Sort key. Defaults to 'year'.
The page of albums, or null.
Fetch the disclaimer of an artist.
The artist id.
The disclaimer, or null.
Fetch a page of the artist's discography.
The artist id.
Page index (0-based). Defaults to 0.
Albums per page. Defaults to 20.
Sort key. Defaults to 'year'.
The page of albums, or null.
Fetch the artist-donation block of an artist.
The artist id.
The donation block, or null.
Fetch detailed information about an artist.
The artist id.
The artist info, or null.
Fetch the external links shown on an artist's page.
The artist id.
The links, or null.
Fetch the artist's "safe" direct albums (no explicit content).
The artist id.
Sort key. Defaults to 'year'.
Sort direction. Defaults to 'desc'.
Maximum number of albums. Defaults to 20.
The albums, or null.
Fetch artists similar to the given one.
The artist id.
The similar artists, or null.
Fetch a skeleton (page layout) of an artist.
The artist id.
The skeleton id.
The skeleton, or null.
Fetch a page of the artist's track ids.
The artist id.
Page index (0-based). Defaults to 0.
Ids per page. Defaults to 20.
The list of track ids, or an empty array.
Fetch a page of an artist's tracks.
The artist id.
Page index (0-based). Defaults to 0.
Tracks per page. Defaults to 20.
The page of tracks, or null.
Fetch the trailer of an artist.
The artist id.
The trailer, or null.
Fetch a chart (/landing3/chart).
Optional chart option (for example a country code).
The chart, or null.
Fetch one or many clips by id.
A single clip id or a list of ids.
The requested clips.
Fetch the production credits of a clip.
The clip id.
The credits, or null.
Fetch the disclaimer of a clip.
The clip id.
The disclaimer, or null.
Fetch a recommended page of clips.
Page index (0-based). Defaults to 0.
Clips per page. Defaults to 50.
The recommended clips, or null.
Fetch detailed information about a concert.
The concert id.
The concert info, or null.
Fetch the concert feed, optionally filtered by location.
Optionallocations: (string | number)[]Location ids to filter by.
The concert feed, or null.
Fetch the skeleton (render scaffold) of a concert page.
The concert id.
The skeleton id. Defaults to 'concert_page'.
The skeleton, or null.
Fetch the available concert locations.
The locations, or null.
Fetch the concert tab configuration.
The tab config, or null.
Activate a promo code.
The promo code.
Optionallanguage: stringResponse language. Defaults to the client language.
The activation result, or null.
Run the full blocking device flow: request a code, surface it through
onCode, then poll until the user confirms and a token is returned.
Callback receiving the DeviceCode to show the user.
Polling/timeout configuration and credential overrides.
The issued OAuthToken.
Fetch the genre tree.
The list of top-level genres (each with nested sub-genres).
Initialize the client by loading account status.
Populates ClientBase.me and ClientBase.accountUid, which a number of other endpoints rely on. Call this once after construction.
The same client, for chaining.
Fetch a record label by id.
The label id.
The label, or null.
Fetch a page of a label's albums.
The label id.
Page index (0-based). Defaults to 0.
Albums per page. Defaults to 100.
OptionalsortBy: ArtistAlbumsSortBySort key.
OptionalsortOrder: SortOrderSort direction.
The page of albums, or null.
Fetch a page of a label's artists.
The label id.
Page index (0-based). Defaults to 0.
Artists per page. Defaults to 100.
The page of artists, or null.
Fetch one or more landing blocks (/landing3).
A block name or list of block names (for example personalplaylists, chart).
The landing page, or null.
Fetch aggregate information about a metatag.
The metatag id.
Optional per-section counts and sort keys.
The metatag, or null.
Fetch a page of a metatag's albums.
The metatag id.
Optional period, sort key and pagination.
The page of albums, or null.
Fetch a page of a metatag's artists.
The metatag id.
Period (required by the API, defaults to week), sort key, pagination and tracks-per-artist.
The page of artists, or null.
Fetch a page of a metatag's playlists.
The metatag id.
Optional sort key, pagination and likes-count flag.
The page of playlists, or null.
Fetch the metatag navigation (moods, activities, genres, epochs).
The metatag navigation, or null.
Fetch the user's listening history grouped by day.
How many items to return with their full models inlined. Defaults to 0.
The listening history, or null.
Fetch history items for a specific set of entities.
The entity ids to resolve.
The resolved history items, or null.
Pin an album.
The album id.
The created pin, or null.
Pin an artist.
The artist id.
The created pin, or null.
Pin a playlist.
The playlist owner uid.
The playlist kind.
The created pin, or null.
Pin a wave (radio seed, for example artist:12345).
The wave seed identifier.
The created pin, or null.
Report the current playback state of a track.
The playback report.
Whether the report was accepted.
Fetch a list of playlists by their uid:kind ids.
A single id or a list of ids in uid:kind form.
The playlists, or null.
Fetch entities similar to a playlist.
The playlist UUID.
The similar entities, or null.
Fetch a short-form list of playlists by their uid:kind ids.
A single id or a list of ids in uid:kind form.
The playlists.
The returned playlists do not carry their track lists; use
usersPlaylists to obtain a playlist with tracks populated.
Fetch a personal (auto-generated) playlist.
The personal-playlist id.
The generated playlist, or null.
Poll once for the token of a pending device authorization.
The deviceCode from requestDeviceCode.
OptionalclientId: stringOAuth client id.
OptionalclientSecret: stringOAuth client secret.
The token, or null while the user has not yet confirmed.
Fetch a single queue by id.
The queue id.
The queue, or null.
Create a new playback queue.
The queue, as a JSON object or a pre-serialized JSON string.
Optionaldevice: stringDevice descriptor. Defaults to the client device.
The id of the created queue, or null.
Fetch the list of the user's queues.
Optionaldevice: stringDevice descriptor. Defaults to the client device.
The queue summaries.
Update the current playing position of a queue.
The queue id.
The new current track index.
Optionaldevice: stringDevice descriptor (must match the queue's creator). Defaults to the client device.
Whether the update succeeded.
Create a realtime ("now playing") client backed by Ynison.
Overrides for token, device identity and reconnection.
A new realtime client.
Realtime events are the only server-push channel Yandex Music offers — there
are no HTTP webhooks. The returned RealtimeClient handles the
handshake, keep-alive and reconnection; just subscribe and start(). By
default trackChange events resolve the playing track via Client.tracks.
Requires the optional ws package (npm install ws).
Exchange a refresh token for a fresh access token (OAuth refresh_token grant).
Device-flow tokens expire; persist OAuthToken.refreshToken from deviceAuth and call this to renew the access token without a new login. The response usually rotates the refresh token too — store the new one from the returned OAuthToken.
The stored refresh token.
OptionalclientId: stringOAuth client id. Defaults to the Android app's id.
OptionalclientSecret: stringOAuth client secret. Defaults to the Android app's secret.
The refreshed OAuthToken.
Request a device/user code pair to start the OAuth Device Flow.
OptionaldeviceId: stringDevice id. Defaults to a random 10-character string.
OptionaldeviceName: stringDevice name. Defaults to YandexMusicAPI.
OptionalclientId: stringOAuth client id. Defaults to the Android app's id.
The issued DeviceCode.
Send listening feedback for a station.
Station id in type:tag form (for example user:onyourwave).
The kind of feedback.
Optional feedback fields.
OptionalbatchId?: stringId of the track batch the event refers to.
Optionalfrom?: stringWhere playback started (for example mobile-radio-user-123).
Optionaltimestamp?: numberEvent time (seconds since the epoch). Defaults to now.
OptionaltotalPlayedSeconds?: numberSeconds of the track played before the event.
OptionaltrackId?: string | numberId of the track the event refers to.
Whether the operation succeeded.
Shortcut for rotorStationFeedback(station, 'radioStarted', …).
Station id.
Where playback started.
OptionalbatchId: stringTrack batch id.
Optionaltimestamp: numberEvent time (seconds since the epoch).
Whether the operation succeeded.
Shortcut for rotorStationFeedback(station, 'skip', …).
Station id.
The track that was skipped.
Seconds played before skipping.
OptionalbatchId: stringTrack batch id.
Optionaltimestamp: numberEvent time (seconds since the epoch).
Whether the operation succeeded.
Shortcut for rotorStationFeedback(station, 'trackFinished', …).
Station id.
The track that finished.
Seconds played before finishing.
OptionalbatchId: stringTrack batch id.
Optionaltimestamp: numberEvent time (seconds since the epoch).
Whether the operation succeeded.
Shortcut for rotorStationFeedback(station, 'trackStarted', …).
Station id.
The track that started playing.
OptionalbatchId: stringTrack batch id.
Optionaltimestamp: numberEvent time (seconds since the epoch).
Whether the operation succeeded.
Fetch information about a specific station.
Station id in type:tag form (for example genre:pop).
The matching station results.
Change the settings of a station.
Station id.
The desired mood/energy.
The desired track diversity.
The desired language. Defaults to 'not-russian'.
The station type. Defaults to 'rotor'.
Whether the operation succeeded.
Fetch the full list of available stations.
Optionallanguage: stringLanguage for station info. Defaults to the client language.
The list of stations.
Fetch the next batch of tracks from a station.
Station id in type:tag form.
Use the second settings set (as official clients do). Defaults to true.
Optionalqueue: string | numberId of the track that just played, to inform the next batch.
The track batch, or null.
Search the catalogue.
The query text.
When false, mistyped queries are auto-corrected. Defaults to false.
Entity type to search for. Defaults to all.
Page index. Defaults to 0.
Whether playlists may appear as the best match. Defaults to true.
The search response, or null.
Fetch search suggestions for a partial query.
The partial query text.
The suggestions, or null.
Fetch purchase offers and payment configuration.
The settings, or null.
Fetch the playlists grouped under a tag.
The tag id.
The tagged playlists, or null.
Fetch one or many tracks by id.
A single id or a list of ids.
Include album track positions. Defaults to true.
The requested tracks.
Fetch the production credits of a track.
The track id.
The credits, or null.
Fetch the disclaimer of a track.
The track id.
The disclaimer, or null.
Fetch the available download variants for a track.
The track id.
Resolve direct file links eagerly. Defaults to false.
The list of download variants.
Fetch full information about a track.
The track id.
The full track info, or null.
Fetch lossless (FLAC) download info for a track via the /get-file-info
endpoint.
The track id (numeric, or "id:albumId").
Requested quality. Defaults to lossless.
The file info, or null when the endpoint returns none.
Unlike tracksDownloadInfo (legacy lossy mp3/aac), this resolves the
modern signed endpoint that can serve lossless FLAC. The returned stream
is AES-CTR-encrypted (transport: encraw); LosslessDownloadInfo.download
/ LosslessDownloadInfo.downloadBytes decrypt it transparently. When a
track has no lossless source the server falls back to a lossy codec — check
LosslessDownloadInfo.isLossless / .codec.
Fetch the lyrics of a track.
The track id.
TEXT (plain) or LRC (time-synced). Defaults to TEXT.
The lyrics, or null when none exist.
Fetch tracks similar to a track.
The track id.
The similar-tracks result, or null.
Fetch the trailer of a track.
The track id.
The trailer, or null.
Fetch supplementary information about a track (legacy lyrics, videos).
The track id.
The supplement, or null.
Dislike one or many artists.
Artist id(s).
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Remove the dislike from one or many artists.
Artist id(s).
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Fetch the user's disliked tracks.
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
The disliked-tracks library, or null.
Dislike one or many tracks.
Track id(s).
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Remove the dislike from one or many tracks.
Track id(s).
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Fetch the user's liked albums.
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
The liked albums.
Like one or many albums.
Album id(s).
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Remove the like from one or many albums.
Album id(s).
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Like one or many artists.
Artist id(s).
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Remove the like from one or many artists.
Artist id(s).
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Fetch a page of the user's liked clips.
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Page index (0-based). Defaults to 0.
Clips per page. Defaults to 20.
The liked clips, or null.
Fetch the user's liked playlists.
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
The liked playlists.
Like one or many playlists.
Playlist id(s) in ownerId:kind form.
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Remove the like from one or many playlists.
Playlist id(s) in ownerId:kind form.
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Fetch the user's liked tracks.
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
The liked-tracks library, or null.
Like one or many tracks.
Track id(s).
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Remove the like from one or many tracks.
Track id(s).
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Fetch one playlist (by a single kind) or several (by a list of kinds).
A single playlist kind, or a list of kinds.
OptionaluserId: string | numberOwner user id. Defaults to the authenticated account.
A single Playlist, a list of them, or null.
Apply a raw diff to a playlist.
The playlist kind.
The serialized diff (see Difference).
The playlist revision. Defaults to 1.
OptionaluserId: string | numberOwner user id. Defaults to the authenticated account.
The updated playlist, or null.
Create a new playlist.
The playlist title.
Access modifier. Defaults to 'public'.
OptionaluserId: string | numberOwner user id. Defaults to the authenticated account.
The created playlist, or null.
Remove a range of tracks from a playlist.
The playlist kind.
Start index (inclusive).
End index (exclusive).
The playlist revision. Defaults to 1.
OptionaluserId: string | numberOwner user id. Defaults to the authenticated account.
The updated playlist, or null.
Change a playlist's description.
The playlist kind.
The new description.
OptionaluserId: string | numberOwner user id. Defaults to the authenticated account.
The updated playlist, or null.
Insert a track into a playlist at the given index.
The playlist kind.
The track id to insert.
The album the track belongs to.
The insertion index. Defaults to 0.
The playlist revision. Defaults to 1.
OptionaluserId: string | numberOwner user id. Defaults to the authenticated account.
The updated playlist, or null.
Fetch every playlist owned by a user.
OptionaluserId: string | numberOwner user id. Defaults to the authenticated account.
The user's playlists.
Rename a playlist.
The playlist kind.
The new title.
OptionaluserId: string | numberOwner user id. Defaults to the authenticated account.
The updated playlist, or null.
Fetch track recommendations for a playlist.
The playlist kind.
OptionaluserId: string | numberOwner user id. Defaults to the authenticated account.
The recommendations, or null.
Fetch the trailer of a playlist.
The playlist kind.
OptionaluserId: string | numberOwner user id. Defaults to the authenticated account.
The trailer, or null.
Change a playlist's visibility.
The playlist kind.
The new visibility.
OptionaluserId: string | numberOwner user id. Defaults to the authenticated account.
The updated playlist, or null.
Fetch the user's pre-saved albums.
Include albums that have since been released. Defaults to true.
Include albums not yet released. Defaults to true.
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
The pre-saves, or null.
Pre-save an album.
The album id.
Automatically like the album once released. Defaults to true.
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
Whether the operation succeeded.
Fetch a user's library settings.
OptionaluserId: string | numberTarget user id. Defaults to the authenticated account.
The user settings, or null.
Typed, async client for the Yandex Music API.
Example
Remarks
Construct with an OAuth
tokenand call Client.init once to load account information used by some endpoints. Supported response languages areen,uz,uk,us,ru,kkandhy.