GET /artist
Retrieves an individual artist based on the query parameter temp. The artist's name is case-insensitive.
Endpoint URL
http://127.0.0.1:8080/artist?temp=artistName
Query Parameters
Name
Type
Description
temp
string
The name of the artist to retrieve data for.
Example Code
async function () {
try {
let artistName = document.getElementById('artisttofind').value;
let response = await fetch(`http://127.0.0.1:8080/artist?temp=${artistName}`);
if (!response.ok) {
throw new Error('Artist not found');
}
let body = await response.json();
// Extract each individual property for our artist object
const { ArtistName, Quote, CoverImage, SpotifyUrl, Card3A, Card4, Card1, Card2 } = body;
} catch (error) {
alert(error);
}
};
Example Response
// Response when artist Tory Lanez is queried
[{ "ArtistName": "Tory Lanez",
"Quote": "I CANT TAKE HEARTBREAK FOR SO LONG",
"CoverImage": "img/tory-lanez.jpg",
"SpotifyUrl": "https://open.spotify.com/embed/playlist/37i9dQZF1DZ06evO1jLCo0?utm_source=generatorb",
"Card3A": [
"I Told You - August 19,2016",
"Memories Don't Die - March 2, 2018",
"Love Me Now? - October 26, 2018",
"Chixtape 5 - November 15, 2019",
"Daystar - September 25, 2020",
"Alone at Prom - May 6, 2022",
"Alone at Prom (Deluxe) - November 17 2023"
],
"Card4": [
"1. Enchanted Waterfall",
"2. The Color Violet",
"3. Say it",
"4. Y.D.L.R",
"5. Lady of Namek"
],
"Card1": "Daystar Shemuel Shua Peterson otherwise known professionally as Tory Lanez, is a Canadian rapper, singer, and songwriter. His music is an artistic blend of RnB and hip-hop with mixtures of singing and rapping on songs. Born in Brampton, Canada, Lanez has had a rough early life with his grandma refusing to take care of him after being forced to move to Toronto with her. \"From like fifteen to eighteen, I was just fighting them. It was every man for himself. That's what made me a man, having to fend for myself and being in a situation where there is no dad, no grandma and no mom to help you. It changed the person that I am today\", he says. He then dropped out of school at the age of 16 and began rapping with his newly adopted nickname \"Tory Lanez\". Between 2009-2015, he was still a beginner aspiring artist, releasing songs and mixtapes while slowly building up reputation in the industry. However it was not until the latter end of 2015 where he rose to fame. ",
"Card2": "Lanez was signed to Mad Love Records and Interscrope Records and on July 15th 2015, released the first single off his debut album, called \"Say it\". This song caught the attention of many people and allowed Tory to make a guest apperance on Jimmy Kimmel's Live Show where he performed his hit song. He continued his track record with more album releases while going on multiple Tours (The Level Up Tour with ASAP Ferg and I Told You Tour) and also perfomring at Summer Jam and Pemberton Music Festival. Lanez announced his depareture from Interscope to become an independent artist again on February 2020 and surprise-released his fifth album, Daystar, where he defends himself from claims of shooting rapper Megan Thee Stallion. However these claims turned out to be true and Lanez was convicted on three felonie in relation to his shooting of Megan Thee Stallion, being later sentenced in 2023 to 10 years in prison. Whilte incarerated \"The Color Violet\", off his Alone at Prom album, experienced a massive boost in popularity due to the app TikTok. Not long ago, Lanez released the delux version of Alone At Prom with 10 additional tracks which i thoroughly enjoyed."
}]
Response Code
200 OK : Returns the artist object if found.
404 NOT FOUND : Returns an error message ("Artist is not found") if the artist is not found.
Response Fields
Name
Type
Description
ArtistName
string
The artist's name.
Quote
string
A quote from one of the artist's songs.
CoverImage
string
Image address of the artist.
SpotifyUrl
string
SpotifyUrl link to one of the artist's playlist.
Card3A
array
The albums of our artist.
Card4
array
My top songs for that artist.
Card1
string
Content for a brief description on who that artist is.
Card2
string
Content for specified artist's rising to popularity explained.
Last updated