1.1.0 ā€¢ Published 2 years ago

nhaccuatui-api-full v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

NhacCuaTui API Full

NhacCuaTui API Library with Typescript support Support Nodejs server, client request (with proxy built in)

Original Library

šŸ‘‰ nhaccuatui-api šŸ‘ˆ
Respect a lot ā¤ļø šŸ™

Installation

npm i nhaccuatui-api-full

Common JS

const NhacCuaTui = require("nhaccuatui-api-full");

// or

const {
  getHome,
  getSong,
  getPlaylists,
  //... and many other services
} = require("nhaccuatui-api-full");

ES Import

import NhacCuaTui from "nhaccuatui-api-full";

// or

import {
  getHome,
  getSong,
  getPlaylists,
  //... and many other services
} from "nhaccuatui-api-full";

To use this library with Vite remember to add this plugin @originjs/vite-plugin-commonjs

Usage

Get Data

// .then
getHome().then((data) => console.log(data));
// or
NhacCuaTui.getHome().then((data) => console.log(data));

// async - await
(async () => {
  const data = await getHome();
  // or
  const data = await NhacCuaTui.getHome();
})();

1. Get Home

Get the data display on the homepage (Include song, artist, playlists, trending, ...)

getHome();

2. Get Song

Get the song detail
Example Link: https://beta.nhaccuatui.com/bai-hat/buoc-qua-nhau-vu.EdENCgJm9dAa.html
Then the ID is: EdENCgJm9dAa

getSong("SONG_ID");

3. Get Playlists

Get the list of popular playlists

getPlaylists();

4. Get Playlist Detail

Get the playlist detail
Example Link: https://beta.nhaccuatui.com/playlist/nhac-viet-hot-thang-12-va.7ROXQyroRFYT.html
Then the ID is: 7ROXQyroRFYT

getPlaylistDetail("PLAYLIST_ID");

5. Get Lyric

Get the lyric in text and LRC file

getLyric("SONG_ID");

6. Get Video / MV Detail

Get Music Video detail Example Link: https://beta.nhaccuatui.com/video/co-hen-voi-thanh-xuan-monstar.IXTbg1bBelQKh.html
Then the ID is: IXTbg1bBelQKh

getVideoDetail("VIDEO_ID");

7. Get Topics

Get popular topics

getTopics();

8. Get Topic Detail

Get the topic detail
Example Link: https://beta.nhaccuatui.com/chu-de/hot-v-pop.weiwjycnu.html
Then the ID is: weiwjycnu

getTopicDetail("TOPIC_ID");

9. Get Chart

Get Top Songs

Parameters

  • Category (Optional). Default: "nhac-viet"
  • Time (Optional)
    • Week: number
    • Year: number
// Use default option
getChart();

// or custom property
getChart({
  category: "nhac-viet",
  time: {
    week: 48,
    year: 2021,
  },
});

10. Get Top 100

Get the top 100 song of the playlist

Example Link: https://beta.nhaccuatui.com/top100/top-100-nhac-tre.m3liaiy6vVsF.html So the ID is: m3liaiy6vVsF

getTop100("TOP_100_ID");

11. Search by Keyword

Search songs, playlists, artists,... by keyword

searchByKeyword("SEARCH_KEYWORD");

12. Get Top Keywords

Get top searched keywords

getTopKeyword();

13. Get trending artists

Get top 10 artists

getTrendingArtists();

14. Explore artists

Parameters

  • nation (Optional) - Default: "hot"
  • gender (Optional) - Default: 1 (men)
// Default options
exploreArtists();

// Or With options
exploreArtists({
  nation: "hot",
  gender: 1,
});

15. Get artist Detail

Get one artist detail Example Link: https://beta.nhaccuatui.com/nghe-si-erik.html
Then the ID is: erik

getArtistDetail("ARTIST_ID");

16. Explore (Song, Playlist, MV)

Parameters

  • type (Required) - "song" || "playlist" || "mv"
  • key (Optional) - Default: "moi-hot"
  • page (Optional) - Default: 1
  • pageSize (Optional) - Default: 36
// Default options
explore({
  type: "song", // or "playlist" or "mv"
});

// With more options
explore({
  type: "song",
  key: "moi-hot",
  page: 1,
  pageSize: 36,
});

Summary

šŸ¤©āœØ If you enjoy using this library, give me a star on Github and share it to your friends. āœØšŸ¤©

āœ… If you have an error caused by the api, maybe NhacCuaTui has updated. Try to update to the latest version, if not working, submit an Issue on the repository āœ…

1.1.0

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago