ZingMp3 API
Based On ZingMp3API by Whoant. 💖Thanks a lot 💖
Installation
npm i zingmp3-api-next
Features
Usage/Examples
const { zing } = require("zingmp3-api-next");
Get Home
Get data on the homepage.
<!-- Promise -->
zing.get_home()
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_home();
console.log(data);
})();
Get Song
Parameters:
Example: https://zingmp3.vn/bai-hat/All-Falls-Down-Alan-Walker-Noah-Cyrus-Digital-Farm-Animals/ZW8WOI6U.html
=> The ID is: ZW8WOI6U
<!-- Promise -->
zing.get_song("ZW8WOI6U")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_song("ZW8WOI6U");
console.log(data);
})();
Get Song Info
Parameters:
Example: https://zingmp3.vn/bai-hat/All-Falls-Down-Alan-Walker-Noah-Cyrus-Digital-Farm-Animals/ZW8WOI6U.html
=> The ID is: ZW8WOI6U
<!-- Promise -->
zing.get_song_info("ZW8WOI6U")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_song_info("ZW8WOI6U");
console.log(data);
})();
Get Song Lyrics
Parameters:
Example: https://zingmp3.vn/bai-hat/All-Falls-Down-Alan-Walker-Noah-Cyrus-Digital-Farm-Animals/ZW8WOI6U.html
=> The ID is: ZW8WOI6U
<!-- Promise -->
zing.get_song_lyric("ZW8WOI6U")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_song_lyric("ZW8WOI6U");
console.log(data);
})();
Get Chart
<!-- Promise -->
zing.get_home_chart()
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_home_chart();
console.log(data);
})();
<!-- Promise -->
zing.get_new_release_chart()
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_new_release_chart();
console.log(data);
})();
Parameters:
- id: string (required)
- week: number (optional)(default: 0)
- year: number (optional)(default: 0)
Example: https://zingmp3.vn/zing-chart-tuan/Bai-hat-Viet-Nam/IWZ9Z08I.html
=> The ID is: IWZ9Z08I
<!-- Promise -->
zing.get_week_chart("IWZ9Z08I")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_week_chart("IWZ9Z08I");
console.log(data);
})();
Get Radio
<!-- Promise -->
zing.get_radio()
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_radio();
console.log(data);
})();
Get New Feeds
Parameters:
- id: string (required)
- page: number (optional)(default: 1)
Example: https://zingmp3.vn/the-loai-nghe-si/Viet-Nam/IWZ9Z08I.html
=> The ID is: IWZ9Z08I
<!-- Promise -->
zing.get_list_by_genre("IWZ9Z08I")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_list_by_genre("IWZ9Z08I");
console.log(data);
})();
Get Artist
Parameters:
Example: "Alan-Walker"
<!-- Promise -->
zing.get_artist("Alan-Walker")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_artist("Alan-Walker");
console.log(data);
})();
Get Hub
<!-- Promise -->
zing.get_hub_home()
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_hub_home();
console.log(data);
})();
Parameters:
Example: https://zingmp3.vn/hub/Khuc-Nhac-Vui/IWZ9Z09A.html
=> The ID is: IWZ9Z09A
<!-- Promise -->
zing.get_hub_detail("IWZ9Z09A")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_hub_detail("IWZ9Z09A");
console.log(data);
})();
Get TOP 100
<!-- Promise -->
zing.get_top_100()
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_top_100();
console.log(data);
})();
Get List MV
Parameters:
- id: string (required)
- page: number (optional)(default: 1)
- count: number (optional)(default: 15)
- sort: string (optional)(default: "listen")
Example: https://zingmp3.vn/the-loai-video/Viet-Nam/IWZ9Z08I.html
=> The ID is: IWZ9Z08I
<!-- Promise -->
zing.get_list_mv("IWZ9Z08I")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_list_mv("IWZ9Z08I");
console.log(data);
})();
Get Category MV
Parameters:
Example: https://zingmp3.vn/the-loai-video/EDM-Viet/IWZ97FCE.html
=> The ID is: IWZ97FCE
<!-- Promise -->
zing.get_category_mv("IWZ97FCE")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_category_mv("IWZ97FCE");
console.log(data);
})();
Get MV
Parameters:
Example: https://zingmp3.vn/video-clip/Tup-Leu-Vang-Nguyen-Dinh-Vu-ACV/ZUZBBOFF.html
=> The ID is: ZUZBBOFF
<!-- Promise -->
zing.get_mv("ZUZBBOFF")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_mv("ZUZBBOFF");
console.log(data);
})();
Get Playlist
Parameters:
Example: https://zingmp3.vn/album/Today-s-EDM-Hits-The-Chainsmokers-Alan-Walker-Alesso-Topic/ZODAB8EF.html
=> The ID is: ZODAB8EF
<!-- Promise -->
zing.get_playlist("ZODAB8EF")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_playlist("ZODAB8EF");
console.log(data);
})();
Get Suggested Playlists
Get Suggested Playlists at the bottom of playlist page.
Parameters:
Example: https://zingmp3.vn/album/Today-s-EDM-Hits-The-Chainsmokers-Alan-Walker-Alesso-Topic/ZODAB8EF.html
=> The ID is: ZODAB8EF
<!-- Promise -->
zing.get_suggested_playlists("ZODAB8EF")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_suggested_playlists("ZODAB8EF");
console.log(data);
})();
Get Events
Get Incoming Events
<!-- Promise -->
zing.get_events()
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_events();
console.log(data);
})();
Get Event Info
Parameters:
Example: https://zingmp3.vn/event/IWZ97FZF.html
=> The ID is: IWZ97FZF
<!-- Promise -->
zing.get_event_info("IWZ97FZF")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_event_info("IWZ97FZF");
console.log(data);
})();
Search All
Search All (Includes Music, Playlist, Artist, Video)
Parameters:
- keyword: string (required)
Example: "Alan Walker"
<!-- Promise -->
zing.search_all("Alan Walker")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.search_all("Alan Walker");
console.log(data);
})();
Search by Type
Search by Type (Music || Playlist || Artist || Video)
Parameters:
- keyword: string (required)
- type: string (required)
- page: number (optional)(default: 1)
- count: number (optional)(default: 18)
Example: keyword: "Alan Walker", type: "song"
<!-- Promise -->
zing.search_by_type("Alan Walker", "song")
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.search_by_type("Alan Walker", "song");
console.log(data);
})();
Get Recommend Keyword
Default suggestion keyword on the homepage
<!-- Promise -->
zing.get_recommend_keyword()
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_recommend_keyword();
console.log(data);
})();
Get Suggestion Keyword
Suggestion keyword when you search
Parameters:
- keyword: string (optional)
<!-- Promise -->
zing.get_suggestion_keyword()
.then(data => console.log(data))
or
<!-- async / await -->
(async() => {
const data = await zing.get_suggestion_keyword();
console.log(data);
})();