# nhaccuatui-api-full

> NhacCuaTui API Full for nodejs and client

Latest version **1.1.0** (published 2022-01-18) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install nhaccuatui-api-full
pnpm add nhaccuatui-api-full
yarn add nhaccuatui-api-full
bun add nhaccuatui-api-full
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-01-18 |
| First published | 2021-12-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 31.4 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 39 |
| Author | napthedev |
| Maintainers | napthedev |
| Keywords | nct, nhaccuatui, nhac cua tui, api |

## Links

- npm: https://www.npmjs.com/package/nhaccuatui-api-full
- Repository: https://github.com/napthedev/nhaccuatui-api-full
- Homepage: https://github.com/napthedev/nhaccuatui-api-full#readme
- Issues: https://github.com/napthedev/nhaccuatui-api-full/issues
- npm.io page: https://npm.io/package/nhaccuatui-api-full

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.24.0
- [js-sha512](https://npm.io/package/js-sha512.md) ^0.8.0

## Recent versions

- 1.1.0 (latest) — 2022-01-18
- 1.0.7 — 2021-12-09
- 1.0.6 — 2021-12-09
- 1.0.5 — 2021-12-09
- 1.0.4 — 2021-12-09
- 1.0.3 — 2021-12-05
- 1.0.2 — 2021-12-05
- 1.0.1 — 2021-12-05
- 1.0.0 — 2021-12-05

## README

# NhacCuaTui API Full

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

## Original Library

👉 [nhaccuatui-api](https://www.npmjs.com/package/nhaccuatui-api) 👈  
Respect a lot ❤️ 🙏

## Installation

```
npm i nhaccuatui-api-full
```

Common JS

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

// or

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

ES Import

```javascript
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](https://www.npmjs.com/package/@originjs/vite-plugin-commonjs)

## Usage

### Get Data

```javascript
// .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, ...)

```javascript
getHome();
```

### 2. Get Song

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

```javascript
getSong("SONG_ID");
```

### 3. Get Playlists

Get the list of popular playlists

```javascript
getPlaylists();
```

### 4. Get Playlist Detail

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

```javascript
getPlaylistDetail("PLAYLIST_ID");
```

### 5. Get Lyric

Get the lyric in text and LRC file

```javascript
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](https://beta.nhaccuatui.com/video/co-hen-voi-thanh-xuan-monstar.IXTbg1bBelQKh.html)  
Then the ID is: IXTbg1bBelQKh

```javascript
getVideoDetail("VIDEO_ID");
```

### 7. Get Topics

Get popular topics

```javascript
getTopics();
```

### 8. Get Topic Detail

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

```javascript
getTopicDetail("TOPIC_ID");
```

### 9. Get Chart

Get Top Songs

Parameters

- Category (Optional). Default: "nhac-viet"
- Time (Optional)
  - Week: number
  - Year: number

```javascript
// 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](https://beta.nhaccuatui.com/top100/top-100-nhac-tre.m3liaiy6vVsF.html)
So the ID is: m3liaiy6vVsF

```javascript
getTop100("TOP_100_ID");
```

### 11. Search by Keyword

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

```javascript
searchByKeyword("SEARCH_KEYWORD");
```

### 12. Get Top Keywords

Get top searched keywords

```javascript
getTopKeyword();
```

### 13. Get trending artists

Get top 10 artists

```javascript
getTrendingArtists();
```

### 14. Explore artists

Parameters

- nation (Optional) - Default: "hot"
- gender (Optional) - Default: 1 (men)

```javascript
// 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](https://beta.nhaccuatui.com/nghe-si-erik.html)  
Then the ID is: erik

```javascript
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

```javascript
// 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 ✅

---
_Source: https://npm.io/package/nhaccuatui-api-full · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
