MQInsights Developer Documentation logo DOCS

Sensor Data

The Sensor Data API lets you query sensor readings from devices deployed across your facilities: temperature, humidity, motion, and 40+ other sensor types, with flexible filtering and time-based queries.

Before You Begin

Query Sensor Data

GET {{API_DOMAIN}}/integrations/sensor-data-lite/

Retrieve sensor readings filtered by sensor type, time range, or location attributes.

Query Parameters

Parameter Type Location Required Description
sensor_type__in string query No Filter by sensor type (comma-separated for multiple)
building_description string query No Filter by building description
timestamp__gte string query No Start time (ISO8601), greater than or equal
timestamp__lte string query No End time (ISO8601), less than or equal

Example Request

bash
curl -sS "{{API_DOMAIN}}/integrations/sensor-data-lite/?sensor_type__in=TEMPERATURE&building_description=CC%20R%26D&timestamp__gte=2025-05-22T13:00:00Z&timestamp__lte=2025-05-22T13:15:00Z" \
  -H "Authorization: Bearer $MQ_TOKEN" | jq

Example Response

json
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 3177020,
      "sensor_type_name": "TEMPERATURE",
      "data_key": "temperature",
      "device_id": "24E124707D359335",
      "description": "Device Description",
      "is_alert_state": true,
      "timestamp": "2025-05-22T13:00:44Z",
      "local_timezone": "America/New_York",
      "battery_level": 91,
      "status": "ACTIVE",
      "campus_description": "CC",
      "building_description": "CC R&D",
      "floor_description": "10",
      "room_description": "10001",
      "zone_description": "1",
      "data": { "temperature": 22.3 }
    }
  ]
}

Response Pagination

Field Description
count Total number of matching records
next URL to next page (null if last page)
previous URL to previous page (null if first page)
results Array of sensor data objects

Time Range Filtering

code
# Last hour
timestamp__gte=2025-05-22T12:00:00Z&timestamp__lte=2025-05-22T13:00:00Z

# Today
timestamp__gte=2025-05-22T00:00:00Z&timestamp__lte=2025-05-22T23:59:59Z

# Last 15 minutes
timestamp__gte=2025-05-22T12:45:00Z&timestamp__lte=2025-05-22T13:00:00Z

Multiple Sensor Types

Query multiple sensor types in a single request:

code
GET {{API_DOMAIN}}/integrations/sensor-data-lite/?sensor_type__in=TEMPERATURE,HUMIDITY,PRESSURE

Response Codes

Code Status Description
200 OK Sensor data retrieved successfully
400 Bad Request Invalid query parameters
401 Unauthorized Invalid or expired access token
5xx Internal Server Error Service temporarily unavailable

Optimization Tips: Limit time ranges for better performance, paginate with next/previous for large datasets, filter by location to narrow results, combine filters to get exactly what you need, and cache frequently accessed data to reduce API calls.

Supported Sensor Types

MQinsights supports 40+ sensor types across the following categories. Use these type identifiers when querying sensor data.

Environmental Sensors

Sensor Type Description Data Key Unit
TEMPERATURE Temperature measurement temperature Celsius
HUMIDITY Relative humidity humidity Percentage
PRESSURE Atmospheric pressure pressure hPa
CO2 Carbon dioxide level co2 ppm
PM2_5 Particulate matter 2.5μm pm2_5 μg/m³
PM10 Particulate matter 10μm pm10 μg/m³
TVOC Total volatile organic compounds tvoc ppb
LIGHTLEVEL Light intensity light_level lux

Detection & Status Sensors

Sensor Type Description Data Key Values
WATER_LEAK Water leak detection water_leak boolean
OPEN_CLOSE Door/window status open_close boolean
VIBRATION Vibration detection vibration boolean
PRESENCE Presence detection presence boolean
MOTION Motion detection motion boolean
PUSH_BUTTON Button press event button boolean
CONSUMABLE_OUT Consumable depleted consumable_out boolean
SOCKET_STATUS Power socket status socket_status boolean
LOAD_STATUS Load status load_status boolean
LOAD_CHANGE_STATE Load state change load_change boolean

Electrical & Power Sensors

Sensor Type Description Data Key Unit
DAILY_ENERGY_USAGE Daily energy consumption energy kWh
POWER_FACTOR Power factor power_factor Ratio
CURRENT Electrical current current Amperes
ACTIVE_POWER Active power power Watts
FREQUENCY Frequency frequency Hz
VOLTAGE Voltage voltage Volts

Counting & Analytics Sensors

Sensor Type Description Data Key Unit
PEOPLE_COUNTING People count count Number
OBJECT_COUNTING Object count count Number
OCCUPANCY Room occupancy occupied boolean

Position & Measurement Sensors

Sensor Type Description Data Key Unit
LOCATION Location data location Coordinates
POSITION Position tracking position Coordinates
FILL_LEVEL Fill level measurement fill_level Percentage
DISTANCE Distance measurement distance Meters

System, Connectivity & Object Detection

Sensor Type Description Data Key Values
CONNECTIVITY Network connectivity connected boolean
DISPLAY_TEXT Display text content text String
OBJECT_DETECTION Detect objects detected boolean

Usage Examples

code
# Environmental data
GET {{API_DOMAIN}}/integrations/sensor-data-lite/?sensor_type__in=TEMPERATURE,HUMIDITY,CO2

# Power consumption
GET {{API_DOMAIN}}/integrations/sensor-data-lite/?sensor_type__in=DAILY_ENERGY_USAGE,ACTIVE_POWER

# Occupancy
GET {{API_DOMAIN}}/integrations/sensor-data-lite/?sensor_type__in=PEOPLE_COUNTING,OCCUPANCY

# Leak detection
GET {{API_DOMAIN}}/integrations/sensor-data-lite/?sensor_type__in=WATER_LEAK

Each sensor reading includes a data object with the sensor value, e.g.:

json
{
  "sensor_type_name": "TEMPERATURE",
  "data_key": "temperature",
  "data": {
    "temperature": 22.3
  }
}

Need a Sensor Type? If you need a sensor type not listed here, contact MQinsights support. New sensor types are added regularly based on customer needs.

What's Next?