Top Related Projects
网易云音乐命令行版本
one for all free music in china (chrome extension, also works for firefox)
高颜值的第三方网易云播放器,支持 Windows / macOS / Linux :electron:
Salt Player for Android Release, Feedback
一个基于 electron 的音乐软件
音乐搜索器 - 多站合一音乐搜索解决方案
Quick Overview
NeteaseCloudMusicApi is an open-source Node.js API for the NetEase Cloud Music service, a popular music streaming platform in China. It provides developers with a way to interact with the service programmatically, allowing access to various features such as searching for songs, retrieving playlists, and managing user accounts.
Pros
- Comprehensive API coverage of NetEase Cloud Music features
- Well-documented with clear examples and explanations
- Actively maintained with regular updates and bug fixes
- Large community support and contributions
Cons
- Potential legal concerns due to unofficial nature of the API
- Dependency on NetEase's service stability and potential changes
- Limited to Chinese market and content
- May require additional steps for deployment outside of China due to network restrictions
Code Examples
- Searching for a song:
const { search } = require('NeteaseCloudMusicApi');
search({
keywords: 'Shape of You',
type: 1 // 1: song, 10: album, 100: artist, 1000: playlist
}).then(result => {
console.log(result.body.result.songs);
});
- Getting user playlist:
const { user_playlist } = require('NeteaseCloudMusicApi');
user_playlist({
uid: '32953014'
}).then(result => {
console.log(result.body.playlist);
});
- Logging in:
const { login_cellphone } = require('NeteaseCloudMusicApi');
login_cellphone({
phone: '13xxx',
password: 'password'
}).then(result => {
console.log(result.body);
});
Getting Started
-
Install the package:
npm install NeteaseCloudMusicApi
-
Import and use the API:
const { search, playlist_detail } = require('NeteaseCloudMusicApi'); // Example: Search for a song search({ keywords: 'Wonderwall', type: 1 }).then(result => { console.log(result.body.result.songs); }); // Example: Get playlist details playlist_detail({ id: '24381616' }).then(result => { console.log(result.body.playlist); });
-
Refer to the documentation for more detailed usage and available endpoints.
Competitor Comparisons
网易云音乐命令行版本
Pros of musicbox
- Command-line interface for easy and quick access
- Lightweight and efficient, suitable for low-resource environments
- Supports offline mode for cached songs
Cons of musicbox
- Less comprehensive API coverage compared to NeteaseCloudMusicApi
- Not actively maintained, with the last update in 2019
- Limited documentation and community support
Code Comparison
NeteaseCloudMusicApi (JavaScript):
const { login_cellphone, user_playlist } = require('NeteaseCloudMusicApi')
login_cellphone({
phone: '手机号',
password: '密码'
}).then(result => {
console.log(result)
user_playlist({
uid: result.body.account.id
}).then(data => {
console.log(data)
})
})
musicbox (Python):
from NEMbox import api
client = api.NetEase()
client.login('username', 'password')
playlists = client.user_playlist('user_id')
print(playlists)
Both repositories provide APIs for interacting with NetEase Cloud Music, but NeteaseCloudMusicApi offers a more extensive and up-to-date set of features. musicbox, while more lightweight and suitable for command-line use, has not been actively maintained recently. NeteaseCloudMusicApi is written in JavaScript, making it ideal for web-based applications, while musicbox is implemented in Python, which may be preferable for some developers or use cases.
one for all free music in china (chrome extension, also works for firefox)
Pros of listen1_chrome_extension
- Cross-platform support: Works as a Chrome extension, making it accessible on various operating systems
- Multi-source integration: Aggregates music from multiple streaming platforms into a single interface
- User-friendly interface: Provides a more intuitive and visually appealing user experience
Cons of listen1_chrome_extension
- Limited to browser environment: Requires Chrome or compatible browsers to function
- Potential for instability: May be affected by changes in streaming platforms' APIs or website structures
- Less flexibility for developers: More challenging to integrate into custom applications or services
Code Comparison
NeteaseCloudMusicApi (Node.js):
const { login_cellphone } = require('NeteaseCloudMusicApi')
login_cellphone({
phone: '手机号',
password: '密码'
}).then(result => {
console.log(result)
})
listen1_chrome_extension (JavaScript):
L1Player.play({
id: 'xxx',
platform: 'netease',
title: 'Song Title',
artist: 'Artist Name',
album: 'Album Name',
albumId: 'yyy',
lyric_url: 'http://example.com/lyric.lrc'
})
The code snippets demonstrate the different approaches: NeteaseCloudMusicApi focuses on providing raw API access, while listen1_chrome_extension offers a higher-level interface for playback across multiple platforms.
高颜值的第三方网易云播放器,支持 Windows / macOS / Linux :electron:
Pros of YesPlayMusic
- User-friendly interface with a modern, aesthetically pleasing design
- Cross-platform support (Windows, macOS, Linux) as an Electron-based desktop application
- Integrated lyrics display and Last.fm scrobbling features
Cons of YesPlayMusic
- Limited to a music player application, while NeteaseCloudMusicApi provides a more versatile API
- May have higher resource usage due to being an Electron app compared to a lightweight API
Code Comparison
YesPlayMusic (Vue.js component):
<template>
<div class="player">
<Cover :url="cover" :playing="playing" />
<div class="controls">
<button @click="togglePlay">{{ playing ? 'Pause' : 'Play' }}</button>
</div>
</div>
</template>
NeteaseCloudMusicApi (Node.js API endpoint):
module.exports = async (query, request) => {
const data = {
ids: query.id,
br: parseInt(query.br || 999000)
}
return request(
'POST', `https://music.163.com/weapi/song/enhance/player/url`, data,
{crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
)
}
YesPlayMusic focuses on creating a user interface for music playback, while NeteaseCloudMusicApi provides raw API endpoints for accessing music data and functionality.
Salt Player for Android Release, Feedback
Pros of SaltPlayerSource
- Written in Kotlin, offering modern language features and better Android integration
- Focuses on a local music player experience, providing more control over playback
- Implements a clean architecture with separation of concerns
Cons of SaltPlayerSource
- Limited to local music playback, lacking cloud music streaming capabilities
- Smaller community and fewer contributors compared to NeteaseCloudMusicApi
- Less comprehensive documentation and API coverage
Code Comparison
SaltPlayerSource (Kotlin):
class MusicPlayerService : Service(), MediaPlayer.OnPreparedListener {
private lateinit var mediaPlayer: MediaPlayer
override fun onBind(intent: Intent): IBinder? {
return null
}
}
NeteaseCloudMusicApi (JavaScript):
const createServer = port => {
const app = express()
const http = require('http')
const server = http.createServer(app)
server.listen(port, () => {
console.log(`server running @ http://localhost:${port}`)
})
}
SaltPlayerSource is a Kotlin-based local music player for Android, offering a clean architecture and modern language features. It provides more control over local playback but lacks cloud streaming capabilities. NeteaseCloudMusicApi, on the other hand, is a JavaScript-based API for cloud music streaming, with a larger community and more comprehensive documentation. The code comparison shows the different focus areas: SaltPlayerSource implements a music player service, while NeteaseCloudMusicApi sets up a server for API requests.
一个基于 electron 的音乐软件
Pros of lx-music-desktop
- Full-featured desktop application with a user-friendly interface
- Supports multiple music sources and platforms
- Offers offline playback and playlist management
Cons of lx-music-desktop
- Limited to desktop platforms, not available as a web or mobile app
- May require more system resources compared to a lightweight API
Code Comparison
NeteaseCloudMusicApi (JavaScript):
const { login_cellphone } = require('NeteaseCloudMusicApi')
login_cellphone({
phone: '手机号',
password: '密码'
}).then(result => {
console.log(result)
})
lx-music-desktop (TypeScript):
import { httpFetch } from '../../../utils/request'
export const getMusicUrl = (songmid: string, type: string): Promise<string> => {
return httpFetch(`https://api.example.com/song/url?id=${songmid}&type=${type}`)
.then(({ body }) => body.data.url)
}
The NeteaseCloudMusicApi example shows a simple login function, while the lx-music-desktop snippet demonstrates a method to fetch music URLs. lx-music-desktop uses TypeScript, which provides better type checking and code organization. NeteaseCloudMusicApi focuses on providing API endpoints, while lx-music-desktop implements full application logic for music playback and management.
音乐搜索器 - 多站合一音乐搜索解决方案
Pros of music
- Supports multiple music platforms (QQ Music, Netease Cloud Music, Xiami Music, etc.)
- Provides a simple web interface for searching and playing music
- Lightweight and easy to deploy
Cons of music
- Less actively maintained compared to NeteaseCloudMusicApi
- Limited documentation and examples
- Fewer API endpoints and features
Code comparison
music:
$api = new \Metowolf\Meting('netease');
$data = $api->format(true)->search('Hello');
NeteaseCloudMusicApi:
const { search } = require('NeteaseCloudMusicApi')
const result = await search({
keywords: 'Hello',
type: 1
})
Summary
music is a multi-platform music API that offers a simple web interface and supports various Chinese music services. It's lightweight and easy to use but has limited documentation and fewer features compared to NeteaseCloudMusicApi.
NeteaseCloudMusicApi focuses solely on Netease Cloud Music, providing a more comprehensive set of API endpoints and better documentation. It's more actively maintained and has a larger community, but lacks support for other music platforms.
Choose music if you need multi-platform support and a simple web interface. Opt for NeteaseCloudMusicApi if you require a more robust and well-documented API specifically for Netease Cloud Music.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Top Related Projects
网易云音乐命令行版本
one for all free music in china (chrome extension, also works for firefox)
高颜值的第三方网易云播放器,支持 Windows / macOS / Linux :electron:
Salt Player for Android Release, Feedback
一个基于 electron 的音乐软件
音乐搜索器 - 多站合一音乐搜索解决方案
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot