Export Google Fit Daily Steps, Weight and Distance to a Google Sheet

Updated on Saturday, November 9, 2024

Comments Page 10

Return to post.

Comments

Robert Ellison

A quick note on the 'Updates to Google Fit's Developer Policy and APIs' email. After reviewing the requirements for sensitive scopes there is an exception for personal use:

Personal Use: The app is not shared with anyone else or will be used by fewer than 100 users (all of whom are known personally to you). Note that your app will be subject to the unverified app screen and the 100-user cap will be in effect.

So using this script to export your own Google Fit data will continue to be allowed without any Google review. If you have used this script to create a service that other people use then you probably do need to be prepared to have Google review your implementation.

Kai Lansdell

Gotcha, didn't realize it expected a "history"sheet. Must've missed it. Thanks you for the help!

Robert Ellison

Darren - I have seen the email but not had a chance to check it in detail. The current code uses read scopes so that should be OK. I don't know what the changes to the sensitivity mean for the OAuth flow yet. If there is a breaking change I will try to fix it.

Robert Ellison

Kai - Could be the same problem? The history version expects a sheet called History so you'll see the same error if the sheet doesn't exist.

Darren Wall

Google have sent out an email referring to changes in the Google Fit API. Will these changes require any update to the code above?

Kai Lansdell

Hello,

I am also getting the "Cannot read property 'appendRow' of null" when trying to pull data from the past 60 days. Pulling data from today works fine. Does this function not work or does this script only have the ability to pull data from the day it is authorized?

Thank you!

Mike

Ah that was it...thanks!

Robert Ellison

Mike, sounds like it's not loading the sheet. It expects the sheet to be called Metrics. If it has a different name then this is the error I'd expect.

Mike

Thank you for putting this together. I worked through all of the authorization issues, but now I'm getting "TypeError: Cannot read property 'appendRow' of null". I tried outputting the json to the Logger and it seems to be blank. Am I missing some required config? I'm using your code and the only thing I've updated is the Client ID and Secret.

Thanks again,

-Mike

Robert Ellison

John - From your project in APIs and Services (Google Developer Console) click Credentials in the left menu, then the edit icon next to your OAuth2.0 Client, you can add the redirect URI at the bottom of that screen.

Add Comment

All comments are moderated. Your email address is used to display a Gravatar and optionally for notification of new comments and to sign up for the newsletter.