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 🙏

© 2026 – Pkg Stats / Ryan Hefner

migu-api-enhanced

v2.14.0

Published

咪咕音乐 API 增强 SDK(多平台部署 + NPM 包)

Readme

migu-api-enhanced

基于 Hono 框架的咪咕音乐 API 服务,支持多平台部署。受https://github.com/jsososo/MiguMusicApi项目启发。

API 接口

  • 搜索 - 歌曲、歌手、专辑、MV、歌词、短视频、彩铃、演唱会、票务、热门搜索、搜索建议
  • 专辑 - 详情、歌曲列表
  • 歌单 - 信息、列表歌曲、歌单广场、电台歌曲列表、匹配外部歌单
  • 歌手 - 歌手信息、歌手歌曲、歌手专辑、相似歌手
  • 播放地址 - 多版本播放地址接口(v1/v2/v2.4)
  • 推荐 - 歌曲、歌单、相似歌曲、主页电台、所有电台
  • 栏目 - 排行榜(Tab/内容)、新歌速递、新碟上架、栏目内容
  • MV - MV详情、MV推荐、MV播放地址 (mp4 & m3u8)
  • 视频 - 短视频:播放地址、搜索建议、用户信息、用户作品。 视频彩铃:播放地址、统计信息
  • 资源 - 获取歌词、资源信息、播放次数、检查可听性
  • 用户 - 用户信息、用户主页、用户徽章、我喜欢、收藏、自建歌单管理、个人推荐
  • 登录认证 - 手机号登录、短信登录、(一键登录,帐密登录)
  • 活动 - 呢喃日期歌曲、签到、签到记录

更新于 API 文档

项目结构

├── src/
│   ├── adapters/      # 平台适配器
│   ├── modules/       # API 模块(NPM 包导出)
│   ├── routers/       # API 路由
│   ├── types/         # 类型定义
│   ├── utils/         # 工具函数
│   ├── app.ts         # 应用入口
│   └── index.ts       # NPM 包入口

快速开始

安装依赖

pnpm install

本地开发

# Node.js 环境
pnpm run dev

# Bun 环境
pnpm run start:bun --watch

# Cloudflare Workers
pnpm run dev:cf

# Deno 环境
pnpm run dev:deno

构建与类型检查

# 构建 NPM 包(使用 tsup)
pnpm run build

# 类型检查(SDK/NPM 包)
pnpm run typecheck

# 构建 EdgeOne 边缘函数
pnpm run build:edgeone

部署

# Node.js 生产部署(构建 + 启动)
pnpm install         # 安装依赖(包括 devDependencies)
pnpm run build:node  # 编译
pnpm start           # 启动
# 以后直接运行 pnpm start 即可,无需重新构建

# Bun 生产环境
pnpm run start:bun

环境变量

请参考 deployment.md 部署说明。

作为 NPM 包使用

本仓库的 src/modules/ 同时被打包为可独立发布的 NPM 包 migu-api-enhanced, 支持 ESM + CJS 双格式,并附带 TypeScript 类型声明。

安装

pnpm add migu-api-enhanced
# 或
npm install migu-api-enhanced

[!NOTE] 建议使用最新版本。后续会更新接口。请加上@latest获取最新版本。(npm i migu-api-enhanced@latest)

方式一:命名导入

import { getAlbumInfo, getUrlV2 } from 'migu-api-enhanced';
const album = await getAlbumInfo('1123');
// or
import * as migu from 'migu-api-enhanced';
const album = await migu.getAlbumInfo('1123');

方式二:createClient 工厂函数

import { createClient } from 'migu-api-enhanced';

const migu = createClient();

// 搜索歌曲
const data = await migu.searchSong('周杰伦', 1);
console.log(data);

免责声明

本项目仅供学习和研究使用,不得用于商业用途。

本项目通过非官方接口获取数据,与咪咕音乐官方无任何关联。使用本项目所产生的一切后果由使用者自行承担,项目作者不承担任何责任。

本项目所涉及的音视频资源版权归咪咕音乐所有,请支持正版音乐。

请勿将本项目用于任何违反法律法规的用途,包括但不限于:

  • 商业用途
  • 大规模爬取数据
  • 侵犯他人权益
  • 其他违法行为

使用本项目即表示您已阅读并同意以上声明。