This endpoint is still on our legacy API.
Get historical data for specified sensors. This method returns a set of historical data for the specified sensors in the specified time range and at the specified time resolution.
Rate limit: 100 requests/min (learn more about rate limits here).
Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team.
To use this endpoint, select Write Sensors under the Equipment category when creating or editing an API token. Learn More.
curl --request POST \
--url https://api.samsara.com/v1/sensors/history \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endMs": 1462881998034,
"series": [
{
"field": "ambientTemperature",
"widgetId": 1
}
],
"startMs": 1462878398034,
"stepMs": 3600000,
"fillMissing": "withNull"
}
'{
"results": [
{
"series": [
1
],
"timeMs": 1453449599999
}
]
}Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Time range and resolution, and list of sensor ID, field pairs to query.
End of the time range, specified in milliseconds UNIX time.
1462881998034
40Show child attributes
Beginning of the time range, specified in milliseconds UNIX time.
1462878398034
Time resolution for which data should be returned, in milliseconds. Specifying 3600000 will return data at hour intervals.
3600000
withNull, withPrevious List of results objects, each containing a time and a datapoint for each requested sensor/field pair.
Contains the results for a sensor history request. Each result contains a timestamp and datapoint for each requested (sensor, field) pair.
Show child attributes
curl --request POST \
--url https://api.samsara.com/v1/sensors/history \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endMs": 1462881998034,
"series": [
{
"field": "ambientTemperature",
"widgetId": 1
}
],
"startMs": 1462878398034,
"stepMs": 3600000,
"fillMissing": "withNull"
}
'{
"results": [
{
"series": [
1
],
"timeMs": 1453449599999
}
]
}