npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jjdenhertog/tidal-music-search

v1.0.4

Published

Library to find tracks in Tidal

Downloads

46

Readme

Tidal Music Search

The tidal-music-search library provides an efficient way to search for tracks on Tidal. Building on music-search, this library connects to Tidal's API to find tracks.

Table of Contents

Installation

Install the tidal-music-search library with npm:

npm install @jjdenhertog/tidal-music-search

Connecting with Tidal

The library requires Tidal API credentials, which you can pass on while initializing the library.

const tidalMusicSearch = new TidalMusicSearch({
  clientId: 'your_client_id',
  clientSecret: 'your_client_secret'
});

Getting Tidal API Client ID and Secret

To obtain your Tidal API client ID and client secret, you need to register for access to the Tidal API. Visit the Tidal Developer Portal to apply for API access and retrieve your credentials.

Usage

import TidalMusicSearch, { TidalMusicSearchTrack } from '@jjdenhertog/tidal-music-search';

const tidalMusicSearch = new TidalMusicSearch({
  clientId: process.env.TIDAL_API_CLIENT_ID,
  clientSecret: process.env.TIDAL_API_CLIENT_SECRET
});

const searchItems: TidalMusicSearchTrack[] = [
{ id: '125', title: 'Billie Jean', album: 'Thriller', artists: ['Michael Jackson']},
  // Add more tracks as needed
];

async function searchTracks() {
  try {
    const searchResult = await tidalMusicSearch.search(searchItems);
    console.log(searchResult);
  } catch (error) {
    console.error('Error searching tracks:', error);
  }
}

searchTracks();

In this example, the search method is used to find tracks on Tidal that match the specified criteria.

What is with the ID while searching?

You might notice that the search query must contain an ID

const searchItems: TidalMusicSearchTrack[] = [
  { id: '125', title: 'Billie Jean', album: 'Thriller', artists: ['Michael Jackson']},
  // Add more tracks as needed
];

Most of the times when you're searching for a track you are doing it to match one library with the other. For example matching Spotify with Plex. The result after searching will contain the original search query including the id and the results. The results are all the tracks matching with the search query. With this approach you can trace back the results more easily.

If you do not need the id for this purpose, you can simply leave it empty:

{ id: '', title: 'Billie Jean', album: 'Thriller', artists: ['Michael Jackson']}

Support This Open-Source Project ❤️

If you appreciate my work, consider starring this repository or making a donation to support ongoing development. Your support means the world to me—thank you!

Buy Me a Coffee

Are you a developer and have some free time on your hand? It would be great if you can help me maintain and improve this library.