Connecting Polar Flow service

Are there any known plans for connecting the intervals.icu platform to the Polar Flow platform?

Kind regards,
Martijn Balhuizen

2 Likes

As a general principle Intervals.icu wants to be connected to as many services as possible with a preference for services that already aggregate other services (more integrations for less work). So hopefully Polar Flow eventually.

I am going to be adding oauth2 support to Intervals.icu soon which will make it easier for 3rd parties to upload activities and wellness data to Intervals.icu (e.g. HealthFit iOS app).

Polar seem to be behind the curve on their automated 3rd party integration but you can hack it yourself using their Polar Accesslink. It’s not super straight forward though because first you have to register on a separate site to obtain a client id, then you have to make a request to get an “authorization code” - which is returned as a url parameter on a redirect url rather than json data. :grimacing:

Finally, using that authorization code you then make another request to obtain a token!
Google script requests seem to have a hard time with the redirect - I couldn’t actually make that work natively so had to do that part manually and just capture the token id. Polar example scripts only seem to be Python so my version 1 was running a Python script that copied data into Googlesheets.

However, once you have that token, the requests to obtain data are quite straight forward and you can grab them from Google App scripts and put into a Google sheet. Which is what I do - and then I also sent a PUT request to intervals to keep my HRV and sleep updated regularly using the script trigger functionality.

https://www.polar.com/accesslink-api/#polar-accesslink-api

Happy to share my scripts if anyone has an interest in using/adapting it.

1 Like

The just released OAuth2 support makes it possible for you or anyone else to write a web app that transfers data from the Polar API to Intervals.icu for any user. The Polar API also uses OAuth2.

Nice. That gives me something to look at for my version 3 of an integration :grin:
I have also discovered an OAuth2 for Google App Script library repo

Noticed this thread while finally deciding that I wanted to see some of my Polar HR data alongside everything else – didn’t know about accesslink so thanks @Daniel_Lewis! I was pleasantly surprised at how decent their documentation was.

After grabbing an account and approving myself there, I was able to whip up a small python script to import the last year’s worth of RHR/HRV/Sleep data into intervals, which is great.

If there’s sufficient interest from others, I could certainly work on a small transfer app that allows users of both systems to auth and pull their data over.

5 Likes

I definitely would be interested!

I’d most definitely be keen.

Would love to be able to unlink Strava but I most definitely can’t build something myself looking at some of the links for the API stuff… no clue of programming in any way at all.

That would be great!