1. Basic Data Points (getHealthDataFromTypes)
Fetch individual health data points for specified time ranges.
Best for:
- Viewing detailed raw data
- Analyzing individual measurements
- Displaying timelines
- Export/backup operations
2. Interval/Bucketed Data (getHealthIntervalDataFromTypes)
Fetch data aggregated into fixed time intervals (e.g., hourly, daily).
Best for:
- Charts and graphs
- Daily/weekly/monthly summaries
- Trend analysis
- Statistical overviews
3. Aggregate Data (getHealthAggregateDataFromTypes)
Fetch pre-aggregated summaries across multiple types.
Best for:
- Workout summaries
- Multi-metric dashboards
- Performance analytics
- Activity overviews
4. Steps Total (getTotalStepsInInterval)
Get the total step count for a time period.
Best for:
- Step counters
- Daily step goals
- Quick step queries
- Activity badges
Quick Comparison
| Method | Granularity | Types | Aggregation | Performance |
|---|---|---|---|---|
getHealthDataFromTypes | Individual points | Multiple | None | Good for small ranges |
getHealthIntervalDataFromTypes | Time buckets | Multiple | Platform-native | Optimized for charts |
getHealthAggregateDataFromTypes | Multi-type summaries | Multiple | Cross-type | Best for workouts |
getTotalStepsInInterval | Single number | Steps only | Full sum | Fastest for steps |
Data Flow
Common Patterns
Single Type Query
Multiple Types Query
Time Range Patterns
Data Processing
Filtering by Recording Method
Removing Duplicates
The plugin automatically removes duplicates, but you can also call explicitly:Sorting Data
Grouping by Type
Performance Considerations
Large Datasets
For large time ranges, the plugin offloads parsing to isolates:Pagination Pattern
For very large datasets, fetch in chunks:Caching Strategy
Error Handling
Common Errors
Validation
Next Steps
Choose the reading method that fits your use case:- Basic Reading - Individual data points with full details
- Interval Reading - Time-bucketed aggregations
- Aggregate Reading - Multi-type summaries
- Reading Steps - Optimized step count queries