v1
latestOpenAPI 3.1.02026-07-136587849.3 KBTime Series
This endpoint returns a time series for a given metric with automatic merge strategy selection. The system chooses the optimal merge method based on metric characteristics to ensure the best data quality without manual configuration.
Request Example
{
"from_timestamp": "2024-01-01T00:00:00Z",
"to_timestamp": "2024-01-02T00:00:00Z",
"metric": "heartrate"
}
Response Example
{
"metric": "heartrate",
"start_at": "2024-01-01T00:00:00Z",
"offsets": [0, 60000, 120000],
"durations": [60000, 60000, 60000],
"values": [100, 150, 200],
"providers": ["garmin"]
}
<Note>
The arrays `offsets`, `durations`, and `values` will all be of the same length. This alignment is crucial for interpreting the data correctly.
</Note>
Overriding the Default Merge Method
To override the default merge strategy, use the merge_method parameter.
<Note> The default merge method is automatically selected based on the metric type and provides optimal data quality for most use cases. Only override the default if you have specific requirements that cannot be met by the automatic selection. This parameter is intended for advanced users who understand the implications of different merge strategies. </Note>Source Selection Methods
Selects data from a single best provider source based on criteria like coverage, granularity, or priority. Only one source contributes to the final result, ensuring consistency but potentially losing data from other sources.
-
select_best_weighted_source: Best weighted coverage score mix of time coverage and data point density
-
select_highest_coverage_source: Highest total time coverage (sum of all entry durations)
-
select_most_granular_source: Most data points (highest entry count)
-
select_highest_priority_source_type: Sample > Intraday > Summary > Activity priority, then weighted coverage
Coverage Optimization Methods
Maximizes time coverage by selecting non-overlapping entries from multiple sources. Prioritizes filling time gaps while avoiding overlaps, using interval scheduling algorithms.
-
merge_maximize_coverage: Weighted interval scheduling to maximize total time coverage
-
merge_maximize_granularity: Source with most data points, then greedy interval scheduling
-
merge_maximize_weighted_coverage: Source with best weighted coverage score, then greedy interval scheduling
Sample Merging Methods
Combines all sample data points, resolving conflicts at identical timestamps by selecting the source with the most total entries. Preserves all available data while handling timestamp collisions.
- merge_all_samples: All zero-duration samples, conflicts resolved by source with most total entries
Query parameters
Start time of the query range in UTC, inclusive
Start time of the query range in UTC, inclusive
End time of the query range in UTC, non-inclusive
End time of the query range in UTC, non-inclusive
The metric you want to query
The metric you want to query
Whether to include the record IDs in the response
Whether to include the record IDs in the response
Method to merge data
Method to merge data
Device types to include
Device types to include
Response
OK
Example response
{
"from_timestamp": "2006-01-02T00:00:00Z",
"providers": [
"strava"
],
"record_ids": [
"12345678-1234-abcd-4321-abcdef123456"
],
"to_timestamp": "2006-01-02T00:00:00Z"
}