filters |
JSON array of triplets |
Search for workouts by specifying filters. The filters
parameter value is a JSON string in the following form:
[["field1", "operator1", value1], ["field2", "operator2", value2], ...]
Since the filters are expressed as a JSON string, they must be properly URI encoded.
Available fields
Field |
Type |
Description |
activityID |
integer |
Activity ID
Example:
["activityID", "eq", 10]
|
workoutID |
integer |
Workout type ID.
Example:
["workoutID", "eq", 1]
|
date |
Date |
The workout date.
Example:
["date", "eq", "2014-04-18"]
|
time |
Time |
The workout start time.
Example:
["time", "eq", "18:30:00"]
|
distance |
Distance
or decimal expressed in meters
|
The workout distance.
Distance can be expressed as the distance object:
{ value: 5, unit: "mi" }
or it can be expressed in meters: 8046.72
Due to floating point rounding errors, it is not commended to
search for workouts by distance using the equality operator
(i.e. don't use the filter ["distance", "eq", { value: 5, unit: "mi" }] ).
Instead, specify a range to account for rounding errors:
["distance", "ge", { value: 4.99, unit: "mi" }],
["distance", "le", { value: 5.01, unit: "mi" }]
You can do the same thing by specifying distance in meters:
["distance", "ge", 8040]
["distance", "le", 8052]
|
duration |
decimal in seconds |
The duration of the workout expressed in seconds.
Example:
["duration", "eq", 2400]
|
courseID |
string |
The course's ID.
Example:
["courseID", "eq", "dd8bdfe3622b42daa30e24124525c9b8"]
|
fieldPlacement |
integer |
If the workout is a race, specify the overall placement.
Example:
["fieldPlacement", "eq", 121]
|
fieldSize |
integer |
If the workout is a race, specify the overall field size.
Example:
["fieldSize", "eq", 260]
|
groupPlacement |
integer |
If the workout is a race, specify the placement without the group.
Example:
["groupPlacement", "eq", 23]
|
groupSize |
integer |
If the workout is a race, specify the number of participants in the group.
Example:
["groupSize", "eq", 43]
|
weight |
Weight
or integer expressed in grams
|
The user's weight during the workout.
Weight can be expressed as the weight object:
{ value: 140, unit: "lb" }
or it can be expressed in grams: 63503
Due to floating point rounding errors, it is not commended to
search for workouts by weight using the equality operator
(i.e. don't use the filter ["weight", "eq", { value: 140, unit: "lb" }] ).
Instead, specify a range to account for rounding errors:
["weight", "ge", { value: 139.9, unit: "lb" }],
["weight", "le", { value: 140.1, unit: "lb" }]
You can do the same thing by specifying weight in grams:
["weight", "ge", 63500]
["weight", "le", 63506]
|
restHR |
integer |
The user's resting heart rate associated with the workout.
Example:
["restHR", "eq", 56]
|
avgHR |
integer |
The user's average heart rate during the workout.
Example:
["avgHR", "eq", 135]
|
maxHR |
integer |
The user's maximum heart rate during the workout.
Example:
["maxHR", "eq", 181]
|
hoursSlept |
decimal |
The number of hours slept.
Example:
["hoursSlept", "eq", 7.3]
|
quality |
integer |
The quality of the workout Acceptable values are between 1 and 10.
Example:
["quality", "eq", 8] |
effort |
integer |
The perceived effort of the workout. Acceptable values are between 1 and 10.
Example:
["effort", "eq", 3] |
temperature |
Temperature
or decimal expressed in Celsius degrees
|
The temperature during the workout.
Temperature can be expressed as the temperature object:
{ value: 55, unit: "F" }
or it can be expressed in Celsius: 12.8
Due to floating point rounding errors, it is not commended to
search for workouts by temperature using the equality operator
(i.e. don't use the filter ["temperature", "eq", { value: 55, unit: "F" }] ).
Instead, specify a range to account for rounding errors:
["temperature", "ge", { value: 54.5, unit: "F" }],
["temperature", "le", { value: 55.5, unit: "F" }]
You can do the same thing by specifying temperature in Celsius degrees:
["temperature", "ge", 12.5],
["temperature", "le", 12.9]
|
Available operators
Note that fields with string values such as the course ID only accepts the equals
(eq ) operator since comparing the course ID using other operators
doesn't makes sense.
Operator |
Value |
Less than |
lt |
Less than or equals |
le |
Equals |
eq |
Greater than or equals |
ge |
Greater than |
gt |
Examples
Find workouts with distance greater than 10 km:
filters=[["distance","gt",10000]]
Find running races with distance between 5 miles and 10 km:
filters=[["activityID","eq",10],["workoutID","eq",6],["distance","ge",{value:5,unit:"mi"}],["distance","ge",{value:10,unit:"km"}]]
|