npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@neteasecloudmusicapienhanced/api

v4.29.17

Published

为停更的网易云音乐 NodeJs API 提供持续的维护!

Downloads

374

Readme

网易云音乐 API Enhanced


项目简介

本项目为网易云音乐第三方 Node.js API,基于社区停更的原版 API 持续维护和升级,支持丰富的音乐相关接口,适合自建服务、二次开发和多平台部署(如果原版诈尸, 我会及时同步 or 归档)。

快速开始

环境要求

  • Node.js 14 及以上
  • 推荐使用 pnpm 进行依赖管理

安装

git clone https://github.com/neteasecloudmusicapienhanced/api-enhanced.git
cd api
pnpm i

启动服务

# 默认端口 3000
node app.js

# 指定端口(如 4000)
PORT=4000 node app.js  # Mac/Linux
set PORT=4000 && node app.js  # Windows

重要提示

  • 调用前请务必阅读文档的 调用前须知 部分。
  • 推荐将敏感信息(如 cookie)通过部署平台的环境变量进行配置。

在线体验与文档

常见部署方式

Docker 部署说明

本项目支持通过 Docker 一键部署,无需手动安装 Node.js 或依赖。

1. 拉取镜像

从 Docker Hub 拉取最新版本镜像:

docker pull moefurina/ncm-api:latest

或指定版本(与 package.json 中版本号一致):

docker pull moefurina/ncm-api:4.29.0

2. 运行容器

docker run -d \
  --name ncm-api \
  -p 3000:3000 \
  moefurina/ncm-api:latest

运行后访问 http://localhost:3000 即可使用 API。

3. 环境变量

| 变量名 | 默认值 | 说明 | | -------------------------- | ------------------------------------ | ------------------------------------------------------------------------------ | | CORS_ALLOW_ORIGIN | * | 允许跨域请求的域名。若需要限制,请指定具体域名(例如 https://example.com)。 | | ENABLE_PROXY | false | 是否启用反向代理功能。 | | PROXY_URL | https://your-proxy-url.com/?proxy= | 代理服务地址。仅当 ENABLE_PROXY=true 时生效。 | | ENABLE_GENERAL_UNBLOCK | true | 是否启用全局解灰(推荐开启)。开启后所有歌曲都尝试自动解锁。 | | ENABLE_FLAC | true | 是否启用无损音质(FLAC)。 | | SELECT_MAX_BR | false | 启用无损音质时,是否选择最高码率音质。 | | UNBLOCK_SOURCE | pyncmd,qq,bodian,migu,kugou,kuwo | 音源优先级列表(多个音源以逗号分隔)。 | | FOLLOW_SOURCE_ORDER | true | 是否严格按照音源列表顺序进行匹配。 |


4. 更新镜像

更新到最新版本:

docker pull moefurina/ncm-api:latest
docker stop ncm-api && docker rm ncm-api
docker run -d -p 3000:3000 moefurina/ncm-api:latest

Vercel 一键部署

  1. fork 本项目
  2. 在 Vercel 官网新建项目,导入 fork 的仓库
  3. 直接 Deploy

腾讯云 Serverless 部署

  1. fork 本项目
  2. 在腾讯云 serverless 控制台新建 Web 应用,选择 Express 框架
  3. 代码仓库选择 fork 的项目,启动文件填写:
    #!/bin/bash
    export PORT=9000
    /var/lang/node16/bin/node app.js
  4. 完成部署后,访问 API 网关的 URL 即可

Node.js 方式调用

支持直接在 Node.js 项目中引入和调用,返回 Promise:

const {
  login_cellphone,
  user_cloud,
} = require('@neteasecloudmusicapienhanced/api')
async function main() {
  const result = await login_cellphone({ phone: '手机号', password: '密码' })
  console.log(result)
  const result2 = await user_cloud({ cookie: result.body.cookie })
  console.log(result2.body)
}
main()

TypeScript 支持

import { banner } from '@neteasecloudmusicapienhanced/api'
banner({ type: 0 }).then((res) => console.log(res))

单元测试

pnpm test

主要功能特性

  • 登录/注册/验证码
  • 用户信息、歌单、动态、播放记录
  • 歌曲、专辑、歌手、MV、歌词、评论、排行榜
  • 搜索、推荐、私人 FM、签到、云盘
  • 歌曲解锁(解灰)、多音源支持(qq/bodian/kuwo/kugou/migu/pyncmd)

    注意: 如果解灰出现问题, 本项目只是集成UnblockNeteaseMusic的接口, 请在对应的仓库开启议题

  • 详细接口请见在线文档

贡献与社区

  • 欢迎提交 PR、Issue 参与维护

SDK 生态

| 语言 | 作者 | 地址 | 类型 | | ------ | ------------------------------------------- | ---------------------------------------------------------------------------------------- | ------ | | Java | JackuXL | NeteaseCloudMusicApi-SDK | 第三方 | | Java | 1015770492 | https://github.com/1015770492/yumbo-music-utils | 第三方 | | Python | 盧瞳 | NeteaseCloudMusic_PythonSDK | 第三方 |

License

MIT License