Announcements

Help Wizard

Step 1

NEXT STEP

How to generate a spotify code using web api?

Solved!

How to generate a spotify code using web api?

Hi guys so I saw this https://www.spotifycodes.com/ and notice that it uses a URI to generate a spotify code, I'm using the Spotify WEB API an can get the URI using fetch but is it possible to generate a spotify code using WEB API? 

 

 

Reply

Accepted Solutions
Marked as solution

You can get a Spotify Code using the data from the Web API, just not directly, when you get a Spotify Code from that website it generates a URL like this one, which is the example from the site itself:

 

scannable-original.png

 

For items such as an Album, Artist and Playlist etc you get a Spotify URI from the response when using the Spotify WebApi such as this one for an album:

 

scannable-album.png

 

You just need to have the first bit of: 

 

scannable-partial.png

Then add the URI onto the end like so:

 

scannable-example.png

The "jpeg" part can also be "svg" or "png" depending on which format you need, the "000000" is the background colour, in this case it is black but can be any HTML colour, "white" is the bar colour for the code which can be "black" and "640" is the width of the image which can be any needed. These are all the same values you see when creating the Spotify Code on the website.

 

Hopefully that helps, have added these links as images as this forum turns them into embeds if you don't!

 

 

 

 

 

 

 

 

View solution in original post

4 Replies

 

 

 

  

  

  

  

 

Marked as solution

You can get a Spotify Code using the data from the Web API, just not directly, when you get a Spotify Code from that website it generates a URL like this one, which is the example from the site itself:

 

scannable-original.png

 

For items such as an Album, Artist and Playlist etc you get a Spotify URI from the response when using the Spotify WebApi such as this one for an album:

 

scannable-album.png

 

You just need to have the first bit of: 

 

scannable-partial.png

Then add the URI onto the end like so:

 

scannable-example.png

The "jpeg" part can also be "svg" or "png" depending on which format you need, the "000000" is the background colour, in this case it is black but can be any HTML colour, "white" is the bar colour for the code which can be "black" and "640" is the width of the image which can be any needed. These are all the same values you see when creating the Spotify Code on the website.

 

Hopefully that helps, have added these links as images as this forum turns them into embeds if you don't!

 

 

 

 

 

 

 

 

I was also trying to figure out how to do it, but RoguePlanetoid beat me to it.

cooool, thanks! I see that this isn't a part of their official documentation that's why I have troubles finding this out, anw thanks man, you a lifesaver!

Suggested posts