Get Started

Usage of our API requires a key. The key should be included in each API call as a query parameter, for example: &key=ABCDEFGH12345678. Contact us directly to obtain an API key: contact@tetradsensors.com

getSensorData

https://api.tetradsensors.com/getSensorData?startTime=2021-06-01T00:00:00Z&endTime=2021-06-01T01:00:00Z&sensorSource=Tetrad&areaModel=slc_ut

Get sensor data in a region for a given period of time.


QUERY PARAMETERS

Field Required Description
startTime Required Start datetime in zulu time with format 2018-01-03T20:00:00Z
endTime Required End datetime as above
sensorSource Optional The particular kind or owner of sensor to be included. Valid options defined in the area_params.json file. Default is all sources. A nonexistent source will return an empty data list.
id Optional A particular sensor id. Default is all. A nonexistent id will return an empty data list.
noCorrection Optional If included as a parameter the results are not corrected for calibration factors. This overrides the default of applying correction to all data.
areaModel Optional Limits the query to any one area model[s] specified in the area_params.json file. Default is all. A nonexistent area model string will return an empty data list.

getLiveSensors

https://api.tetradsensors.com/getLiveSensors?sensorSource=Tetrad&areaModel=slc_ut

Get an average of the last 15 minutes of data.


QUERY PARAMETERS

Field Required Description
sensorSource Optional The particular kind or owner of sensor to be included. Valid options defined in the area_params.json file. Default is all sources. A nonexistent source will return an empty data list.
noCorrection Optional If included as a parameter the results are not corrected for calibration factors. This overrides the default of applying correction to all data.
areaModel Optional Limits the query to any one area model[s] specified in the area_params.json file. Default is all. A nonexistent area model string will return an empty data list.
flagOutliers Optional If this parameter is given, then each measurement has an associated "status" entry in the record that indicates whether the measurement has been identified as an outlier using th emean absolute deviation method (MAD).

getTimeAggregatedData

https://api.tetradsensors.com/getTimeAggregatedData?startTime=2021-07-01T00:00:00Z&endTime=2021-07-01T02:00:00Z&function=mean&groupBy=id

Get aggregated sensor data.


QUERY PARAMETERS

Field Required Description
startTime Required Start datetime in zulu time with format 2018-01-03T20:00:00Z
endTime Required End datetime as above
function Required One of: mean, min, max
groupBy Optional One of: id, sensorSource, or area. Default is to apply the function over all sensors at the specified times/intervals
timeInterval Optional The amount of time, in minutes, over which to apply the function/aggregation. Default is 60 minutes.
sensorSource Optional The particular kind or owner of sensor to be included. Valid options defined in the area_params.json file. Default is all sources. A nonexistent source will return an empty data list.
id Optional A particular sensor id. Default is all. A nonexistent id will return an empty data list.
applyCorrection Optional If included as a parameter the results are corrected for calibration factors. This overrides the default of not applying correction. If correction is turned on, then sensors will also be grouped by area and sensormodel (these are required for corrections).
areaModel Optional Limits the query to any one area model[s] specified in the area_params.json file. Default is all. A nonexistent area model string will return an empty data list.

getLocalSensorData

https://api.tetradsensors.com/getLocalSensorData?startTime=2021-06-01T00:00:00Z&endTime=2021-06-01T01:00:00Z&lat=40.7566&lon=-111.8773&radius=5000

Get aggregated sensor data.


QUERY PARAMETERS

Field Required Description
startTime Required Start datetime in zulu time with format 2018-01-03T20:00:00Z
endTime Required End datetime as above
lat Required Latitude of GPS coordinate
lon Required Longitude of GPS coordinate
radius Required Radius, im meters, for query region

getEstimateMap

https://api.tetradsensors.com/getEstimateMap?time=2021-06-01T00:00:00Z&latHi=40.8206&latLo=40.481700000000004&lonHi=-111.7616&lonLo=-112.15939999999999&latSize=50&lonSize=50

Get a map of interpolated PM2.5 values for the given region.


QUERY PARAMETERS

Field Required Description
startTime Required Start datetime in zulu time with format 2018-01-03T20:00:00Z
endTime Required End datetime as above
timeInterval Required The time between individual maps, given in hours (or parts of hours, e.g. 0.25 is 15 minutes)
time Required The datetime to take a single-time estimate map (grid). Required if start/end are not specified. This parameter also accepts "time=now" to get an estimate at the current time.
latLo, latHi, lonLo, lonHi Required Upper and lower GPS bounds of the lat/lon box that defines the extent of the map.
latSize, lonSize Required Integers that define the number of grid points that will be estimated along the lat and lon directions for the map.
areaModel Optional Specifies a particular area model to use for this query. The default is to find an arae model that contain sth e upper-right corner of the box.

getEstimateAtLocation

https://api.tetradsensors.com/getEstimateAtLocation?startTime=2021-06-01T00:00:00Z&endTime=2021-06-01T01:00:00Z&timeInterval=0.25&lat=40.7566&lon=-111.8773

Get a PM2.5 estimate at the specified location.


QUERY PARAMETERS

Field Required Description
startTime Required Start datetime in zulu time with format 2018-01-03T20:00:00Z
endTime Required End datetime as above
timeInterval Required The time between individual maps, given in hours (or parts of hours, e.g. 0.25 is 15 minutes)
lat, lon Required The latitude and longitude of the estimate.

getEstimateAtLocations

https://api.tetradsensors.com/getEstimateAtLocations?startTime=2021-06-01T13:00:00Z&endTime=2021-06-01T14:00:00Z&timeInterval=0.25&lats=40.7566,40.7566&lons=-111.8773,-111.86

Get a map of interpolated PM2.5 values for the given locations.


QUERY PARAMETERS

Field Required Description
startTime Required Start datetime in zulu time with format 2018-01-03T20:00:00Z
endTime Required End datetime as above
timeInterval Required The time between individual maps, given in hours (or parts of hours, e.g. 0.25 is 15 minutes)
lats, lons Required A list, separated by commas, of the latitudes and longitudes of the estimates, respectively

getCorrectionFactors

https://api.tetradsensors.com/getCorrectionFactors?areaModel=slc_ut&time=2021-08-01T00:00:00Z

Get the correction factors applied to PM2.5 data for the given region and time.


QUERY PARAMETERS

Field Required Description
areaModel Optional Limits the query to any one area model[s] specified in the area_params.json file. Default is all. A nonexistent area model string will return an empty data list.
time Optional The time which the PM2.5 calibration parameters cover. If not supplied correction factors for all timespans are returned.

getRegions

https://api.tetradsensors.com/getRegions

Get the currently tracked regions. Used as inputs for the areaModel parameter.


User Account Services

The following routes may be used to query information related to user account. The API key query parameter must be included in all of the following routes to gain information regarding the account attached to that key.

getQuota

https://api.tetradsensors.com/limited/getQuota

Get quota for this period for a specific API key.


getQuotaUsed

https://api.tetradsensors.com/limited/getQuotaUsed

Get quota used for this period for a specific API key.


getQuotaRemaining

https://api.tetradsensors.com/limited/getQuotaRemaining

Get quota remaining for this period for a specific API key.


nickname

https://api.tetradsensors.com/limited/nickname?device=AAAAAAAAAAAA&nickname=University%20Engineering

Give your device a nickname.


QUERY PARAMETERS

Field Required Description
device Required The name of the device. Must be 12-digit HEX, all caps.
nickname Required The nickname. The name must be URL-encoded before being inserted into the query. Use a site like urlencoder.org to encode it. It can up to 128 digits alphanumeric or include spaces, ~, or -