#
Album Details
Get tracks of a album.
#
Usage
- Import the Function
import YoutubeMusic from "youtubemusic.js";
- Invoke the Function
YoutubeMusic.getAlbum("MPREb_jeA2tKVCWcC")
.then((response) => {
// Handle the response data here
console.log(response);
})
.catch((error) => {
// Handle errors here
console.error(error);
});
[
{
id: "H4570k2qllM",
title: "Music Again",
artists: [[Object]],
duration: "3:17",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "IsPFDzAGb4A",
title: "For Your Entertainment",
artists: [[Object]],
duration: "3:36",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "X1Fqn9du7xo",
title: "Whataya Want from Me",
artists: [[Object]],
duration: "3:48",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "6a9J_9_JJBQ",
title: "Strut",
artists: [[Object]],
duration: "3:30",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "UnFFcas4w_A",
title: "Soaked",
artists: [[Object]],
duration: "4:34",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "k_WZZ57HesA",
title: "Sure Fire Winners",
artists: [[Object]],
duration: "3:34",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "ZdEUBExOZws",
title: "A Loaded Smile",
artists: [[Object]],
duration: "4:05",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "wmXQFwlD7vk",
title: "If I Had You",
artists: [[Object]],
duration: "3:49",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "kZ8jqkzho5k",
title: "Pick U Up",
artists: [[Object]],
duration: "4:01",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "3iXKdV14k_Q",
title: "Fever",
artists: [[Object]],
duration: "3:27",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "0mwaAO2WcBs",
title: "Sleepwalker",
artists: [[Object]],
duration: "4:27",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "d_ttAS2V7YA",
title: "Aftermath",
artists: [[Object]],
duration: "4:27",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "8Gna9s6AX1Y",
title: "Broken Open",
artists: [[Object]],
duration: "5:04",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
{
id: "mEcUq0tmg9Y",
title: "Time for Miracles",
artists: [[Object]],
duration: "4:43",
album: "For Your Entertainment",
imageURL:
"https://lh3.googleusercontent.com/CiMiAagSsAkxt-lj39ej1KKq05GbzAxW3LNxm-eWR9SgLku-XLJYHbE7hq4tkRIlNo6MGlJ__G3JzjoW=w544-h544-l90-rj",
},
];
#
Function Parameters
#
Return Value
The function returns an array of objects, containing detailed information about the album tracks. The structure of each object conforms to the IAlbumTrack
interface defined in the interfaces/index.ts
file.