Returns a paginated list of all sensor readings, ordered from newest to oldest (50 per page). Supports optional filtering by device or sensor type. Each reading includes the device name and sensor type name and unit via eager-loaded relationships.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GaelCeballos/Smart_Enviro_Backend/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
GET/api/sensor-data
Auth: None required. This is a public apiResource route.
Query Parameters
Filter readings to a specific device by its integer database ID. When omitted, readings from all devices are returned.
Filter readings to a specific sensor type by its integer database ID. When omitted, all sensor types are included in the results.
Page number for pagination. Defaults to
1. Each page contains up to 50 records ordered by recorded_at descending.Example Requests
Response
200 OK
Returns a standard Laravel paginated response envelope. Thedata array contains the reading records for the current page.
The current page number being returned.
Array of sensor reading objects for the current page, ordered newest-first by
recorded_at.Number of records per page. Fixed at
50.Total number of records matching the applied filters across all pages.
The last available page number, calculated as
ceil(total / per_page).Full URL to the next page of results.
null when on the last page.Full URL to the previous page of results.
null when on the first page.The
sensor_type_id query parameter here expects the integer database ID (from the sensor_types table), not the metric_key string. The POST /api/sensor-data store endpoint is the exception where metric_key strings are accepted.