{"id":13586314,"url":"https://github.com/karlicoss/spotifyexport","last_synced_at":"2025-04-03T02:30:48.521Z","repository":{"id":141611549,"uuid":"307011849","full_name":"karlicoss/spotifyexport","owner":"karlicoss","description":"Export your personal Spotify data: playlists, saved tracks/albums/shows, etc. as JSON","archived":false,"fork":false,"pushed_at":"2023-07-19T14:06:26.000Z","size":11,"stargazers_count":38,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T20:05:09.380Z","etag":null,"topics":["backup","data-liberation","export","spotify","takeout"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karlicoss.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-25T02:46:00.000Z","updated_at":"2025-03-18T15:57:03.000Z","dependencies_parsed_at":"2024-08-01T16:42:34.721Z","dependency_job_id":null,"html_url":"https://github.com/karlicoss/spotifyexport","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karlicoss%2Fspotifyexport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karlicoss%2Fspotifyexport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karlicoss%2Fspotifyexport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karlicoss%2Fspotifyexport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karlicoss","download_url":"https://codeload.github.com/karlicoss/spotifyexport/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246925199,"owners_count":20855854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","data-liberation","export","spotify","takeout"],"created_at":"2024-08-01T15:05:28.123Z","updated_at":"2025-04-03T02:30:48.221Z","avatar_url":"https://github.com/karlicoss.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"#+begin_src python :dir src :results drawer :exports results\nimport spotifyexport.export as E; return E.make_parser().prog\n#+end_src\n\n#+RESULTS:\n:results:\nExport your personal Spotify data: playlists, saved tracks/albums/shows, etc. as JSON.\n:end:\n\n* Setting up\n1. The easiest way is =pip3 install --user git+https://github.com/karlicoss/spotifyexport=.\n\n   Alternatively, use =git clone --recursive=, or =git pull \u0026\u0026 git submodule update --init=. After that, you can use =pip3 install --editable .=.\n2. To use the API, you need to create a new app on [[https://developer.spotify.com/dashboard/applications][Spotify for Developers]]\n\n   For =redirect_uri=: you can pick pretty much anything, e.g. =https://github.com=. After that you'll get =client_id= and =client_secret=.\n\n3. On the first script run, you'll be prompted to approve the script access.\n\n   Once approved, the token is saved to =cache_path= (will be created if doesn't exist). After that you won't need to enter the password again as long as you pass the same =cache_path=.\n\n\n* Exporting\n\n#+begin_src python :dir src :results drawer :exports results\nimport spotifyexport.export as E; return E.make_parser().epilog\n#+end_src\n\n#+RESULTS:\n:results:\n\nUsage:\n\n*Recommended*: create =secrets.py= keeping your api parameters, e.g.:\n\n\n: client_id = \"CLIENT_ID\"\n: client_secret = \"CLIENT_SECRET\"\n: redirect_uri = \"REDIRECT_URI\"\n: cache_path = \"CACHE_PATH\"\n\n\nAfter that, use:\n\n: python3 -m spotifyexport.export --secrets /path/to/secrets.py \u003e output.json\n\nThat way you type less and have control over where you keep your plaintext secrets.\n\n*Alternatively*, you can pass parameters directly, e.g.\n\n: python3 -m spotifyexport.export --client_id \u003cclient_id\u003e --client_secret \u003cclient_secret\u003e --redirect_uri \u003credirect_uri\u003e --cache_path \u003ccache_path\u003e \u003e output.json\n\nHowever, this is verbose and prone to leaking your keys/tokens/passwords in shell history.\n\n\n\nI *highly* recommend checking exported files at least once just to make sure they contain everything you expect from your export. If not, please feel free to ask or raise an issue!\n\n:end:\n\n* API limitations\n\n- you might want to do a [[https://www.spotify.com/uk/privacy/#privacy-center-control-section][GDPR export]] in addition, just in case\n\n- [[https://developer.spotify.com/documentation/web-api/reference/player/get-recently-played][\"Recently played\"]] API endpoint **only returns the 50 most recent tracks**, which makes it kind of useless unless you export the data every hour or so.\n\n  If you care about them, might be a good idea to connect Spotify to Last.FM.\n\n  GPDR export has more tracks, but also seems incomplete (e.g. my data is missing first few years).\n\n* Using the data\n\n** TODO need to implement the data access bit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarlicoss%2Fspotifyexport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarlicoss%2Fspotifyexport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarlicoss%2Fspotifyexport/lists"}