:cake: Wow, such a powerful music API framework
JavaScript
2,198
105 commits
updated Mar 29, 2026
:cake: A powerful music API framework for Node.js
Meting is a powerful music API framework designed to accelerate music-related development. This is the Node.js version of the original PHP Meting project, providing unified APIs for multiple music platforms.
Install via npm:
npm install @meting/core
Or via yarn:
yarn add @meting/core
import Meting from '@meting/core';
// Initialize with a music platform
const meting = new Meting('netease'); // 'netease', 'tencent', 'kugou', 'baidu', 'kuwo'
// Enable data formatting for consistent output
meting.format(true);
// Search for songs
try {
const searchResult = await meting.search('Hello Adele', { page: 1, limit: 10 });
const songs = JSON.parse(searchResult);
console.log(songs);
} catch (error) {
console.error('Search failed:', error);
}
import Meting from '@meting/core';
async function musicExample() {
const meting = new Meting('netease');
meting.format(true);
try {
// 1. Search for songs
const searchResult = await meting.search('Hello Adele');
const songs = JSON.parse(searchResult);
if (songs.length > 0) {
const song = songs[0];
console.log(`Found: ${song.name} by ${song.artist.join(', ')}`);
// 2. Get song details
const details = await meting.song(song.id);
console.log('Song details:', JSON.parse(details));
// 3. Get streaming URL
const urlInfo = await meting.url(song.url_id, 320); // 320kbps
console.log('Streaming URL:', JSON.parse(urlInfo));
// 4. Get lyrics
const lyrics = await meting.lyric(song.lyric_id);
console.log('Lyrics:', JSON.parse(lyrics));
// 5. Get album cover
const cover = await meting.pic(song.pic_id, 300); // 300x300
console.log('Album cover:', JSON.parse(cover));
}
// Switch platform and search again
meting.site('tencent');
const tencentResult = await meting.search('周杰伦');
console.log('Tencent results:', JSON.parse(tencentResult));
} catch (error) {
console.error('Error:', error);
}
}
musicExample();
const meting = new Meting(server);
server (string): Music platform ('netease', 'tencent', 'kugou', 'baidu', 'kuwo')meting.site(server) // Switch music platform
meting.cookie(cookie) // Set platform-specific cookies
meting.format(enable) // Enable/disable data formatting
// Search for songs, albums, or artists
await meting.search(keyword, {
type: 1,
page: 1,
limit: 30,
});
type (number, optional) - Search category for providers that support it. NetEase uses 1 for songs (default), 10 for albums, 100 for artists, etc.page (number, optional) - Page number starting from 1. Defaults to 1.limit (number, optional) - Number of results per page. Defaults to 30.await meting.song(id) // Get song details
await meting.album(id) // Get album information
await meting.artist(id, limit) // Get artist's songs
await meting.playlist(id) // Get playlist content
await meting.url(id, bitrate) // Get streaming URL
await meting.lyric(id) // Get song lyrics
await meting.pic(id, size) // Get album artwork
| Platform | Code | Search | Song | Album | Artist | Playlist | URL | Lyric | Picture |
|---|---|---|---|---|---|---|---|---|---|
| NetEase Cloud Music | netease | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Tencent Music | tencent | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| KuGou Music | kugou | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Baidu Music | baidu | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Kuwo Music | kuwo | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
When format(true) is enabled, all platforms return standardized JSON:
{
"id": "35847388",
"name": "Hello",
"artist": ["Adele"],
"album": "Hello",
"pic_id": "1407374890649284",
"url_id": "35847388",
"lyric_id": "35847388",
"source": "netease"
}
# Install dependencies
npm install
# Run the example
npm start
# or
npm run example
# Run tests for all platforms
npm test
# Build the library
npm run build
# Development mode with file watching
npm run dev
The library uses Promise-based error handling. Always wrap API calls in try-catch blocks:
try {
const result = await meting.search('keyword');
// Handle success
} catch (error) {
console.error('API Error:', error);
// Try fallback platform
meting.site('tencent');
const fallback = await meting.search('keyword');
}
To avoid being rate-limited by music platforms:
// Example: Add delay between requests
await new Promise(resolve => setTimeout(resolve, 2000));
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
Meting Node.js © metowolf, Released under the MIT License.
Made with ❤️ for the music community
JavaScript
100.0%
:cake: Wow, such a powerful music API framework
JavaScript
2,198
105 commits
updated Mar 29, 2026
:cake: A powerful music API framework for Node.js
Meting is a powerful music API framework designed to accelerate music-related development. This is the Node.js version of the original PHP Meting project, providing unified APIs for multiple music platforms.
Install via npm:
npm install @meting/core
Or via yarn:
yarn add @meting/core
import Meting from '@meting/core';
// Initialize with a music platform
const meting = new Meting('netease'); // 'netease', 'tencent', 'kugou', 'baidu', 'kuwo'
// Enable data formatting for consistent output
meting.format(true);
// Search for songs
try {
const searchResult = await meting.search('Hello Adele', { page: 1, limit: 10 });
const songs = JSON.parse(searchResult);
console.log(songs);
} catch (error) {
console.error('Search failed:', error);
}
import Meting from '@meting/core';
async function musicExample() {
const meting = new Meting('netease');
meting.format(true);
try {
// 1. Search for songs
const searchResult = await meting.search('Hello Adele');
const songs = JSON.parse(searchResult);
if (songs.length > 0) {
const song = songs[0];
console.log(`Found: ${song.name} by ${song.artist.join(', ')}`);
// 2. Get song details
const details = await meting.song(song.id);
console.log('Song details:', JSON.parse(details));
// 3. Get streaming URL
const urlInfo = await meting.url(song.url_id, 320); // 320kbps
console.log('Streaming URL:', JSON.parse(urlInfo));
// 4. Get lyrics
const lyrics = await meting.lyric(song.lyric_id);
console.log('Lyrics:', JSON.parse(lyrics));
// 5. Get album cover
const cover = await meting.pic(song.pic_id, 300); // 300x300
console.log('Album cover:', JSON.parse(cover));
}
// Switch platform and search again
meting.site('tencent');
const tencentResult = await meting.search('周杰伦');
console.log('Tencent results:', JSON.parse(tencentResult));
} catch (error) {
console.error('Error:', error);
}
}
musicExample();
const meting = new Meting(server);
server (string): Music platform ('netease', 'tencent', 'kugou', 'baidu', 'kuwo')meting.site(server) // Switch music platform
meting.cookie(cookie) // Set platform-specific cookies
meting.format(enable) // Enable/disable data formatting
// Search for songs, albums, or artists
await meting.search(keyword, {
type: 1,
page: 1,
limit: 30,
});
type (number, optional) - Search category for providers that support it. NetEase uses 1 for songs (default), 10 for albums, 100 for artists, etc.page (number, optional) - Page number starting from 1. Defaults to 1.limit (number, optional) - Number of results per page. Defaults to 30.await meting.song(id) // Get song details
await meting.album(id) // Get album information
await meting.artist(id, limit) // Get artist's songs
await meting.playlist(id) // Get playlist content
await meting.url(id, bitrate) // Get streaming URL
await meting.lyric(id) // Get song lyrics
await meting.pic(id, size) // Get album artwork
| Platform | Code | Search | Song | Album | Artist | Playlist | URL | Lyric | Picture |
|---|---|---|---|---|---|---|---|---|---|
| NetEase Cloud Music | netease | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Tencent Music | tencent | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| KuGou Music | kugou | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Baidu Music | baidu | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Kuwo Music | kuwo | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
When format(true) is enabled, all platforms return standardized JSON:
{
"id": "35847388",
"name": "Hello",
"artist": ["Adele"],
"album": "Hello",
"pic_id": "1407374890649284",
"url_id": "35847388",
"lyric_id": "35847388",
"source": "netease"
}
# Install dependencies
npm install
# Run the example
npm start
# or
npm run example
# Run tests for all platforms
npm test
# Build the library
npm run build
# Development mode with file watching
npm run dev
The library uses Promise-based error handling. Always wrap API calls in try-catch blocks:
try {
const result = await meting.search('keyword');
// Handle success
} catch (error) {
console.error('API Error:', error);
// Try fallback platform
meting.site('tencent');
const fallback = await meting.search('keyword');
}
To avoid being rate-limited by music platforms:
// Example: Add delay between requests
await new Promise(resolve => setTimeout(resolve, 2000));
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
Meting Node.js © metowolf, Released under the MIT License.
Made with ❤️ for the music community
JavaScript
100.0%