Search code examples
restgoogle-fit

Google Fit Rest Api Step Counts inconsistent and different from Fit App


This seems to be a common enough problem that there are a lot of entries when one googles for help but nothing has helped me yet.

I am finding that the results provided by the REST API for estimated_steps are wildly different from those that appear in the device app.

I am running a fetch task for users via cron job on a PHP/Laravel app.

I'm using this https://developers.google.com/fit/scenarios/read-daily-step-total - estimated_steps to retrieve the step count.

Some days the data is correct. Some days its wildly different. For instance, on one given day, the REST API gives step count of 5661 while the app shows 11,108. Then there are six seven days when the stream is correct.

Has anyone faced this sort of behavior? I've tested for timezone differences, logged and analyzed the response json to see if i'm making some obvious mistake, but nope.


Solution

  • You may check this How do I get the same step count as the Google Fit app? documentation. Be noted that even when using the right data source, your step count may still be different from that of the Google Fit app.

    This could be due to one of the following reasons:

    • On Wear, the Fit MicroApp when connected will display step counts queried on the phone and transferred over via the Wearable APIs. Other MicroApps accessing local-only data will only get watch steps. We are working on making this easier for developers.
    • Sometimes the step calculation code for the Google Fit app is updated with bug fixes before we are able to release the fixes to developers (which requires a Google Play Services release). We are also working on making it possible for developers to access fixes at the same time.

    The Fit app uses a specific data source for steps and it adds some functionality (which can be seen on the documentation) on top of the default merged steps stream.

    You can access the "estimated" steps stream as shown here:

    derived:com.google.step_count.delta:com.google.android.gms:estimated_steps
    

    Hope this helps!