{"id":20580612,"url":"https://github.com/pmhalvor/endurabeats","last_synced_at":"2025-08-18T04:09:08.427Z","repository":{"id":220635659,"uuid":"752164218","full_name":"pmhalvor/endurabeats","owner":"pmhalvor","description":"A light-weight API integration that syncs music played over Spotify to activity posted on Strava","archived":false,"fork":false,"pushed_at":"2025-04-22T11:39:24.000Z","size":76,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T12:48:56.813Z","etag":null,"topics":["spotify-api","strava-api"],"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/pmhalvor.png","metadata":{"files":{"readme":"README.md","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":"2024-02-03T08:03:02.000Z","updated_at":"2025-04-22T11:39:28.000Z","dependencies_parsed_at":"2024-06-21T08:23:32.672Z","dependency_job_id":"ce06967b-9f3e-41a2-a193-644f75475883","html_url":"https://github.com/pmhalvor/endurabeats","commit_stats":null,"previous_names":["pmhalvor/endurabeats"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pmhalvor/endurabeats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmhalvor%2Fendurabeats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmhalvor%2Fendurabeats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmhalvor%2Fendurabeats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmhalvor%2Fendurabeats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmhalvor","download_url":"https://codeload.github.com/pmhalvor/endurabeats/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmhalvor%2Fendurabeats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270940926,"owners_count":24671739,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-api","strava-api"],"created_at":"2024-11-16T06:24:33.266Z","updated_at":"2025-08-18T04:09:08.389Z","avatar_url":"https://github.com/pmhalvor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![endurabeats](img/Endurabeats.png)\nA light-weight API integration that syncs music played over Spotify to activity posted on Strava.\n\n\n\n## Getting Started\nIn order to use this software, you will need to have Spotify Premium and a Strava account. You will also need to register an application with both Spotify and Strava to obtain the necessary API keys.\nBoth APIs have good documentation in place to help you get started.\n- [Strava API](https://developers.strava.com/docs/getting-started/)\n- [Spotify API](https://developer.spotify.com/documentation/web-api/)\n\n### Installation\nTo install this software, you will need to clone this repository and install the necessary dependencies. You can do this by running the following commands in your terminal:\n```\ngit clone git@github.com:pmhalvor/endurabeats.git\ncd endurabeats\n```\n\nThen, install the necessary dependencies:\n```\npip install -r requirements.txt\n```\n\n## Configuration\nIf you followed the steps on the Strava and Spotify \"Getting Started\" pages, you should now have a client id and secret for each service. To use these in this app, you will need to store these credentials as local environment variables using `export MY_VAR=value`.\n\nYou should also add the paths in which you want the app to store the tokens for each service. Using cached tokens will allow you to avoid having to authenticate endurabeats each time the app is run, relying only on access and refresh tokens. If these paths are somewhere in the current repo, they should be added to your `.gitignore` file to prevent your tokens from being uploaded to a GitHub. By default, we add all files ending with `tokens.json` to the `.gitignore` file.\n\nYour export command should look something like this:\n```bash\nexport SPOTIFY_CLIENT_ID=your_spotify_client_id\nexport SPOTIFY_CLIENT_SECRET=your_spotify_client_secret\nexport SPOTIFY_TOKENS_PATH=/path/to/project/endurabeats/spotify_tokens.json\n\nexport STRAVA_CLIENT_ID=your_strava_client_id\nexport STRAVA_CLIENT_SECRET=your_strava_client_secret\nexport STRAVA_TOKENS_PATH=/path/to/project/endurabeats/strava_tokens.json\n```\n\nYou can add these commands to your `.bashrc` or `.zshrc` file to have them run every time you open a new terminal window.\nI'll store mine in a file called `credentials.sh` and add it to `.gitignore``. \n\n```bash\nsource credentials.sh\n```\n\n## Running the app\nWith your credentials in place, you can now run the `run.sh` script.\n```bash\nbash run.sh\n```\n\nIf this is your first time running the script, a browser window will open and prompt you to log in to both Spotify and Strava. Note, that the code and tokens generated during this workflow will only be stored on your local machine, meaning if you want to run this code somewhere else, you need to copy these credentials there or go through the authorization process again. \n\nIf you were properly able to log in and authenticate, you should see your terminal print the stages of the workflow being executed. The process ends by printing out the activity id of the activities that got updated descriptions, along with the beginning of the Tracklist string. \n\nFinally, the code ends with the following messages:\n```\nComplete.\nExiting endurabeats...\n```\nIf you only see the final message, that means everything was ok, except you don't have any recent activity on Strava with overlapping activity on Spotify. Spotify only allows a user to access their last 50 songs. Looking further back into history would require storing the song history in a database, which is not implemented in this version of the app.\n\n\n## Future Work\n- Modularize the code to call from single command line operation\n- Add tests\n- (If allowed) Add database to store song history\n- Add more details about each track (url, audio features, etc.)\n- Build tracklist into a linkable playlist on Spotify\n\n\n## Acknowledgments\n\nWe would like to acknowledge the following API providers, making this project possible:\n\n- [Strava Developers](https://developers.strava.com/)\n- [Spotify for Developers](https://developer.spotify.com/)\n\nIf you use or distribute this software, please ensure proper attribution to this repository and these providers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmhalvor%2Fendurabeats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmhalvor%2Fendurabeats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmhalvor%2Fendurabeats/lists"}