PROJECT IS NOT UNDER ACTIVE DEVELOPMENT
node.js TIDAL API built with TypeScript. This module is using the TIDAL Web API v1.
Originally created by Lucas Vasconcelos
NOTE: Currently not supporting facebook login.
Run the following:
npm install tidalapi-ts
or if you are using yarn instead of npm:
yarn add tidalapi-ts
Simple usage searching and querying a track list
import {TidalAPI} from "TidalAPI";
var api = new TidalAPI({
username: 'your-username-here',
password: 'your-password-here',
// Could also be 'LOSSLESS' but this only supported on premium subscriptions
quality: 'HIGH'
});
const artists = await api.search({query: 'Dream Theater', limit: 1, types: "artists"});
console.log(artists);
const albums = await api.search({types: 'albums', query: 'Dream Theater', limit: 1});
console.log(albums);
const tracks = await api.search({types: 'tracks', query: 'Dream Theater', limit: 1});
console.log(tracks);
const search = await api.search({types: 'tracks,albums,artists', query: 'Dream Theater', limit: 1});
console.log(JSON.stringify(search));
const info = await api.getTrackInfo("22560696");
console.log(info);
const streamUrl = await api.getStreamUrl("22560696");
console.log(streamUrl);
const videoStreamUrl = await api.getStreamUrl("25470315");
console.log(videoStreamUrl);
const url = api.getArtUrlSync('24f52ab0-e7d6-414d-a650-20a4c686aa57', 1280);
const artistVideos = await api.getArtistVideos("14670", {limit: 2});
console.log(artistVideos);
// get general information about the playlist
const playlistInfo = await getPlaylist("7ab5d2b6-93fb-4181-a008-a1d18e2cebfa");
// get tracks of the playlist
const playlistInfo = await getPlaylistTracks("7ab5d2b6-93fb-4181-a008-a1d18e2cebfa");
const gguid = await createPlaylist("My Playlist", "Description");
const gguid = await createPlaylistIfNotExists("MyPlaylist");
Your TIDAL token is likely incorrect.
If you want to run the Unit-Tests you need to specify your Tidal Login Credentials in the ENV parameters like so:
TIDALUSERNAME=your-username
TIDALPASSWORD=your-password