Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Please see below the most popular frequently asked questions.
Loading article...
Loading faqs...
Please see below the current ongoing issues which are under investigation.
Loading issue...
Loading ongoing issues...
I am trying to understand how Spotify Codes work technically, and I can't find any information on them. My answer to this question on stack overflow shows some of the digging I've done: https://stackoverflow.com/a/62120952/10703868
My question is, how do you map a URI that has 22 characters 0-9a-Z to 21 octal bits of information? How does this 37i9dQZF1DXcBWIGoYBM5M map to this [0, 6, 0, 2, 4, 5, 1, 4, 5, 2, 3, 7, 3, 7, 1, 5, 6, 2, 5, 7, 4, 3, 0]?
Solved! Go to Solution.
If you or anyone else is still interested, I asked the question on StackOverflow and someone shared a link to the patent in their answer. Spotify supposedly does use a look up table to match Codes with their much longer URIs.
Had a feeling someone would find this too, generating them is easy using that website but to read them is another matter as I was also trying to figure out how these codes work. My thought is although Spotify Ids are base62 encoded it might be they don't need all that headroom.
The code is 23 octal bits long, which can encode a sequence of 22 values between 0-7 and another for the type, although it is not consistently one of the values of the code itself from what I've found. The code means you can have 54,875,873,536 artists, and the same number of tracks, playlists etc which is more than enough so this may be the missing clue? I'm also hopeful Spotify will say how these work as it would be useful to know!
Edit: Of course the last digit would be check digit so 37,822,859,361 combinations are covered with 21 numbers - is interesting how you fit 16 base-64 characters into 21 octals
I'm glad someone else is interested in this as well! I tried to see if there was a pattern for track/album/artist etc. but I don't see one. Actually, I noticed they don't use the first, 12th, or last octal bit (ends are low, 12 is high).
playlist [0, 3, 3, 0, 5, 2, 2, 2, 2, 5, 1, 7, 0, 0, 5, 6, 0, 7, 7, 7, 1, 5, 0] [0, 5, 6, 5, 3, 5, 4, 2, 7, 2, 5, 7, 1, 3, 1, 1, 6, 1, 1, 6, 7, 6, 0] [0, 4, 6, 6, 6, 4, 4, 1, 6, 6, 6, 7, 7, 3, 6, 0, 7, 6, 0, 2, 1, 7, 0] [0, 0, 3, 3, 7, 5, 2, 3, 1, 1, 4, 7, 5, 5, 5, 3, 3, 7, 5, 1, 4, 3, 0] tracks [0, 6, 2, 2, 1, 5, 2, 6, 2, 2, 3, 7, 7, 6, 6, 4, 5, 6, 0, 1, 4, 3, 0] [0, 7, 7, 1, 4, 7, 1, 0, 4, 7, 1, 7, 6, 5, 6, 3, 1, 6, 4, 4, 7, 7, 0] [0, 1, 1, 1, 5, 7, 1, 3, 3, 1, 0, 7, 7, 0, 7, 3, 2, 3, 0, 6, 0, 0, 0] [0, 7, 6, 6, 7, 4, 4, 6, 7, 0, 6, 7, 0, 4, 1, 7, 3, 2, 0, 5, 4, 7, 0] [0, 0, 0, 6, 1, 3, 3, 2, 2, 0, 2, 7, 3, 2, 4, 1, 6, 0, 1, 5, 0, 4, 0]
If you or anyone else is still interested, I asked the question on StackOverflow and someone shared a link to the patent in their answer. Spotify supposedly does use a look up table to match Codes with their much longer URIs.
Thanks @boonpeter, I also had found this post a couple of weeks ago and meant to update this topic for you also!
I'm glad you did as one of the other answers since I looked has actually found the endpoint they use to do the lookup itself.
I knew there was a lookup table and had to be some way to use it after what you'd posted before. It makes sense they just have a new lookup id for each item which is more than enough to cover every possibility they need still for the Spotify Codes but without the ability to request the lookup it was useless but might be possible now thanks to that answer, although there's some additional encoding of the number used that will need to be figured out however but also just noticed that the scope needs to come from the app so might make it unusable for non-Spotify use because of that
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…