ARISense Data API

Index

Getting Started

  1. Create an account or Login
  2. Request an API key from your "User Preferences" page
  3. Make sure you have a device registered under your account
  4. Use it as in the examples below

Routes

/api/devices

Get all of the devices currently registered

Response

{
	err: Array,			//error messages
	rows: [{			//a list of the devices
		id: String,		//unique id for device
		lat: Double,	//latitude
		lng: Double,	//longitude
		name: String,	//user-specified name for the device
		recent: String,	//when it was last updated
		user: String,	//user id of owner
		you: Boolean	//whether you own this device or not
	}]
}

/api/query/{device id}?key={your api key}[&before=timestamp&after=timestamp&type=D|P&interval=integer]

query will get up to 2500 items which match the specified parameters. These can be chained to get all the data of a device asynchronously, such as in this example using javascript and jquery:

function getAllData(device, first, after, before) {
	$.get("/api/query/" + device + "?first=" + first + "&after=" + after + "&interval=60" + "&before=" + before + "&key={YOURKEY}", function(data) {
		if(!data.err){
			//*******
			//do something with the partial data
			//
			console.log(data); //a part of the total data
			//
			//
			//*******
			if(data.done){
				
			}
			else{
				getAllData(data.device, false, data.after, new Date(data.rows[0].timestamp))
			}
		}
		else{
			console.log(data);
		}
	});
}

getData("{DEVICE ID}", true, "1468227737000", "1468235582000"); //2 example timestamps

Response

{
	err: Array, 				//error messages
	after: String, 				//timestamp of calculated lower time bound
	before: String, 			//timestamp of calculated upper time bound
	device: String, 			//the id of the device
	done: Bool,					//whether the query is done (no more elements to return)
	interval: String,			//the calculated interval
	originalAfter: String, 		//the original lower time bound
	originalBefore: String, 	//the original upper time bound
	originalInterval: String,	//the original interval,
	rows: [{				 	//the data returned from the query
		device: String,			//id of the device
		id: String,				//unique id for this data point
		raw: String,			//the data string (see "Data Format")
		timestamp: String,		//when this data was received
		type: String			//whether D(gas) or P(particle) data
	}]
}

Examples

/api/query/{device id}?key={key}&interval=60&type=D: returns 60-second gas data

/api/query/{device id}?key={key}&after=1451606400000: returns 60-second gas data after January 1st, 2016


/api/scan/{device id}?key={your api key}&type=D|P[&before=timestamp&after=timestamp&interval=integer&download=true|false]

scan is similar to query, but it returns all of the data from a particular device in a specified time range. Unlike query, a data type must be specified. In addition, this operation can only get data from devices which the key owner owns or has been allowed to download.

Response

Unlike query, the scan command returns the data in a newline-separated list, such as:
P,06/15/2016 12:57:39,3,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,13,0,0,57,5.2e+00,10000,2.7e+00,6.1e-02,5.7e-01,2.5e+00
P,06/15/2016 12:57:43,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5.2e+00,10000,2.7e+00,5.0e-02,6.9e-02,6.9e-02
P,06/15/2016 12:57:47,2,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,11,25,0,0,5.3e+00,10000,2.7e+00,8.6e-02,1.7e-01,1.7e-01
P,06/15/2016 12:57:51,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,5.3e+00,10000,2.7e+00,2.0e-02,2.3e-02,2.3e-02

Data Format

There are two types of data string which the ARISense returns: D-data (gas and environmental data) and P-data

An example of a line of D data: D,06/27/2016 19:19:02,296,100879,25.44,38.47,10.260,3,-2,282,285,25.12,5087,6106,5568,24.93,17143,17598,-1,26.39,17551,17653,-1,26.43,5497,5504,-1,0,0,0,0,0,0....

And P data: P,06/27/2016 13:25:10,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,7.3e+00,10000,2.5e+00,2.5e-02,7.4e-02,7.6e-02

D-Data (Gas) Format

index
description
Atmospheric Conditions
0
Data type (always D)
1
Date-time (month, day, year; (hr.min.sec))
2
Temperature Inside the Box (C)
3
Barometric Pressure Inside the Box (Pa)
4
Flow Manifold Air Temp (C)
5
Flow Manifold Air RH (%)
6
Flow Manifold Air Dew Point (C)
7
Ambient Noise
8
Solar
9
Wind Direction
10
Wind Speed
Corresponding to CO-B4 Electrochemical Sensor
11
Temperature (C) at base of ECS1 position
12
ECS1 Aux Electrode Output Signal (bits)
13
ECS1 Working Electrode Output Signal (bits)
14
ADC input channel on ECS1 position (currently receiving CO2 signal)
Corresponding to NO2-B43F Electrochemical Sensor
15
Temperature (C) at base of ECS2 position
16
ECS2 Aux Electrode Output Signal (bits)
17
ECS2 Working Electrode Output Signal (bits)
18
ADC input channel on ECS2 position (currently open)
Corresponding to Ox-B421 Electrochemical Sensor
19
Temperature (C) at base of ECS3 position
20
ECS3 Aux Electrode Output Signal (bits)
21
ECS3 Working Electrode Output Signal (bits)
22
ADC input channel on ECS3 position (currently open)
Corresponding to NO-B4 Electrochemical Sensor
23
Temperature (C) at base of ECS4 position
24
ECS4 Aux Electrode Output Signal (bits)
25
ECS4 Working Electrode Output Signal (bits)
26
ADC input channel on ECS4 position (currently open)
General
27
open
28
Conc. ECS1 (CO) (ppb)
29
Conc. ECS2 (NO2) (ppb)
30
Conc. ECS3 (Ox) (ppb)
31
Conc. ECS4 (NO) (ppb)
32
open

P-Data (Particle) Format

index or indexes
description
0
Data type (always P)
1
Date-time (month, day, year; (hr.min.sec))
2-17
Particle Counts Per Size
18-21
Particle Time-of-Flight In Bins 1,3,5,7
22
Sample Flow Rate (cc/s)
23
Temperature/Pressure
24
Sample period
25
Small particle concentration
26
Medium particle concentration
27
Large particle concentration
A project by Aerodyne Research, Inc.