spotifyspotify-app

Artist profile information not getting from spotify api


Artist profile information not getting from api.

Im calling this URL

url=https://api.spotify.com/v1/artists/****7vxl9s3awf7hz4rr

Endpoint(s): GET /v1/artists/{id}


Scope(s):

Not required as per the dev doc.

Steps to reproduce:

  1. Authenticate user - get Oauth Token
  2. Call GET /v1/me - get user info (id,display_name etc)
  3. CAll GET /v1/artists/{id} - Get the artist information.

Expected behaviour: Artist object as described on; https://developer.spotify.com/console/get-artist/?id= {id}.


Actual behaviour:

Response{protocol=h2, code=400, message=, url=https://api.spotify.com/v1/artists/****7vxl9s3awf7hz4rr*****}

Response Body

{"error":{"status":400,"message":"invalid id"}}

Questions - How to get artist information from spotify API?


Solution

  • I think you should do like this.

    Step 1: Get the Display name from spotify using spotify SDK or GET ME API.

    GET https://api.spotify.com/v1/me

    Step 2: Using that Display name search for the artist in Artist API.

    GET https://api.spotify.com/v1/search

    You will get the result of that artist.

    Step 3: Compare the result what you get with the display name.(Because thier might be other artist also with matching one word of that user's display name). You need to compare it in your code.

    Step 4: When you get the result, it will give type as artist and also the artist Id.

    Now you know that when a user login in your application, weather he has artist account or not.