-
Notifications
You must be signed in to change notification settings - Fork 0
getTrackPreview
LakhindarPal edited this page May 12, 2024
·
1 revision
getTrackPreview(
trackId
,countryCode
?):Promise
<string
>
Retrieves the preview URL of a track from the Tidal API based on the provided track ID and country code.
-
trackId:
number
The ID of the track.
-
countryCode?:
string
="US"
The country code to use for retrieving the track information. Defaults to "US".
Promise
<string
>
A promise that resolves to the track preview URL.
const { getTrackPreview } = require("tidal-music-api");
// example track ID
const id = 188267445;
try {
const preview = await getTrackPreview(id);
console.log(preview);
} catch (error) {
console.error("Error:", error);
}