Skip to content

Sensors

The Sensors resource provides details about individual air quality sensing units that collect environmental data. As such, a Location can have one or more sensors, each tracking a single parameter such as PM2.5, PM10, or humidity.

The Sensors resource should not be confused with the term “air sensors” which is a Location designation (alongside reference-grade).

The Instruments resource provides the following method:

  • get() - For accessing data about a single sensor by its sensors ID.

The get() method accepts one single sensors_id as an argument and returns details about that sensor in a SensorsResponse object.

get(
sensors_id: int
) -> SensorsResponse
argumentdescriptioninput requirements
sensors_idint OpenAQ’s unique ID for each sensorRequired
from openaq import OpenAQ
# Retrieve information about the sensor with ID=1 on OpenAQ
with OpenAQ(api_key="replace-me-with-a-valid-key") as client:
client.sensors.get(sensors_id=1)

The Sensor objects in the results of the SensorsResponse contain attributes that have all data about them. The hierarchy below presents the depth of the attributes and their datatypes.

results[]
├── id: int
├── name: str
├── parameter
│ ├── id: int
│ ├── name: str
│ ├── units: str
│ └── displayName: str
├── datetime_first
│ ├── utc: str
│ └── local: str
├── datetime_last
│ ├── utc: str
│ └── local: str
├── coverage
│ ├── expectedCount: int
│ ├── expectedInterval: str
│ ├── observedCount: int
│ ├── observedInterval: str
│ ├── percentComplete: float
│ ├── percentCoverage: float
│ ├── datetimeFrom
│ │ ├── utc: str
│ │ └── local: str
│ └── datetimeTo
│ ├── utc: str
│ └── local: str
├── latest
│ ├── datetime
│ │ ├── utc: str
│ │ └── local: str
│ ├── value: float
│ └── coordinates
│ ├── latitude: float
│ └── longitude: float
└── summary
├── min: float
├── q02: float | None
├── q25: float | None
├── median: float | None
├── q75: float | None
├── q98: float | None
├── max: float
├── avg: float
└── sd: float