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