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 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