API Reference
Complete reference for the NCMGET class, the core of the NCMGET library.
Constructor
Creates a new NCMGET instance with default settings. No constructor parameters are required.
Instance Properties
Configuration Methods
cookie(cookie: string): this
Set the cookie for authenticated API access. Returns this for chaining.
The cookie is typically used for accessing user-specific data such as playlists and higher-quality audio streams.
format(format?: boolean): this
Toggle data formatting. When true (default), responses are formatted into structured objects. When false, raw API responses are returned. Returns this for chaining.
Data Retrieval Methods
search(keyword: string, option?: SearchOption): Promise<string>
Search for music resources on NetEase Cloud Music.
Parameters:
SearchOption:
Example:
song(id: string | number): Promise<string>
Get song details by ID.
Parameters:
Example:
album(id: string | number): Promise<string>
Get all songs in an album.
Parameters:
Example:
artist(id: string | number, limit?: number): Promise<string>
Get hot songs by an artist.
Parameters:
Example:
playlist(id: string | number): Promise<string>
Get all songs in a playlist.
Parameters:
Example:
Resource URL Methods
url(id: string | number, br?: number): Promise<string>
Get the audio playback URL for a song.
Parameters:
Example:
lrc(id: string | number): Promise<string>
Get lyrics with translation for a song.
Parameters:
Example:
pic(id: string | number, size?: number): Promise<string>
Get the cover image URL for a song.
Parameters:
Example:
