---
description: >-
  Retrieves an individual artist based on the query parameter temp. The artist's
  name is case-insensitive.
---

# GET /artist

## Endpoint URL

```
http://127.0.0.1:8080/artist?temp=artistName
```

## Query Parameters&#x20;

<table><thead><tr><th width="148">Name</th><th width="141">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:purple;">temp</mark></td><td>string</td><td>The name of the artist to retrieve data for.</td></tr></tbody></table>

## Example Code

```javascript
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&#x20;

```json
// 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

* <mark style="color:green;">**200 OK**</mark> : Returns the artist object if found.
* <mark style="color:red;">**404 NOT FOUND**</mark> :  Returns an error message ("Artist is not found") if the artist is not found.

## Response Fields

<table><thead><tr><th width="156">Name</th><th width="113">Type</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:purple;">ArtistName</mark></td><td>string</td><td>The artist's name.</td></tr><tr><td><mark style="color:purple;">Quote</mark></td><td>string</td><td>A quote from one of the artist's songs.</td></tr><tr><td><mark style="color:purple;">CoverImage</mark></td><td>string</td><td>Image address of the artist.</td></tr><tr><td><mark style="color:purple;">SpotifyUrl</mark></td><td>string</td><td>SpotifyUrl link to one of the artist's playlist.</td></tr><tr><td><mark style="color:purple;">Card3A</mark></td><td>array</td><td>The albums of our artist.</td></tr><tr><td><mark style="color:purple;">Card4</mark></td><td>array</td><td>My top songs for that artist. </td></tr><tr><td><mark style="color:purple;">Card1</mark></td><td>string</td><td>Content for a brief description on who that artist is.</td></tr><tr><td><mark style="color:purple;">Card2</mark></td><td>string</td><td>Content for specified artist's rising to popularity explained. </td></tr></tbody></table>
