### Install MusicLibrary from Source Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/python/README.md Install from source by cloning the repository, installing dependencies, and building a wheel package. Refer to the build guide for detailed steps. ```bash git clone https://github.com/2061360308/MusicLibrary.git cd MusicLibrary/src/python pip install -r requirements.txt pip install dist/musiclibrary-*.whl ``` -------------------------------- ### Install NeteaseCloudMusicApi Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Clone the repository, navigate to the directory, and install dependencies using npm. ```shell git clone git@github.com:Binaryify/NeteaseCloudMusicApi.git cd NeteaseCloudMusicApi npm install ``` -------------------------------- ### Install NeteaseCloudMusicApi Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Clone the repository and install dependencies using npm. ```shell git clone git@github.com:Binaryify/NeteaseCloudMusicApi.git npm install ``` -------------------------------- ### Install pymusiclibrary via pip Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/python/README.md Recommended installation method using pip. Ensure you have Python 3.6+ installed. ```bash pip install pymusiclibrary ``` -------------------------------- ### Install Dependencies Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/开发指南.md Install project dependencies using pip. ```bash pip install -r requirements.txt ``` -------------------------------- ### Node.js API Call Example Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Shows how to call the Netease Cloud Music API from Node.js, starting from v3.31.0. It demonstrates importing modules, logging in with phone and password, and fetching user cloud data. ```javascript const { login_cellphone, user_cloud } = require('NeteaseCloudMusicApi') async function main() { try { const result = await login_cellphone({ phone: '手机号', password: '密码', }) console.log(result) const result2 = await user_cloud({ cookie: result.body.cookie, // 凭证 }) console.log(result2.body) } catch (error) { console.log(error) } } main() ``` -------------------------------- ### Get Sign-in Progress Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves the progress of sign-in activities. ```APIDOC ## GET /signin/progress ### Description Retrieves the progress of sign-in activities. ### Method GET ### Endpoint /signin/progress ### Parameters #### Query Parameters - **moduleId** (string) - Optional - The module ID for sign-in. Defaults to '1207signin-1207signin'. ``` -------------------------------- ### Get Settings Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieve user settings. Requires user authentication. ```APIDOC ## GET /setting ### Description Retrieve user settings. ### Method GET ### Endpoint /setting ### Request Example ``` /setting ``` ``` -------------------------------- ### Get Recommended Radio Stations Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md After logging in, this endpoint can be used to get recommended radio stations. It requires a 'type' parameter which corresponds to the radio station category. ```APIDOC ## GET /dj/recommend/type ### Description Retrieves recommended radio stations based on the provided type. ### Method GET ### Endpoint /dj/recommend/type ### Parameters #### Query Parameters - **type** (number) - Required - The type of radio station. Can be obtained from `/dj/catelist`. ``` -------------------------------- ### Get Recommended Videos Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieve recommended videos with optional offset for pagination. ```APIDOC ## Get Recommended Videos ### Description Retrieve recommended videos with optional offset for pagination. ### Method GET ### Endpoint /video/timeline/recommend ### Query Parameters - **offset** (number) - Optional - The offset for pagination, defaults to 0. ``` -------------------------------- ### Get Video Tag List Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieve a list of video tags. ```APIDOC ## Get Video Tag List ### Description Retrieve a list of video tags. ### Endpoint /video/group/list ### Method GET ``` -------------------------------- ### Get Musician Data Overview Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves an overview of statistical data for musicians after logging in. ```APIDOC ## Get Musician Data Overview ### Description Retrieves an overview of statistical data for musicians after logging in. ### Method GET ### Endpoint `/musician/data/overview` ### Request Example `/musician/data/overview` ``` -------------------------------- ### Get All Video List Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieve a list of all videos with optional offset for pagination. ```APIDOC ## Get All Video List ### Description Retrieve a list of all videos with optional offset for pagination. ### Method GET ### Endpoint /video/timeline/all ### Query Parameters - **offset** (number) - Optional - The offset for pagination, defaults to 0. ``` -------------------------------- ### Get Sheet Music Preview Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves the content of a sheet music, requires login. ```APIDOC ## GET /sheet/preview ### Description Retrieves the content of a sheet music. Requires user login. ### Method GET ### Endpoint /sheet/preview ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the sheet music. ``` -------------------------------- ### Get Artist Videos Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves videos associated with a given artist ID. ```APIDOC ## GET /artist/video ### Description Retrieves videos associated with a specific artist. ### Method GET ### Endpoint /artist/video ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the artist. - **size** (integer) - Optional - The number of videos to return. Defaults to 10. - **cursor** (string) - Optional - Cursor for pagination. Defaults to 0. - **order** (integer) - Optional - Sorting method. 0 for time, 1 for popularity. Defaults to 0. ``` -------------------------------- ### Get Music First Listen Info Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves 'Memory Coordinate' information for the current song. ```APIDOC ## GET /music/first/listen/info ### Description Retrieves 'Memory Coordinate' information for the current song. ### Method GET ### Endpoint /music/first/listen/info ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the song. ``` -------------------------------- ### Get Music Style Detail Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves descriptive information about a specific music style. ```APIDOC ## GET /style/detail ### Description Retrieves descriptive information about a specific music style. ### Method GET ### Endpoint /style/detail ### Parameters #### Query Parameters - **tagId** (string) - Required - The ID of the music style. ``` -------------------------------- ### Get Song URL Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves the playback URL for one or more songs using their IDs. For unlogged users or non-members, this returns a trial snippet with start and end times. A workaround for potential 403 errors is to use the returned song ID with `https://music.163.com/song/media/outer/url?id=id.mp3` as the `src` for an Audio element. ```APIDOC ## GET /song/url ### Description Retrieves the playback URL for songs based on their IDs. ### Method GET ### Endpoint /song/url ### Parameters #### Query Parameters - **id** (string) - Required - The ID(s) of the song(s), separated by commas if multiple. - **br** (number) - Optional - The bitrate for the song URL. Defaults to 999000 (maximum bitrate). Set to 320000 for 320k bitrate. ``` -------------------------------- ### Run NeteaseCloudMusicApi with a custom host Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Start the server with a custom host by setting the HOST environment variable. This is applicable for Mac/Linux and Windows using Git Bash or similar terminals. ```shell HOST=127.0.0.1 node app.js ``` ```shell set HOST=127.0.0.1 && node app.js ``` -------------------------------- ### Get All Cloud贝 Tasks Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieve a list of all available Cloud贝 tasks. Requires user authentication. ```APIDOC ## GET /yunbei/tasks ### Description Retrieve all Cloud贝 tasks. ### Method GET ### Endpoint /yunbei/tasks ### Request Example ``` /yunbei/tasks ``` ``` -------------------------------- ### Deploying on Tencent Cloud Serverless Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Instructions for deploying the Netease Cloud Music API on Tencent Cloud Serverless. This involves forking the project, creating a web application, selecting Express framework, and configuring the startup file. ```bash #!/bin/bash export PORT=9000 /var/lang/node16/bin/node app.js ``` -------------------------------- ### Build Wheel Package on Windows Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/python/README.md Steps to build a wheel package on Windows, including setting the library architecture and environment variables. ```bash # 1. 下载并配置预编译库 python setLibArch.py win64 # 或 win32、winarm # 2. 设置环境变量(CMD) set MUSICLIB_ARCH=win64 # 3. 构建 wheel python -m build --wheel ``` ```powershell PowerShell 设置环境变量: $env:MUSICLIB_ARCH="win64" python -m build --wheel ``` -------------------------------- ### Platform Configuration for KuGou Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/python/README.md Illustrates how to configure the platform (Lite or Web) when initializing the KuGou Music API. ```APIDOC ## Platform Configuration ```python from MusicLibrary.kuGouMusicApi import Platform, KugouProcessEnv # Supported platform types kugou = KuGouMusicApi(KugouProcessEnv(platform=Platform.LITE)) # Lite version kugou = KuGouMusicApi(KugouProcessEnv(platform=Platform.WEB)) # Standard version ``` ``` -------------------------------- ### Get User Subcount Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md After logging in, call this interface to get the user's information, including the counts of subscribed playlists, collected songs, MVs, and DJs. ```APIDOC ## GET /user/subcount ### Description Retrieves the user's subscription counts for playlists, songs, MVs, and DJs. ### Method GET ### Endpoint /user/subcount ### Response #### Success Response (200) - **playlistCount** (number) - The number of playlists the user has subscribed to. - **nYouCount** (number) - The number of songs the user has collected. - **mvCount** (number) - The number of MVs the user has subscribed to. - **djProgramCount** (number) - The number of DJ programs the user has subscribed to. ``` -------------------------------- ### Get Music Style List Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of music styles and their corresponding tag IDs. ```APIDOC ## GET /style/list ### Description Retrieves a list of music styles and their corresponding tag IDs. ### Method GET ### Endpoint /style/list ``` -------------------------------- ### Get Artist's MVs Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieve music video (MV) information for a given artist ID. The MV ID obtained here can be used with the '/mv' endpoint to get the playback URL. ```api /artist/mv?id=6452 ``` -------------------------------- ### Run NeteaseCloudMusicApi with Docker Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Instructions for running the API in a Docker container, including how to manage proxy environment variables and build a custom image. ```shell docker pull twesix/netease-cloud-music docker run -d -p 3000:3000 --name netease-cloud-music twesix/netease-music-api ``` ```shell // 去掉或者设置相关的环境变量 docker run -d -p 3000:3000 --name netease-cloud-music -e http_proxy= -e https_proxy= -e no_proxy= -e HTTP_PROXY= -e HTTPS_PROXY= -e NO_PROXY= netease-cloud-music ``` ```shell $ git clone https://github.com/Binaryify/NeteaseCloudMusicApi && cd NeteaseCloudMusicApi $ sudo docker build . -t netease-music-api $ sudo docker run -d -p 3000:3000 netease-music-api ``` -------------------------------- ### Get Recommended Radios Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of recommended radio stations. Requires user login. ```APIDOC ## GET /dj/recommend ### Description Retrieves a list of recommended radio stations. Requires user login. ### Method GET ### Endpoint /dj/recommend ``` -------------------------------- ### Get Artist MVs Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Retrieves music video (MV) information for a given artist ID. To get the MV playback URL, use the `/mv` endpoint with the `mvid` obtained from this endpoint. ```APIDOC ## GET /artist/mv ### Description Retrieves music video (MV) information for a given artist ID. To get the MV playback URL, use the `/mv` endpoint with the `mvid` obtained from this endpoint. ### Method GET ### Endpoint /artist/mv ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the artist. Can be obtained from the search interface. ### Request Example ``` /artist/mv?id=6452 ``` ``` -------------------------------- ### Run NeteaseCloudMusicApi Server Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Start the API server. The default port is 3000. You can specify a different port using the PORT environment variable. ```shell node app.js ``` ```shell PORT=4000 node app.js ``` ```shell set PORT=4000 && node app.js ``` -------------------------------- ### Get Events Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Call this interface to get various dynamic messages, corresponding to the 'Friends' interface on the Netease Cloud Music web version, including shared videos, music, photos, etc. ```APIDOC ## GET /event ### Description Retrieves various dynamic messages and activities. ### Method GET ### Endpoint /event ### Parameters No required parameters are explicitly mentioned in the source. ``` -------------------------------- ### KuGou Music API Usage with Lite Platform Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/python/README.md Demonstrates using the KuGou Music API with the LITE platform configuration. Shows how to fetch new songs and album details. ```python from MusicLibrary.kuGouMusicApi import KuGouMusicApi, Platform, KugouProcessEnv # 创建 API 实例(使用轻量版平台) kugou = KuGouMusicApi(KugouProcessEnv(platform=Platform.LITE)) # 获取新歌速递 response1 = kugou.top_song() print(response1) # 获取专辑详情 response2 = kugou.album_detail(id='10729818') print(response2) ``` -------------------------------- ### KuGou Music API Usage Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/python/README.md Shows how to initialize the KuGou Music API, specifying the platform, and performing common operations. ```APIDOC ## KuGou Music API ```python from MusicLibrary.kuGouMusicApi import KuGouMusicApi, Platform, KugouProcessEnv # Create API instance (using the Lite platform) kugou = KuGouMusicApi(KugouProcessEnv(platform=Platform.LITE)) # Get new songs delivery response1 = kugou.top_song() print(response1) # Get album details response2 = kugou.album_detail(id='10729818') print(response2) ``` **Example Methods**: - `top_song()` - Get new songs delivery - `album_detail()` - Get album details - `search_default()` - Search for songs - For more methods, refer to the `kuGouMusicApi.py` source code. ``` -------------------------------- ### Get Radio Programs Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of programs for a specific radio station. Note: The mp3Url in the response is invalid and will be null. Use the `/song/url` endpoint with the program's mainTrackId to get the audio URL. ```APIDOC ## GET /dj/program ### Description Retrieves a list of programs for a specific radio station. Note: The mp3Url in the response is invalid and will be null. Use the `/song/url` endpoint with the program's mainTrackId to get the audio URL. ### Method GET ### Endpoint /dj/program ### Parameters #### Query Parameters - **rid** (string) - Required - The ID of the radio station. - **limit** (integer) - Optional - The number of results to return. Defaults to 30. - **offset** (integer) - Optional - The number of results to skip for pagination. Defaults to 0. - **asc** (boolean) - Optional - Sorting order. Defaults to false (newest to oldest). Set to true for oldest to newest. ``` -------------------------------- ### Initialize User Profile Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Initialize the profile for a newly registered account, requiring a nickname. Must be called after login. ```http /activate/init/profile?nickname=testUser2019 ``` -------------------------------- ### Get Album Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves the content of an album using its ID. ```APIDOC ## GET /album ### Description Retrieves the content of an album using its ID. ### Method GET ### Endpoint /album ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the album, e.g., `32311` ``` -------------------------------- ### Docker Container Deployment Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Instructions for running the Netease Cloud Music API in a Docker container. Includes pulling the image, running a container, and options for managing proxy environment variables. ```shell docker pull binaryify/netease_cloud_music_api docker run -d -p 3000:3000 --name netease_cloud_music_api binaryify/netease_cloud_music_api // 或者 docker run -d -p 3000:3000 binaryify/netease_cloud_music_api // 去掉或者设置相关的环境变量 docker run -d -p 3000:3000 --name netease_cloud_music_api -e http_proxy= -e https_proxy= -e no_proxy= -e HTTP_PROXY= -e HTTPS_PROXY= -e NO_PROXY= binaryify/netease_cloud_music_api // 或者 docker run -d -p 3000:3000 -e http_proxy= -e https_proxy= -e no_proxy= -e HTTP_PROXY= -e HTTPS_PROXY= -e NO_PROXY= binaryify/netease_cloud_music_api ``` ```shell $ git clone https://github.com/Binaryify/NeteaseCloudMusicApi && cd NeteaseCloudMusicApi $ sudo docker build . -t netease-music-api $ sudo docker run -d -p 3000:3000 netease-music-api ``` -------------------------------- ### Get VIP Tasks Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves the list of available VIP tasks. ```APIDOC ## Get VIP Tasks ### Description Retrieves the list of available VIP tasks. ### Method GET ### Endpoint `/vip/tasks` ### Request Example `/vip/tasks` ``` -------------------------------- ### Initialize Profile Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Initializes the profile for a newly registered account. Requires login. ```APIDOC ## POST /activate/init/profile ### Description Initializes the profile for a newly registered account. Requires login. ### Method POST ### Endpoint /activate/init/profile ### Parameters #### Query Parameters - **nickname** (string) - Required - User nickname ### Request Example ``` /activate/init/profile?nickname=testUser2019 ``` ``` -------------------------------- ### Build Wheel Package on Linux Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/python/README.md Steps to build a wheel package on Linux, including setting the library architecture and environment variables. ```bash # 1. 下载并配置预编译库 python setLibArch.py linux64 # 或 linuxarm # 2. 设置环境变量 export MUSICLIB_ARCH=linux64 # 3. 构建 wheel python -m build --wheel ``` -------------------------------- ### Get Hot Radios Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of popular radio stations. ```APIDOC ## GET /dj/hot ### Description Retrieves a list of popular radio stations. ### Method GET ### Endpoint /dj/hot ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of results to return. Defaults to 30. - **offset** (integer) - Optional - The number of results to skip for pagination. Defaults to 0. ``` -------------------------------- ### Docker Deployment Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Instructions for deploying the Netease Cloud Music API within a Docker container. ```APIDOC ## Docker Container Deployment ### Using the Official Docker Image 1. **Pull the image:** ```bash docker pull binaryify/netease_cloud_music_api ``` 2. **Run the container:** ```bash docker run -d -p 3000:3000 --name netease_cloud_music_api binaryify/netease_cloud_music_api ``` Or, without a name: ```bash docker run -d -p 3000:3000 binaryify/netease_cloud_music_api ``` 3. **Handling Proxy Environment Variables in Docker:** If you encounter issues related to proxies within Docker, you might need to unset or configure the `http_proxy`, `https_proxy`, `HTTP_PROXY`, `HTTPS_PROXY`, `no_proxy`, and `NO_PROXY` environment variables. The `request` library used by the API checks these variables. To run without proxy environment variables affecting the request: ```bash docker run -d -p 3000:3000 --name netease_cloud_music_api \ -e http_proxy= -e https_proxy= -e no_proxy= \ -e HTTP_PROXY= -e HTTPS_PROXY= -e NO_PROXY= \ binaryify/netease_cloud_music_api ``` **Note:** If you provide a `proxy` query parameter in your API request, it will override these environment variables. ### Building Your Own Docker Image 1. **Clone the repository:** ```bash git clone https://github.com/Binaryify/NeteaseCloudMusicApi && cd NeteaseCloudMusicApi ``` 2. **Build the image:** ```bash sudo docker build . -t netease-music-api ``` 3. **Run the container:** ```bash sudo docker run -d -p 3000:3000 netease-music-api ``` ``` -------------------------------- ### Get Video Category List Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieve a list of video categories. ```APIDOC ## Get Video Category List ### Description Retrieve a list of video categories. ### Endpoint /video/category/list ### Method GET ``` -------------------------------- ### Netease Cloud Music API Usage Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/python/README.md Examples of using the Netease Cloud Music API wrapper. Instantiate the API and call methods like playlist_mylike, song_detail, and search_default. ```python from MusicLibrary.neteaseCloudMusicApi import NeteaseCloudMusicApi, NcmProcessEnv # 创建 API 实例 ncm = NeteaseCloudMusicApi() # 使用封装好的方法 response = ncm.playlist_mylike() print(response) # 获取歌曲详情 response = ncm.song_detail(ids="347230") print(response) # 搜索歌曲 response = ncm.search_default() print(response) ``` -------------------------------- ### KuGou Music Platform Configuration Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/python/README.md Shows how to configure the KuGou Music API instance for different platforms: LITE (concept version) and WEB (normal version). ```python from MusicLibrary.kuGouMusicApi import Platform, KugouProcessEnv # 支持的平台类型 kugou = KuGouMusicApi(KugouProcessEnv(platform=Platform.LITE)) # 概念版 kugou = KuGouMusicApi(KugouProcessEnv(platform=Platform.WEB)) # 普通版 ``` -------------------------------- ### Get Playlist Subscribers Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of users who have subscribed to a playlist. ```APIDOC ## GET /playlist/subscribers ### Description Fetches the list of users who have subscribed to a specific playlist. ### Method GET ### Endpoint /playlist/subscribers ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the playlist. - **limit** (number) - Optional - The number of subscribers to retrieve. Defaults to 20. - **offset** (number) - Optional - The offset for pagination. Defaults to 0. ``` -------------------------------- ### Like Resource (MV, Radio, Video) Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Allows users to like or unlike resources such as MVs, radio programs, and videos. Requires user login. ```APIDOC ## POST /resource/like ### Description Allows users to like or unlike resources such as MVs, radio programs, and videos. Requires user login. ### Method POST ### Endpoint /resource/like ### Parameters #### Query Parameters - **type** (integer) - Required - The type of the resource. 0: Song, 1: MV, 2: Playlist, 3: Album, 4: Radio Program, 5: Video, 6: Dynamic, 7: Radio. - **t** (integer) - Required - The operation: 1 for like, any other value for unlike. - **id** (string) - Required - The ID of the resource. For dynamics, use `threadId` instead. - **threadId** (string) - Required for Dynamics - The `threadId` of the dynamic. Can be obtained via `/event` or `/user/event` endpoints. The `id` parameter is not needed when liking a dynamic resource. ### Request Example ``` /resource/like?t=1&type=1&id=5436712 /resource/like?t=1&type=6&threadId=A_EV_2_6559519868_32953014 ``` ``` -------------------------------- ### Get Country Code List Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of country codes. ```APIDOC ## GET /countries/code/list ### Description Fetches a list of country codes. ### Method GET ### Endpoint /countries/code/list ``` -------------------------------- ### Run NeteaseCloudMusicApi using npx Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Execute the API directly using npx, which automatically handles dependency installation and execution. Specify a version or use 'latest' for the most recent version. ```shell npx NeteaseCloudMusicApi ``` ```shell npx NeteaseCloudMusicApi@版本号 ``` ```shell npx NeteaseCloudMusicApi@latest ``` -------------------------------- ### Get Artist Description Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Retrieves the description for a given artist ID. ```APIDOC ## GET /artist/desc ### Description Retrieves the description for a given artist ID. ### Method GET ### Endpoint /artist/desc ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the artist. ### Request Example ``` /artist/desc?id=6452 ``` ``` -------------------------------- ### Get Album Content Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Retrieves the content of an album using its ID. ```APIDOC ## GET /album ### Description Retrieves the content of an album using its ID. ### Method GET ### Endpoint /album ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the album. ### Request Example ``` /album?id=32311 ``` ``` -------------------------------- ### Build Wheel Package on macOS Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/python/README.md Steps to build a wheel package on macOS, including setting the library architecture and environment variables. ```bash # 1. 下载并配置预编译库 python setLibArch.py macos64 # 或 macosarm # 2. 设置环境变量 export MUSICLIB_ARCH=macos64 # 3. 构建 wheel python -m build --wheel ``` -------------------------------- ### Get Recently Played Podcasts Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of recently played podcasts. ```APIDOC ## GET /record/recent/dj ### Description Retrieves a list of recently played podcasts. ### Method GET ### Endpoint /record/recent/dj ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of podcasts to return. Defaults to 100. ``` -------------------------------- ### Netease Cloud Music API Usage Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/python/README.md Demonstrates how to create an instance of the Netease Cloud Music API and call its methods for various operations. ```APIDOC ## Netease Cloud Music API ```python from MusicLibrary.neteaseCloudMusicApi import NeteaseCloudMusicApi # Create API instance ncm = NeteaseCloudMusicApi() # Use encapsulated methods response = ncm.playlist_mylike() print(response) # Get song details response = ncm.song_detail(ids="347230") print(response) # Search for songs response = ncm.search_default() print(response) ``` **Example Methods**: - `login_cellphone()` - Phone number login - `playlist_mylike()` - Get user's liked playlists - `song_detail()` - Get song details - `search_default()` - Search for songs - `lyric()` - Get lyrics - `artist_detail()` - Get artist details - `album()` - Get album information - For more methods, refer to the `neteaseCloudMusicApi.py` source code. ``` -------------------------------- ### Get Recently Played Albums Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of recently played albums. ```APIDOC ## GET /record/recent/album ### Description Retrieves a list of recently played albums. ### Method GET ### Endpoint /record/recent/album ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of albums to return. Defaults to 100. ``` -------------------------------- ### Recommended Programs Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieve recommended programs with optional limit and offset for pagination. ```APIDOC ## Recommended Programs ### Description Retrieve recommended programs with optional limit and offset for pagination. ### Method GET ### Endpoint /program/recommend ### Query Parameters - **limit** (number) - Optional - The number of programs to retrieve, defaults to 10. - **offset** (number) - Optional - The offset for pagination, defaults to 0. ``` -------------------------------- ### Download Dynamic Libraries using Bash Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/dart/README.md Use the provided Bash script to automatically download and configure the necessary dynamic libraries for different platforms. Specify the target architecture and output directory. ```bash ./fetch_multi_release.sh win64:/home/user/libs linux64:/home/user/libs_linux macos64:/home/user/libs_macos ``` -------------------------------- ### Get Recently Played Playlists Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of recently played playlists. ```APIDOC ## GET /record/recent/playlist ### Description Retrieves a list of recently played playlists. ### Method GET ### Endpoint /record/recent/playlist ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of playlists to return. Defaults to 100. ``` -------------------------------- ### Get Recently Played Videos Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of recently played videos. ```APIDOC ## GET /record/recent/video ### Description Retrieves a list of recently played videos. ### Method GET ### Endpoint /record/recent/video ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of videos to return. Defaults to 100. ``` -------------------------------- ### Use Proxy for API Requests Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Example of making an API request with a proxy server specified in the query parameters. ```javascript // 例子 const url = `http://localhost:3000/music/url?id=33894312&proxy=http://121.196.226.246:84` fetch(url).then(function() { // do what you want }) // 结果 // {"data":[{"id":33894312,"url":"http://m10.music.126.net/20180104125640/930a968b3fb04908b733506b3833e60b/ymusic/0fd6/4f65/43ed/a8772889f38dfcb91c04da915b301617.mp3","br":320000,"size":10691439,"md5":"a8772889f38dfcb91c04da915b301617","code":200,"expi":1200,"type":"mp3","gain":-2.0E-4,"fee":0,"uf":null,"payed":0,"flag":0,"canExtend":false}],"code": 200} ``` -------------------------------- ### Get Recently Played Songs Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of recently played songs. ```APIDOC ## GET /record/recent/song ### Description Retrieves a list of recently played songs. ### Method GET ### Endpoint /record/recent/song ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of songs to return. Defaults to 100. ``` -------------------------------- ### Using Proxy for API Requests Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Demonstrates how to use a proxy for individual API requests by adding the 'proxy' parameter to the query string. Also mentions support for PAC proxies in v3.3.0 and later. ```javascript // 例子 const url = `http://localhost:3000/song/url?id=33894312&proxy=http://121.196.226.246:84` fetch(url).then(function () { // do what you want }) ``` ```json {"data":[{"id":33894312,"url":"http://m10.music.126.net/20180104125640/930a968b3fb04908b733506b3833e60b/ymusic/0fd6/4f65/43ed/a8772889f38dfcb91c04da915b301617.mp3","br":320000,"size":10691439,"md5":"a8772889f38dfcb91c04da915b301617","code":200,"expi":1200,"type":"mp3","gain":-2.0E-4,"fee":0,"uf":null,"payed":0,"flag":0,"canExtend":false}],"code": 200} ``` -------------------------------- ### Vercel Deployment Configuration Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Instructions for deploying the API on Vercel. Note that Vercel deployments require an additional 'realIP' parameter for API access. ```shell /song/url?id=191254&realIP=116.25.146.177 ``` -------------------------------- ### Get Artist Fans Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of fans for a given artist ID. ```APIDOC ## Get Artist Fans ### Description Retrieves a list of fans for a given artist ID. ### Method GET ### Endpoint `/artist/fans` ### Parameters #### Query Parameters - **id** (integer) - Required - The ID of the artist. - **limit** (integer) - Optional - The number of fans to return. Defaults to 20. - **offset** (integer) - Optional - The offset for pagination. For example, (page number - 1) * limit. ### Request Example `/artist/fans?id=2116&limit=10&offset=0` ``` -------------------------------- ### Create Playlist Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Creates a new playlist with a specified name. ```APIDOC ## POST /playlist/create ### Description Creates a new playlist with a specified name. ### Method POST ### Endpoint /playlist/create ### Parameters #### Query Parameters - **name** (string) - Required - The name of the playlist. ``` -------------------------------- ### Get General Notifications Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieve general notifications. Requires user authentication. ```APIDOC ## GET /msg/notices ### Description Retrieve general notifications. ### Method GET ### Endpoint /msg/notices ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of notifications to return (defaults to 30). - **lasttime** (string) - Optional - Use the `time` from the previous response to get the next page of data (defaults to -1). ### Request Example ``` /msg/notices?limit=3 ``` ``` -------------------------------- ### Download Dynamic Libraries using PowerShell Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/dart/README.md Use the provided PowerShell script to automatically download and configure the necessary dynamic libraries for different platforms. Specify the target architecture and output directory. ```powershell fetch_multi_release.ps1 win64:./libs linux64:./libs_linux macos64:./libs_macos ``` -------------------------------- ### Clone Project Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/开发指南.md Clone the project repository using Git. ```bash git clone git@github.com:2061360308/NeteaseCloudMusic_PythonSDK.git ``` -------------------------------- ### Get At Me Notifications Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieve notifications where the user is mentioned ('@ me'). Requires user authentication. ```APIDOC ## GET /msg/forwards ### Description Retrieve notifications where the user is mentioned. ### Method GET ### Endpoint /msg/forwards ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of notifications to return (defaults to 30). - **offset** (integer) - Optional - Offset for pagination (e.g., (page - 1) * 30, where 30 is the limit, defaults to 0). ### Request Example ``` /msg/forwards?limit=3 ``` ``` -------------------------------- ### Get Private Messages Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves private messages. Requires user login. ```APIDOC ## GET /msg/private ### Description Retrieves private messages. Requires user login. ### Method GET ### Endpoint /msg/private ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of results to return. Defaults to 30. - **offset** (integer) - Optional - The number of results to skip for pagination. Defaults to 0. ``` -------------------------------- ### TypeScript API Usage Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Example of using the Netease Cloud Music API with TypeScript. It demonstrates importing the 'banner' function and calling it with a type parameter. ```typescript // test.ts import { banner } from 'NeteaseCloudMusicApi' banner({ type: 0 }).then((res) => { console.log(res) }) ``` -------------------------------- ### Login Methods Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Details on the available login methods, including recommendations for handling passwords and security. ```APIDOC ## Login There are three primary login interfaces available. It is recommended to use `encodeURIComponent` for password encoding or to use POST requests to prevent issues with special characters (like `#`) in the password. **Security Advisory:** Avoid frequent calls to the login interface to prevent your IP from being flagged or your account from being restricted. If your login session is still active, reuse the existing session/cookie. **Note:** Due to Netease's implementation of Cloud Security verification, password-based login is currently not recommended. Prefer using SMS verification code or QR code login to avoid errors on certain API calls that require verification. ``` -------------------------------- ### 首页-发现-圆形图标入口列表 Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves the list of circular icon entry points for the app's homepage. ```APIDOC ## GET /homepage/dragon/ball ### Description Get the list of circular icon entry points for the app's homepage. ### Method GET ### Endpoint /homepage/dragon/ball ``` -------------------------------- ### Get Similar MVs Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves MVs similar to a given MV ID. ```APIDOC ## GET /simi/mv ### Description Retrieves MVs similar to a given MV ID. ### Method GET ### Endpoint /simi/mv ### Parameters #### Query Parameters - **mvid** (string) - Required - The ID of the MV ``` -------------------------------- ### Get Artist Details Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves detailed information for a given artist ID. ```APIDOC ## GET /artist/detail ### Description Retrieves detailed information for a given artist ID. ### Method GET ### Endpoint /artist/detail ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the artist ``` -------------------------------- ### Quick Start: Fetch User's Liked Playlist in Dart Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/src/dart/README.md Initialize the NeteaseCloudMusicApi and call the playlistMyLike() method to retrieve the user's liked songs. Check the response status and access the song list from the body. ```dart import 'package:musiclibrary/music_library.dart'; final ncm = NeteaseCloudMusicApi(); final response = await ncm.playlistMyLike(); if (response.status == 200) { final songs = response.body['playlist']['tracks']; } print(response); ``` -------------------------------- ### QR Code Login - Create QR Code Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Create a QR code for login using a generated key. Optionally return base64 encoded image. ```http /login/qr/create?key=xxx ``` -------------------------------- ### Get Collected Albums List Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of albums collected by the user. ```APIDOC ## GET /album/sublist ### Description Retrieves a list of albums collected by the user. ### Method GET ### Endpoint /album/sublist ### Parameters #### Query Parameters - **limit** (number) - Optional - The number of albums to retrieve, defaults to 25 - **offset** (number) - Optional - The offset for pagination, defaults to 0 ``` -------------------------------- ### Get Artist Details Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Fetch detailed information about an artist using their ID. ```api /artist/detail?id=11972054 ``` -------------------------------- ### Get User Radio Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves radio programs associated with a specific user. ```APIDOC ## GET /user/dj ### Description Fetches radio programs created or followed by a given user ID. ### Method GET ### Endpoint /user/dj ### Parameters #### Query Parameters - **uid** (number) - Required - The ID of the user. ``` -------------------------------- ### QR Code Login - Create QR Image Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Creates a QR code image using a generated key. Optionally returns the base64 encoded image. ```APIDOC ## POST /login/qr/create ### Description Creates a QR code image using a generated key. Optionally returns the base64 encoded image. ### Method POST ### Endpoint /login/qr/create ### Parameters #### Query Parameters - **key** (string) - Required - The key generated by `/login/qr/key` - **qrimg** (boolean) - Optional - If true, returns the base64 encoded QR image. ### Request Example ``` /login/qr/create?key=xxx ``` ``` -------------------------------- ### Get User Comment History Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves the comment history for a specific user. ```APIDOC ## GET /user/comment/history ### Description Fetches the comment history for a given user ID. ### Method GET ### Endpoint /user/comment/history ### Parameters #### Query Parameters - **uid** (number) - Required - The ID of the user whose comment history is to be retrieved. - **limit** (number) - Optional - The number of comments to return, defaults to 10. - **time** (number) - Optional - The timestamp of the last comment, used for pagination, defaults to 0. ``` -------------------------------- ### 收藏视频到视频歌单 Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Allows users to collect videos into a video playlist. Requires user login. ```APIDOC ## POST /playlist/track/add ### Description Collect videos into a video playlist. Requires user login. ### Method POST ### Endpoint /playlist/track/add ### Parameters #### Query Parameters - **pid** (string) - Required - Playlist ID - **ids** (string) - Required - Video ID(s), separated by commas ``` -------------------------------- ### Get User Playlist Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves a list of playlists created by a specific user. ```APIDOC ## GET /user/playlist ### Description Retrieves playlists associated with a given user ID. ### Method GET ### Endpoint /user/playlist ### Parameters #### Query Parameters - **uid** (number) - Required - The ID of the user whose playlists are to be retrieved. - **limit** (number) - Optional - The number of playlists to return, defaults to 30. - **offset** (number) - Optional - The offset for pagination, defaults to 0. ``` -------------------------------- ### 首页-发现 Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Retrieves information for the app's homepage. ```APIDOC ## GET /homepage/block/page ### Description Get app homepage information. ### Method GET ### Endpoint /homepage/block/page ### Parameters #### Query Parameters - **refresh** (boolean) - Optional - Whether to refresh the data, defaults to false - **cursor** (string) - Optional - Cursor for fetching next page data ``` -------------------------------- ### Create Playlist Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/README.md Creates a new playlist. Users can specify the playlist name, privacy settings, and type (e.g., normal, video, shared). ```APIDOC ## POST /playlist/create ### Description Creates a new playlist with a specified name and optional privacy and type settings. ### Method POST ### Endpoint /playlist/create ### Parameters #### Query Parameters - **name** (string) - Required - The name of the playlist. - **privacy** (string) - Optional - Set to '10' to make the playlist private. Defaults to public. - **type** (string) - Optional - The type of playlist. Options: 'NORMAL' (default), 'VIDEO', 'SHARED'. ``` -------------------------------- ### Get Similar Songs Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Retrieves songs similar to a given song ID. ```APIDOC ## GET /simi/song ### Description Retrieves songs similar to a given song ID. ### Method GET ### Endpoint /simi/song ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the song. ### Request Example ``` /simi/song?id=347230 ``` ``` -------------------------------- ### Get Similar Playlists Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Retrieves playlists similar to a given song ID. ```APIDOC ## GET /simi/playlist ### Description Retrieves playlists similar to a given song ID. ### Method GET ### Endpoint /simi/playlist ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the song. ### Request Example ``` /simi/playlist?id=347230 ``` ``` -------------------------------- ### Get Similar Artists Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Retrieves artists similar to a given artist ID. ```APIDOC ## GET /simi/artist ### Description Retrieves artists similar to a given artist ID. ### Method GET ### Endpoint /simi/artist ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the artist. ### Request Example ``` /simi/artist?id=6452 ``` ``` -------------------------------- ### Sign In Source: https://github.com/2061360308/neteasecloudmusic_pythonsdk/blob/main/docs/v2.md Allows users to sign in to their Netease Cloud Music account. Supports different sign-in types (Android, Web/PC) which yield different experience points upon successful sign-in. Requires user login. ```APIDOC ## Sign In ### Description Call this interface to sign in. You can optionally specify the sign-in type. Android sign-in grants 3 experience points, while Web/PC sign-in grants 2 experience points. User must be logged in. ### Method GET ### Endpoint `/daily_signin` ### Parameters #### Query Parameters - **type** (integer) - Optional - Sign-in type. Defaults to 0. 0 for Android sign-in, 1 for Web/PC sign-in. ### Request Example `/daily_signin` ### Response #### Success Response (200) Returns a success message and user experience points upon successful sign-in. #### Response Example (Image reference: signinSuccess.png) ```