Skip to main content

Recent Measurements — Cohort ID

Retrieve the latest hourly calibrated air quality measurements from all devices in your Cohort. This endpoint returns data from approximately the last 7 days.

Data freshness

Each measurement is an hourly average, so the newest record is for the most recent completed hour, not the last few minutes. See Data Freshness → to check how current a reading is and how often to poll.

Tier requirement

Available on all tiers including Free.


Endpoint​

GET https://api.airqo.net/api/v2/devices/measurements/cohorts/{COHORT_ID}?token={SECRET_TOKEN}

Path parameters​

ParameterTypeRequiredDescription
COHORT_IDstringYesYour unique Cohort identifier

Query parameters​

ParameterTypeRequiredDescription
tokenstringYesYour SECRET TOKEN from Account Settings

Example request​

curl -X GET \
"https://api.airqo.net/api/v2/devices/measurements/cohorts/64b9c7d5e3f82b0014c5a123?token=YOUR_SECRET_TOKEN"

JavaScript (fetch):

const cohortId = '64b9c7d5e3f82b0014c5a123';
const token = 'YOUR_SECRET_TOKEN';

const response = await fetch(
`https://api.airqo.net/api/v2/devices/measurements/cohorts/${cohortId}?token=${token}`
);
const data = await response.json();

console.log(`Found ${data.meta.total} measurements across your devices.`);

Python:

import requests

cohort_id = '64b9c7d5e3f82b0014c5a123'
token = 'YOUR_SECRET_TOKEN'

response = requests.get(
f'https://api.airqo.net/api/v2/devices/measurements/cohorts/{cohort_id}',
params={'token': token}
)
data = response.json()

for measurement in data['measurements']:
print(f"{measurement['device']} at {measurement['time']}: PM2.5 = {measurement['pm2_5']['value']} μg/m³")

Example response​

{
"success": true,
"isCache": false,
"message": "successfully returned the measurements",
"meta": {
"total": 168,
"skip": 0,
"limit": 30,
"page": 1,
"pages": 6,
"startTime": "2025-09-21T11:00:00.000Z",
"endTime": "2025-09-28T11:00:00.000Z"
},
"measurements": [
{
"device": "airqo_bx2847",
"device_id": "65c8d4a2f1b45c0012a3e789",
"site_id": "64f7b3e8c9d25a0013f2d456",
"time": "2025-09-25T14:00:00.000Z",
"pm2_5": {
"value": 23.45
},
"pm10": {
"value": 31.82
},
"frequency": "hourly",
"deviceDetails": {
"name": "airqo_bx2847",
"isOnline": true,
"status": "deployed",
"latitude": 0.3476,
"longitude": 32.5825,
"lastActive": "2025-09-25T14:00:00.000Z"
}
}
]
}

Response fields​

Top-level​

FieldDescription
successtrue if the request succeeded
isCacheWhether the response was served from cache
messageHuman-readable status message
metaPagination and query metadata
measurementsArray of measurement objects

meta object​

FieldDescription
totalTotal matching measurements
skipRecords skipped (for pagination)
limitMax records per page
pageCurrent page number
pagesTotal number of pages
startTimeQuery start (ISO 8601)
endTimeQuery end (ISO 8601)

Measurement object​

FieldDescription
deviceDevice name
device_idUnique device identifier
site_idLocation identifier
timeReading timestamp (ISO 8601)
pm2_5.valuePM2.5 in μg/m³
pm10.valuePM10 in μg/m³
frequencyAlways "hourly" for this endpoint
deviceDetails.isOnlineWhether device is currently active
deviceDetails.latitudeDevice latitude
deviceDetails.longitudeDevice longitude
deviceDetails.lastActiveLast calibrated reading timestamp (ISO 8601)
deviceDetails.lastRawDataLast raw reading timestamp (ISO 8601). Optional: may be absent.

Pagination​

If your Cohort has many devices, results are paginated. Use skip and limit (default 30, max 80) to page through:

# Page 2: skip the first 30 records
curl "https://api.airqo.net/api/v2/devices/measurements/cohorts/{COHORT_ID}?token={SECRET_TOKEN}&limit=30&skip=30"

See Pagination reference → for a full walkthrough.


Need data older than 7 days?​

The recent measurements endpoint returns approximately the last 7 days. For historical data, use the Analytics API →.