https://github.com/0xVasconcelos/TidalAPI
Unofficial Node.js TIDAL API
https://github.com/0xVasconcelos/TidalAPI
nodejs tidal tidalapi
Last synced: about 1 year ago
JSON representation
Unofficial Node.js TIDAL API
- Host: GitHub
- URL: https://github.com/0xVasconcelos/TidalAPI
- Owner: 0xVasconcelos
- License: mit
- Created: 2016-02-04T00:32:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-02-17T21:16:36.000Z (over 5 years ago)
- Last Synced: 2025-03-24T12:04:41.006Z (about 1 year ago)
- Topics: nodejs, tidal, tidalapi
- Language: JavaScript
- Homepage:
- Size: 36.1 KB
- Stars: 211
- Watchers: 21
- Forks: 45
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TidalAPI
[](https://travis-ci.org/lucaslg26/TidalAPI) [](https://npmjs.org/package/tidalapi) [](https://npmjs.org/package/tidalapi) [](https://github.com/lucaslg26/TidalAPI/blob/master/LICENSE.md) [](https://david-dm.org/lucaslg26/TidalAPI)
## About
node.js TIDAL API. Use the TIDAL Web API simply using this module ;)
Created by [Lucas Vasconcelos](https://github.com/lucaslg26)
**NOTE:** Currently not supporting facebook login.
## How to use
Run the following:
``` javascript
npm install tidalapi
```
## Obtain the Tidal token needed to use this API
As well as a TIDAL username and password, the Tidal API needs an API `token` which is unique to your apps. You can get this token by network-sniffing some application that uses TIDAL Playback feature, like Tidal for Windows, Tidal for Android, or CapTune from Sennheiser.
### Obtaining a token from TIDAL for Windows
- Install [Fiddler](https://www.telerik.com/download/fiddler) and start it.
- In Fiddler, click **Tools** > **Options** > **Decrypt HTTPS Traffic**
- Install TIDAL for Windows and start it
- In Fiddler, look for requests to `api.tidal.com`. Click a request, then on the right, click **Inspectors** > **Headers**. Underneath **Miscellaneous** you'll see `X-Tidal-Token`. This is a TIDAL Token you can use.

## Usage
Simple usage searching and querying a track list
```javascript
var TidalAPI = require('tidalapi');
var api = new TidalAPI({
username: 'your-username-here',
password: 'your-password-here',
token: 'your-token-here',
// Could also be 'LOSSLESS' but this only supported on premium subscriptions
quality: 'HIGH'
});
```
### Search
```javascript
api.search({type: 'artists', query: 'Dream Theater', limit: 1}, function(data){
console.log(data.artists);
})
api.search({type: 'albums', query: 'Dream Theater', limit: 1}, function(data){
console.log(data.albums);
})
api.search({type: 'tracks', query: 'Dream Theater', limit: 1}, function(data){
console.log(data.tracks);
})
api.search({type: 'tracks,albums,artists', query: 'Dream Theater', limit: 1}, function(data){
console.log(data.tracks);
console.log(data.albums);
console.log(data.artists);
})
```
### Track info
```javascript
api.getTrackInfo({id: 22560696 }, function(data){
console.log(data)
})
```
### Streams
```javascript
api.getStreamURL({id: 22560696}, function(data){
console.log(data)
})
api.getVideoStreamURL({id: 25470315}, function(data){
console.log(data)
})
```
### Album Art
```javascript
console.log(api.getArtURL('24f52ab0-e7d6-414d-a650-20a4c686aa57', 1280)) //coverid
```
### Videos
```javascript
api.getArtistVideos({id: 14670, limit: 2}, function(data){
console.log(data)
})
```
### FLAC tags
```javascript
api.genMetaflacTags({id: 22560696, coverPath: './albumart.jpg', songPath: './song.flac'}, function(data){
console.log(data)
/* --remove-all-tags --set-tag="ARTIST=Dream Theater" --set-tag="TITLE=Along For The Ride" --set-tag="ALBUM=Dream Theater" --set-tag="TRACKNUMBER=8" --set-tag="COPYRIGHT=2013 Roadrunner Records, Inc." -set-tag="DATE=2013" --import-picture-from="./albumart.jpg" "./song.flac" --add-replay-gain */
})
```
## Troubleshooting
### 500 error with 'Ooops, an unexpected error occurred'
Your TIDAL token is likely incorrect.