Skip to content

Instantly share code, notes, and snippets.

@wesleyegberto
Last active August 3, 2018 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesleyegberto/a40061de408039c1f0d8a049f79b58ad to your computer and use it in GitHub Desktop.
Save wesleyegberto/a40061de408039c1f0d8a049f79b58ad to your computer and use it in GitHub Desktop.
Backup saved tracks from Spotify
# https://developer.spotify.com/console/get-current-user-saved-tracks
$token="<Your Token>"
# API limits 50 tracks per request, so I paginate my 1100+ musics here
for i in `seq 0 50 1300`;
do curl -k -X "GET" "https://api.spotify.com/v1/me/tracks?limit=50&offset=$i" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $token" >> musics.json;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment