{"id":13682840,"url":"https://github.com/fedecalendino/spotify-data-reader","last_synced_at":"2026-01-17T06:39:44.157Z","repository":{"id":112063060,"uuid":"310064429","full_name":"fedecalendino/spotify-data-reader","owner":"fedecalendino","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-16T12:42:05.000Z","size":1622,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T15:45:52.269Z","etag":null,"topics":["spotify","spotify-data"],"latest_commit_sha":null,"homepage":"https://support.stats.fm/docs/import/spotify-import/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fedecalendino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-11-04T16:57:26.000Z","updated_at":"2024-11-25T16:56:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8527787-f82b-40dc-93ec-e7a074bf3883","html_url":"https://github.com/fedecalendino/spotify-data-reader","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fedecalendino/spotify-data-reader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedecalendino%2Fspotify-data-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedecalendino%2Fspotify-data-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedecalendino%2Fspotify-data-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedecalendino%2Fspotify-data-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fedecalendino","download_url":"https://codeload.github.com/fedecalendino/spotify-data-reader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedecalendino%2Fspotify-data-reader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28502760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["spotify","spotify-data"],"created_at":"2024-08-02T13:01:54.127Z","updated_at":"2026-01-17T06:39:44.132Z","avatar_url":"https://github.com/fedecalendino.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# SPOTIFY-DATA-READER\n\nTiny tool to read Spotify's extended streaming history, you can follow [this guide](https://support.stats.fm/docs/import/spotify-import/) to get yours.\n\n\nOnce you download your streaming history, you are going to see a zip file containing multiple json files.\nPut all of them into the `data` folder so the tool can find them.\n\n\n# json files contents\n\n```json\n[\n    ...,\n    {\n        \"conn_country\": \"SI\",\n        \"episode_name\": null,\n        \"episode_show_name\": null,\n        \"incognito_mode\": false,\n        \"ip_addr_decrypted\": \"1.2.3.4\",\n        \"master_metadata_album_album_name\": \"Humanz\",\n        \"master_metadata_album_artist_name\": \"Gorillaz\",\n        \"master_metadata_track_name\": \"Andromeda (feat. DRAM)\",\n        \"ms_played\": 8778,\n        \"offline\": false,\n        \"offline_timestamp\": 1572964071330,\n        \"platform\": \"OS X 10.15.1 [x86 8]\",\n        \"reason_end\": \"endplay\",\n        \"reason_start\": \"clickrow\",\n        \"shuffle\": true,\n        \"skipped\": null,\n        \"spotify_episode_uri\": null,\n        \"spotify_track_uri\": \"spotify:track:2C0KFbb4v9CNWR5c9jWcKC\",\n        \"ts\": \"2019-11-05T14:28:00Z\",\n        \"user_agent_decrypted\": \"unknown\",\n        \"username\": \"username\"\n    },\n    ...,\n]\n```\n\n\n\n## usage\n\n```python\nfrom collections import Counter\n\nfrom reader import streaming_history\n\n\ndef top_songs(year: int = None):\n    tracks = []\n\n    for item in streaming_history():\n        if year is not None:\n            if item.playback.timestamp.year != year:\n                continue\n\n        if item.track:\n            tracks.append(\n                (\n                    item.track.name,\n                    item.track.artist,\n                )\n            )\n\n    for (track, artist), counter in Counter(tracks).most_common(5):\n        print(f\"{track} by {artist} [{counter}]\")\n\n\ntop_songs()\n\n# \u003e\u003e Andromeda (feat. DRAM) by Gorillaz [877]\n# \u003e\u003e Undercover Martyn by Two Door Cinema Club [682]\n# \u003e\u003e Sleeping Powder by Gorillaz [669]\n# \u003e\u003e Submission (feat. Danny Brown \u0026 Kelela) by Gorillaz [666]\n# \u003e\u003e On Melancholy Hill by Gorillaz [606]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedecalendino%2Fspotify-data-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedecalendino%2Fspotify-data-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedecalendino%2Fspotify-data-reader/lists"}