Sync your Strava reviews to a Notion database!
Inspired by @IVIURRAY and @kevinschaich.
- Create an app though the Strava API; you can use this image for the icon
- Insert
Client IDandClient Secretinto your.env - Create an app through the Notion API; you can use this image for the icon
- Add your secret as
TOKEN_V3in your.env - Create a database (create this as a blank database page) in Notion and copy the ID to config file; see "Finding your Notion database ID"
- Give your Notion integration access to the database (under the
Sharebutton) - Add the relevant columns to the database; the default needs: Name, Type (select), Length (number), Time (number), Date (date), Power (number), Elevation (number), Strava Link (URL)
- You can customize these in the
notion_api_new.pyfile.
- You can customize these in the
Copy the link to your database page that will look like: https://www.notion.so/<long_hash_1>?v=<long_hash_2> then choose <long_hash_1>, this is the database ID.
gh repo clone michaelfromyeg/strava2notioncd strava2notionpython3.12 -m venv envsource env/bin/activatepip install --upgrade pippip install -r requirements.txtmake run- This will open a browser to ask you to authenticate the integration; if you're on WSL, I recommend using
google-chromevia WSLg. - For subsequent runs set
ALL_DATAinconfig.pytoFalseto upload only new activities. - You can also run it via Windows Task Scheduler (use the
.batfile) or on a related service (e.g., as acronjob)
- This will open a browser to ask you to authenticate the integration; if you're on WSL, I recommend using
The notion_api_test.py file is left in for you to test adding different data to the database. See Strava API for what other data is taken from the API request.
The HTTP Requests are abstracted away by two helpful libraries: stravio and notion-sdk-py.
Their documentation coupled with the official API documentation is useful for debugging and customization.