Skip to content

Instantly share code, notes, and snippets.

@adammw
Created February 9, 2015 12:16
Show Gist options
  • Select an option

  • Save adammw/bae0eec9b6879cba6ab5 to your computer and use it in GitHub Desktop.

Select an option

Save adammw/bae0eec9b6879cba6ab5 to your computer and use it in GitHub Desktop.

Spotify "Hacks"

For the web player, https://play.spotify.com

The following information was obtained by reverse engineering the web player, it's not an offical API so things could change or break at any time.


Accessing the private Spotify.Core instance:

var SpCore = Spotify.Instances.get(document.querySelector('[id^="SPFBIn"]').id.replace(/_player$/, ''))

Getting the top tracks globally:

SpCore.toplist.lookupForRegion('global', 'track', function(tracks){ console.log(tracks.map(function(link) { return link.toURI() })); })

Getting a track's audio stream URL:

SpCore.storageResolver.list('spotify:track:5RMslAkmNZUyf6EI8GgHxw', 'http', function(data){ console.log(data, data.uri) })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment