Skip to content

getAlbumId

LakhindarPal edited this page May 12, 2024 · 1 revision

Method: getAlbumId()

getAlbumId(url): number

Extracts the album ID from a given URL.

Parameters

  • url: string

The URL from which to extract the album ID.

Returns

number

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

Usage

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

// example url
const url = "https://tidal.com/browse/album/230064409";
const id = getAlbumId(url);

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