For the complete documentation index, see llms.txt. This page is also available as Markdown.

Can the SDK retrieve historical data, and over what period?

SDK-provider data can flow automatically once a user connects, if the scheduler is on.

SDK-provider data can flow automatically once a user connects, if the scheduler is on. When you call initConnection with schedulerOn = true (the default), the Android SDK uses WorkManager to periodically fetch new data and send it to your webhook automatically (default intervals: activity every 20 minutes, daily/body/sleep/nutrition every 8 hours; configurable server-side). With schedulerOn = false, no automatic fetch happens and your app must call the getter functions itself.

To backfill specific historical ranges on demand, call the SDK retrieval functions (getDaily, getActivity, getSleep, getBody, getNutrition) with a startDate and endDate and toWebhook = true to send results to your destination (returns a reference ID), or toWebhook = false to receive the full payload in the completion callback.

The available lookback depends on the route and what the platform exposes:

  • Health Connect (including Samsung and Google Fit read via Health Connect): 30 days into the past, and not before the moment the user granted permission.

  • The Samsung direct route depends on what Samsung Health exposes on-device.

Large REST historical responses are split into chunks (at most 10MB or 10 objects each, whichever hits first), all sharing one terra-reference header. See the SDK references and requesting historical data.

Last updated

Was this helpful?