Skip to content

getArtistId

LakhindarPal edited this page May 12, 2024 · 1 revision

Method: getArtistId()

getArtistId(url): number

Extracts the artist ID from a Tidal URL.

Parameters

  • url: string

The Tidal URL from which to extract the artist ID.

Returns

number

The extracted artist ID, or NaN if the URL does not match the expected format.

Usage

const { getArtistId } = require("tidal-music-api");

// example url
const url = "https://tidal.com/browse/artist/3995478";
const id = getArtistId(url);

if (id) console.log(id);
else console.log("Invalid URL");
Clone this wiki locally