Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsososo/QQMusicApi
基于 Express + Axios 的 QQ音乐接口 nodejs 版
https://github.com/jsososo/QQMusicApi
express nodejs qq-music qq-music-api
Last synced: 3 months ago
JSON representation
基于 Express + Axios 的 QQ音乐接口 nodejs 版
- Host: GitHub
- URL: https://github.com/jsososo/QQMusicApi
- Owner: jsososo
- License: gpl-3.0
- Created: 2019-09-18T06:07:22.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-21T15:02:34.000Z (5 months ago)
- Last Synced: 2024-06-21T22:45:25.288Z (5 months ago)
- Topics: express, nodejs, qq-music, qq-music-api
- Language: JavaScript
- Homepage: https://api.qq.jsososo.com
- Size: 479 KB
- Stars: 1,324
- Watchers: 16
- Forks: 373
- Open Issues: 58
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QQMusicApi
[![NPM](https://img.shields.io/npm/v/qq-music-api.svg)](https://www.npmjs.com/package/qq-music-api)
[![github](https://img.shields.io/badge/github-QQMusicApi-brightgreen.svg)](https://github.com/jsososo/QQMusicApi)
[![GitHub Pages Star](https://img.shields.io/github/stars/jsososo/QQMusicApi.svg)](https://github.com/jsososo/QQMusicApi)接口参考:
[接口文档 Github](https://jsososo.github.io/QQMusicApi/#/)
[接口文档 Vercel](https://qq-api-soso.vercel.app/)
## 快速上手
### Node 服务
```shell script
git clone [email protected]:jsososo/QQMusicApi.gityarn
yarn start
```### Docker
```shell script
yarn build:dockeryarn start:docker
```### npm
```shell script
yarn add qq-music-api
```#### 接口调用
```javascript
const qqMusic = require('qq-music-api');// 部分接口依赖 cookie, 这里穿参可以使用字符串或对象
qqMusic.setCookie('xxx=xxx; xxx=xxx;');
// or
qqMusic.setCookie({ a: 'xxx', b: 'xxx' });qqMusic.api('search', { key: '周杰伦' })
.then(res => console.log(res))
.catch(err => console.log('接口调用出错'))qqMusic.api('search', { key: '周杰伦' })
.then((res) => console.log('搜索周杰伦:', res))
.catch(err => console.log('接口调用出错'))qqMusic.api('search/hot')
.then((res) => console.log('热搜词:', res))
.catch(err => console.log('接口调用出错'))//// 刷新登陆
qqMusic.api('user/refresh')
```#### 获取当前cookie
```javascript
const qqMusic = require('qq-music-api');console.log(qqMusic.cookie);
```#### 获取当前 cookie 用户
```javascript
const qqMusic = require('qq-music-api');console.log(qqMusic.uin);
```