{"id":18463339,"url":"https://github.com/acevedojetter/spotify-data-analysis","last_synced_at":"2025-07-19T17:12:35.161Z","repository":{"id":184756882,"uuid":"669168287","full_name":"AcevedoJetter/spotify-data-analysis","owner":"AcevedoJetter","description":"Analysis of your spotify account data","archived":false,"fork":false,"pushed_at":"2023-08-26T02:48:57.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T16:57:34.444Z","etag":null,"topics":["spotify","spotify-analysis"],"latest_commit_sha":null,"homepage":"","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/AcevedoJetter.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-21T14:04:51.000Z","updated_at":"2024-06-07T09:43:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"56d4df45-cd8e-4d61-90d5-4c21785d469e","html_url":"https://github.com/AcevedoJetter/spotify-data-analysis","commit_stats":null,"previous_names":["acevedojetter/spotify-data-analysis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AcevedoJetter%2Fspotify-data-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AcevedoJetter%2Fspotify-data-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AcevedoJetter%2Fspotify-data-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AcevedoJetter%2Fspotify-data-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AcevedoJetter","download_url":"https://codeload.github.com/AcevedoJetter/spotify-data-analysis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251314136,"owners_count":21569559,"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":["spotify","spotify-analysis"],"created_at":"2024-11-06T09:06:38.579Z","updated_at":"2025-04-28T12:35:07.520Z","avatar_url":"https://github.com/AcevedoJetter.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spotify Data Analysis\n\nRepository to get an analysis of your streams since creating your account. **This is a work in progress, more functions will be added.**\n\n# Getting the data\n\nThe folder that you have should contain your entire streaming history data for the life of your account. This can be obtained by pressing the `Request data` button in [this website](https://www.spotify.com/us/account/privacy/) if you are logged in to your account. Make sure to select the field that says `Select Extended streaming history`.\n\nAfter some weeks, you will get an email with the extended streaming history. After downloading it, you will have a zip file called `my_spotify_data.zip` and when opened the directory is `MyData`.\n\n# MyData\n\nThis directory will contain a pdf file which details the contents of the other files in the directory. The files we care about are the ones that start with `Streaming_History_Audio` and are json files.\n\nThe following is from the [Understanding my Data page](https://support.spotify.com/us/article/understanding-my-data/):\n\nA list of items (e.g. songs, videos, and podcasts) listened to or watched during the lifetime of your account, including the following details:\n\n- `ts` - Date and time of when the stream ended in UTC format (Coordinated Universal Time zone).\n- `username` - Your Spotify username.\n- `platform` - Platform used when streaming the track (e.g. Android OS, Google Chromecast).\n- `ms_played` - For how many milliseconds the track was played.\n- `conn_country` - Country code of the country where the stream was played.\n- `ip_addr_decrypted` - IP address used when streaming the track.\n- `user_agent_decrypted` - User agent used when streaming the track (e.g. a browser).\n- `master_metadata_track_name` - Name of the track.\n- `master_metadata_album_artist_name` - Name of the artist, band or podcast.\n- `master_metadata_album_album_name` - Name of the album of the track.\n- `spotify_track_uri` - A Spotify Track URI, that is identifying the unique music track.\n- `episode_name` - Name of the episode of the podcast.\n- `episode_show_name` - Name of the show of the podcast.\n- `spotify_episode_uri` - A Spotify Episode URI, that is identifying the unique podcast episode.\n- `reason_start` - Reason why the track started (e.g. previous track finished or you picked it from the playlist).\n- `reason_end` - Reason why the track ended (e.g. the track finished playing or you hit the next button).\n- `shuffle` - Whether shuffle mode was used when playing the track.\n- `skipped` - Information whether the user skipped to the next song.\n- `offline` - Information whether the track was played in offline mode.\n- `offline_timestamp` - Timestamp of when offline mode was used, if it was used.\n- `incognito_mode` - Information whether the track was played during a private session.\n\nExample of the streaming data of one song:\n\n```json\n{\n  \"ts\": \"YYY-MM-DD 13:30:30\",\n  \"username\": \"_________\",\n  \"platform\": \"_________\",\n  \"ms_played\": \"_________\",\n  \"conn_country\": \"_________\",\n  \"ip_addr_decrypted\": \"___.___.___.___\",\n  \"user_agent_decrypted\": \"_________\",\n  \"master_metadata_track_name\": \"_________\",\n  \"master_metadata_album_artist_name\": \"_________\",\n  \"master_metadata_album_album_name\": \"_________\",\n  \"spotify_track_uri\": \"_________\",\n  \"episode_name\": \"_________\",\n  \"episode_show_name\": \"_________\",\n  \"spotify_episode_uri\": \"_________\",\n  \"reason_start\": \"_________\",\n  \"reason_end\": \"_________\",\n  \"shuffle\": \"null|true|false\",\n  \"skipped\": \"null|true|false\",\n  \"offline\": \"null|true|false\",\n  \"offline_timestamp\": \"_________\",\n  \"incognito_mode\": \"null|true|false\"\n}\n```\n\n# main.py\n\nAll the functions in `main.py` have docstrings which contains the parameters of the function and it also contains what is returned by the function.\n\nNote that the columns of the pandas DataFrame returned by `get_all_data()` can be found [here](https://github.com/AcevedoJetter/spotify-data-analysis#mydata).\n\n# How to run main.py in the terminal\n\nFirst, make sure that the `MyData` directory is in the same directory as `main.py`. After this, you should run `python3 main.py` and it will create a txt file called `analysis.txt` which will contain the analyzed data after running the functions of `main.py` using the data from the `MyData` directory.\n\n# analysis.txt\n\nThis file contains the following analysis of the data from the `MyData` directory:\n\n- Total Time Listened\n- Most Streamed Artist by time\n- Most Streamed Artist by songs played\n- Most Streamed Songs by time played\n- Most Streamed Songs by amount of times played\n- Percent of songs on shuffle vs not on shuffle\n- Percent of songs played offline vs played online\n- Reasons a song started with their respective percentage\n- Reasons a song ended with their respective percentage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facevedojetter%2Fspotify-data-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facevedojetter%2Fspotify-data-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facevedojetter%2Fspotify-data-analysis/lists"}