Description
API scalardata allows users to get scalar data.
URL
http://data.oceannetworks.ca/api/scalardata
Method | Description | Example |
---|---|---|
getByLocation | Returns scalar data by given location code and device category | method=getByLocation |
getByDevice | Returns scalar data by given device code. | method=getByDevice |
* getByStation was deprecated as of October 1, 2017 (see bottom of this page for documentation). It has been replaced by the getByLocation method.
getByLocation
Returns scalar data in JSON format by given location code and device category code.
Parameters
Parameter | Type | Description | Example |
---|---|---|---|
Required | |||
token | string | All Web Services require a token. This can be generated at https://data.oceannetworks.ca/Profile. Click on the "Web Services" tab and click "Generate Token". | token=YOUR_TOKEN_HERE |
locationCode | string | Return scalar data from a specific Location.
| locationCode=KVIP.C2 |
deviceCategoryCode | string | Return scalar data belonging to a specific Device Category Code.
| deviceCategoryCode=BPR |
Optional | |||
propertyCode | string | Return scalar data from devices with a sensor for a specific Property.
| propertyCode=seawatertemperature |
sensorCategoryCodes | string | A comma separated list of sensor code names. If missing, the system will return all search scalar data within the location code, device category pair, and propertyCode (if given). | sensorCategoryCodes= pressure,borehole_pressure1,oxygen |
dateFrom | date | Return scalar data that has a timestamp on or after a specific date/time. Accepted DateTime formats:
If not specified, the default value is the beginning of time.
| dateFrom=2010-07-27T00:00:00.000Z dateFrom=2010-07-27 dateFrom=-P1DT1H
|
dateTo | date | Return scalar data that has a timestamp before a specific date/time. Accepted DateTime formats:
If not specified, the default value is the end of time.
| dateTo=2016-08-01T00:00:00.000Z dateTo=2016-08-01 dateTo=PT12H30M
|
metadata | string | There are two values:
The metadata is for the latest deployment overlapping the time range specified by dateFrom and dateTo. | metadata=Minimum |
rowLimit | integer | Limits the number of scalar data rows returned for each sensor code. If rowLimit is missing, is an invalid number, or is over 100,000, the maximum value of 100,000 will be used. | rowLimit=80000 |
outputFormat | string | There are two values:
| outputFormat=Object |
getLatest | boolean | Specifies whether or not the latest scalar data readings should be returned first. This is false by default. When set to true, readings are returned and pagination is done from latest to earliest. | getLatest=true |
Response
Success
{ "metadata": { "boundingBox": { "maxDepth":<Double>, "maxLat":<Double>, "maxLon":<Double>, "minDepth":<Double>, "minLat":<Double>, "minLon":<Double> }, "depth":<Double>, "deviceCategoryCode":<String>, "lat":<Double>, "locationName":<String>, "lon":<Double> }, "next": { "parameters": { "metadata":<String>, "method":"getByLocation", "dateTo":<String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')>, "rowLimit":<String>, "locationCode":<String>, "deviceCategoryCode":<String>, "sensorCategoryCodes":<String>, "dateFrom":<String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')>, "outputFormat" : <String>, "token":<String (GUID)> }, "url": <String (URL)> }, "queryUrl": <String (URL)>, "sensorData": [ { "data": { "qaqcFlags": <Array of integers>, "sampleTimes": <Array of String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')>, "values": <Array of doubles> }, "sensorCode":<String>, "sensorName":<String>, "unitOfMeasure":<String> }, ... ] }
Property | Type | Description | Example |
---|---|---|---|
next | Object | An object containing information on how to make a rawdata call if the current call was unable to return all the data as a limit was exceeded. This is null if there is no more data in the requested range. | |
| Object | An object containing the set of parameters making up the query to get the next set of data in the requested date range. The parameters will include all parameters passed into the original URL. | |
| String | As passed into the original call | "minimum" |
| String | getByLocation, as passed into the original call. | "getByLocation" |
| String | As passed into the original call | "2015-02-25T00:00:01.000Z" |
| String | As passed into the original call | "10" |
| String | As passed into the original call | "NC27" |
| String | As passed into the original call | "CORK" |
| String | As passed into the original call | "pressure" |
| String | This is set to 1 millisecond more than the date of the last reading sent in the current call. | "2015-02-25T00:00:01.189Z" |
| String | As passed into the original call | "object" |
| String | As passed into the original call | "YOUR_TOKEN_HERE" |
| String | The complete URL that can be used to get the next set of data in the requested range. | "https://data.oceannetworks.ca/api/scalardata?method=getByLocation&dateTo=2015-02-25T00%3A00%3A01.000Z&locationCode=NC27&deviceCategoryCode=CORK&dateFrom=2015-02-25T00%3A00%3A01.189Z&token=YOUR_TOKEN_HERE" |
queryUrl | String | URL of current query | "https://data.oceannetworks.ca/api/scalardata?method=getByLocation&dateTo=2015-02-25T00%3A00%3A01.000Z&locationCode=NC27&deviceCategoryCode=CORK&dateFrom=2015-02-25T00%3A00%3A00.000Z&token=YOUR_TOKEN_HERE" |
sensorData | Array of objects | Data sets returned for all applicable sensors | |
| Object | Data sets returned for a single sensor | |
| Array of integers | QAQC test results of each data point–guidelines for what each number means:
| [1] |
| Array of strings | Sampling times of sensor data returned, formatted asyyyy-MM-dd'T'HH:mm:ss.SSS'Z' | ["2015-02-25T00:00:00.188Z"] |
| Array of doubles | Values of sensor data returned, units of measurement are given in sensorData.unitOfMeasure | [2706.1145305467917] |
| String | Code of sensor, can be null | "sigmaT" |
| String | Name that denotes what the sensor measures | "Uncompensated Borehole Pressure" |
| String | Unit of measurement or "NA" if none apply; temperature units of measure are "C" for degrees Celsius | "Gregorian days since 19700101T000000Z" |
metadata | Object | Optional; only returned if the metadata parameter is set to full | |
| Object | Bounding limits statistics | |
| Double | Maximum depth in meters below water surface (negative numbers denote above) | 982.0 |
| Double | Maximum latitude in degrees north of the equator (negative numbers denote south) | 48.316583 |
| Double | Maximum longitude in degrees east of the prime meridian (negative numbers denote west) | -126.050796 |
| Double | Minimum depth in meters below water surface (negative numbers denote above) | 982.0 |
| Double | Minimum latitude in degrees north of the equator (negative numbers denote south) | 48.316583 |
| Double | Minimum longitude in degrees east of the prime meridian (negative numbers denote west) | -126.050796 |
| Double | Depth in meters below water surface (negative numbers denote above) | 2660.5 |
| String | Should be the same as next.parameters.deviceCategoryCode | "CORK" |
| Double | Latitude in degrees north of the equator (negative numbers denote south) | 47.7626 |
| String | Name of location | "ODP 1026" |
| Double | Longitude in degrees east of the prime meridian (negative numbers denote west) | -127.759212 |
Note: Not all the properties above may be included in the resulting JSON, especially parameters that were not in the original call.
Example
{ "next":{ "parameters":{ "propertyCode":"totalpressure", "method":"getByLocation", "sensorCategoryCodes":"pressure,borehole_pressure1", "dateTo":"2015-02-25T00:00:01.000Z", "locationCode":"NC27", "deviceCategoryCode":"CORK", "dateFrom":"2015-02-25T00:00:01.189Z", "token":"YOUR_TOKEN_HERE" }, "url":"https://data.oceannetworks.ca/api/scalardata?propertyCode=totalpressure&sensorCategoryCodes=pressure,borehole_pressure1&method=getByLocation&dateTo=2015-02-25T00%3A00%3A01.000Z&locationCode=NC27&deviceCategoryCode=CORK&dateFrom=2015-02-25T00%3A00%3A01.189Z&token=YOUR_TOKEN_HERE" }, "queryUrl":"https://data.oceannetworks.ca/api/scalardata?method=getByLocation&token=YOUR_TOKEN_HERE&locationCode=NC27&deviceCategoryCode=CORK&dateFrom=2015-02-25T00:00:00.000Z&dateTo=2015-02-25T00:00:01.000Z&propertyCode=totalpressure&sensorCategoryCodes=pressure,borehole_pressure1", "sensorData":[ { "data":{ "qaqcFlags":[ 1 ], "sampleTimes":[ "2015-02-25T00:00:00.188Z" ], "values":[ 2706.1145305467917 ] }, "sensorCode":"Pressure", "sensorName":"Uncompensated Seafloor Pressure", "unitOfMeasure":"decibar" }, { "data":{ "qaqcFlags":[ 1 ], "sampleTimes":[ "2015-02-25T00:00:00.188Z" ], "values":[ 2705.9145624950315 ] }, "sensorCode":"borehole_pressure1", "sensorName":"Uncompensated Borehole Pressure", "unitOfMeasure":"decibar" } ] }
Example with outputFormat option
{ "next":{ "parameters":{ "propertyCode":"totalpressure", "method":"getByLocation", "dateTo":"2015-02-25T00:00:01.000Z", "locationCode":"NC27", "deviceCategoryCode":"CORK", "dateFrom":"2015-02-25T00:00:01.189Z", "outputFormat":"object", "token":"YOUR_TOKEN_HERE" }, "url":"https://data.oceannetworks.ca/api/scalardata?propertyCode=totalpressure&method=getByLocation&dateTo=2015-02-25T00%3A00%3A01.000Z&locationCode=NC27&deviceCategoryCode=CORK&dateFrom=2015-02-25T00%3A00%3A01.189Z&outputFormat=object&token=YOUR_TOKEN_HERE" }, "queryUrl":"https://data.oceannetworks.ca/api/scalardata?method=getByLocation&token=YOUR_TOKEN_HERE&locationCode=NC27&deviceCategoryCode=CORK&dateFrom=2015-02-25T00:00:00.000Z&dateTo=2015-02-25T00:00:01.000Z&propertyCode=totalpressure&outputFormat=object", "sensorData":[ { "data":[ { "qaqcFlag":1, "sampleTime":"2015-02-25T00:00:00.188Z", "value":2706.1145305467917 } ], "sensorCode":"Pressure", "sensorName":"Uncompensated Seafloor Pressure", "unitOfMeasure":"decibar" }, { "data":[ { "qaqcFlag":1, "sampleTime":"2015-02-25T00:00:00.188Z", "value":2705.9145624950315 } ], "sensorCode":"borehole_pressure1", "sensorName":"Uncompensated Borehole Pressure", "unitOfMeasure":"decibar" } ] }
getByDevice
Returns scalar data in JSON format by given device code.
Parameters
Parameter | Type | Description | Example |
---|---|---|---|
Required | |||
token | String | All Web Services require a token. This can be generated at https://data.oceannetworks.ca/Profile. Click on the "Web Services" tab and click "Generate Token". | token=YOUR_TOKEN_HERE |
deviceCode | String | Return raw data of a specific Device Code.
| deviceCode=ASLZAP1006 |
Optional | |||
dateFrom | String | Return raw data that has a timestamp on or after a specific date/time. Accepted DateTime formats:
If not specified, the default value is the beginning of time.
| dateFrom=2017-06-08T00:00:00.000Z dateFrom=-P2Y11MT15H30M5S |
dateTo | String | Return scalar data that has a timestamp before a specific date/time. Accepted DateTime formats:
If not specified, the default value is the end of time.
| dateTo=2017-06-08T01:00:00.000Z dateTo=P1Y2M10DT2H30M |
rowLimit | Integer | The limit on the number of scalar data readings to return. If not specified the row limit is 100,000. | rowLimit=300 |
outputFormat | String | There are two values:
| outputFormat=object |
getLatest | Boolean | Specifies whether or not the latest raw data readings should be returned first. This is false by default. When set to true, readings are returned and pagination is done from latest to earliest. | getLatest=true |
Response
Success (outputFormat = Array)
{ "next": { "parameters": { "method": "getByDevice", "dateTo": "2019-02-16T02:00:00.010Z", "deviceCode": "SBECTD19p7027", "rowLimit": "2", "dateFrom": "2019-02-16T00:40:39.319Z", "token": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "url": "http://127.0.0.1:8080/dmas/api/scalardata?method=getByDevice&dateTo=2019-02-16T02%3A00%3A00.010Z&deviceCode=SBECTD19p7027&rowLimit=2&dateFrom=2019-02-16T00%3A40%3A39.319Z&token=ffffffff-ffff-ffff-ffff-ffffffffffff" }, "queryURL": "http://127.0.0.1:8080/dmas/api/scalardata?method=getByDevice&token=ffffffff-ffff-ffff-ffff-ffffffffffff&deviceCode=SBECTD19p7027&dateFrom=2019-02-16T00:06:26.028Z&dateTo=2019-02-16T02:00:00.010Z&rowLimit=2", "sensorData": [ { "data": { "qaqcFlags": [ 1, 1 ], "sampleTimes": [ "2019-02-16T00:40:37.316Z", "2019-02-16T00:40:38.323Z" ], "values": [ 3.15891, 3.15889 ] }, "sensorCategoryCode": "conductivity", "sensorCode": "cond", "sensorName": "Conductivity", "unitOfMeasure": "S/m" }, { "data": { "qaqcFlags": [ 4, 4 ], "sampleTimes": [ "2019-02-16T00:40:37.316Z", "2019-02-16T00:40:38.323Z" ], "values": [ 1033.216417644338, 1033.216285819126 ] }, "sensorCategoryCode": "density", "sensorCode": "density", "sensorName": "Density", "unitOfMeasure": "kg/m3" }, { "data": { "qaqcFlags": [ 4, 4 ], "sampleTimes": [ "2019-02-16T00:40:37.316Z", "2019-02-16T00:40:38.323Z" ], "values": [ 1271.617, 1271.62 ] }, "sensorCategoryCode": "pressure", "sensorCode": "Pressure", "sensorName": "Pressure", "unitOfMeasure": "decibar" }, { "data": { "qaqcFlags": [ 4, 4 ], "sampleTimes": [ "2019-02-16T00:40:37.316Z", "2019-02-16T00:40:38.323Z" ], "values": [ 34.303, 34.3028 ] }, "sensorCategoryCode": "salinity", "sensorCode": "salinity", "sensorName": "Practical Salinity", "unitOfMeasure": "psu" }, { "data": { "qaqcFlags": [ 4, 4 ], "sampleTimes": [ "2019-02-16T00:40:37.316Z", "2019-02-16T00:40:38.323Z" ], "values": [ 27.334823592291514, 27.33467289103237 ] }, "sensorCategoryCode": "sigma_t", "sensorCode": "sigmaT", "sensorName": "Sigma-t", "unitOfMeasure": "kg/m3" }, { "data": { "qaqcFlags": [ 4, 4 ], "sampleTimes": [ "2019-02-16T00:40:37.316Z", "2019-02-16T00:40:38.323Z" ], "values": [ 27.342687544595037, 27.342536578750924 ] }, "sensorCategoryCode": "sigma_theta", "sensorCode": "SIGMA_THETA", "sensorName": "Sigma-theta (0 dbar)", "unitOfMeasure": "kg/m3" }, { "data": { "qaqcFlags": [ 4, 4 ], "sampleTimes": [ "2019-02-16T00:40:37.316Z", "2019-02-16T00:40:38.323Z" ], "values": [ 1482.157, 1482.157 ] }, "sensorCategoryCode": "sound_speed", "sensorCode": "Sound_Speed", "sensorName": "Sound Speed", "unitOfMeasure": "m/s" }, { "data": { "qaqcFlags": [ 1, 1 ], "sampleTimes": [ "2019-02-16T00:40:37.316Z", "2019-02-16T00:40:38.323Z" ], "values": [ 2.932, 2.9319 ] }, "sensorCategoryCode": "temperature", "sensorCode": "Temperature", "sensorName": "Temperature", "unitOfMeasure": "C" } ] }
Property | Type | Description | Example |
---|---|---|---|
next | Object | An object containing information on how to make a scalardata call if the current call was unable to return all the data as a limit was exceeded. This is null if there is no more data in the requested range. | |
| Object | An object containing the set of parameters making up the query to get the next set of data in the requested date range. The parameters will include all parameters passed into the original URL. | |
| String | getByDevice, as passed into the original call. | "getByDevice" |
| String | As passed into the original call | " |
| String | As passed into the original call | "SBECTD19p7027 " |
| String | As passed into the original call | "2 " |
| String | This is set to 1 millisecond more than the date of the last reading sent in the current call. |
|
| String | As passed into the original call | "ffffffff-ffff-ffff-ffff-ffffffffffff" |
| String | The complete URL that can be used to get the next set of data in the requested range. |
|
queryUrl | String | URL of current query |
|
sensorData | Array of objects | Data sets returned for all applicable sensors | |
| Object | Data sets returned for a single sensor | |
| Array of integers | QAQC test results of each data point–guidelines for what each number means:
|
|
| Array of strings | Sampling times of sensor data returned, formatted asyyyy-MM-dd'T'HH:mm:ss.SSS'Z' |
|
| Array of doubles | Values of sensor data returned, units of measurement are given in sensorData.unitOfMeasure |
|
| String | Code of sensor, can be null | "conductivity" |
| String | Code of sensor, can be null
| "cond" |
| String | Name that denotes what the sensor measures |
|
| String | Unit of measurement or "NA" if none apply; temperature units of measure are "C" for degrees Celsius |
|
Failure
See External Web Services Standards: Error Messaging.
Example (outputFormat object)
http://127.0.0.1:8080/dmas/api/scalardata?method=getByDevice&token=ffffffff-ffff-ffff-ffffffffffff&deviceCode=SBECTD19p7027&dateFrom=2019-02-16T00:05:26.028Z&dateTo=2019-02-16T01:00:00.010Z&outputFormat=object
{ "next": null, "queryURL": "http://127.0.0.1:8080/dmas/api/scalardata?method=getByDevice&token=ffffffff-ffff-ffff-ffff-ffffffffffff&deviceCode=SBECTD19p7027&dateFrom=2019-02-16T00:05:26.028Z&dateTo=2019-02-17T00:00:00.010Z&outputFormat=object", "sensorData": [ { "data": [ { "qaqcFlag": 1, "sampleTime": "2019-02-16T00:40:37.316Z", "value": 3.15891 }, { "qaqcFlag": 1, "sampleTime": "2019-02-16T00:40:38.323Z", "value": 3.15889 }, { "qaqcFlag": 1, "sampleTime": "2019-02-16T00:40:39.319Z", "value": 3.15891 }, ], "sensorCategoryCode": "temperature", "sensorCode": "Temperature", "sensorName": "Temperature", "unitOfMeasure": "C" } ] }
Example (getLatest)
{ "next": { "parameters": { "getLatest": "true", "method": "getByDevice", "dateTo": "2019-02-16T00:59:54.321Z", "deviceCode": "SBECTD19p7027", "rowLimit": "5", "dateFrom": "2019-02-16T00:06:26.028Z", "token": "ffffffff-ffff-ffff-ffff-ffffffffffff" }, "url": "http://127.0.0.1:8080/dmas/api/scalardata?getLatest=true&method=getByDevice&dateTo=2019-02-16T00%3A59%3A54.321Z&deviceCode=SBECTD19p7027&rowLimit=5&dateFrom=2019-02-16T00%3A06%3A26.028Z&token=ffffffff-ffff-ffff-ffff-ffffffffffff" }, "queryURL": "http://127.0.0.1:8080/dmas/api/scalardata?method=getByDevice&token=ffffffff-ffff-ffff-ffff-ffffffffffff&deviceCode=SBECTD19p7027&dateFrom=2019-02-16T00:06:26.028Z&dateTo=2019-02-16T01:00:00.010Z&getLatest=true&rowLimit=5", "sensorData": [ { "data": { "qaqcFlags": [ 1, 1, 1, 1, 1 ], "sampleTimes": [ "2019-02-16T00:59:59.329Z", "2019-02-16T00:59:58.317Z", "2019-02-16T00:59:57.318Z", "2019-02-16T00:59:56.320Z", "2019-02-16T00:59:55.322Z" ], "values": [ 3.15887, 3.15889, 3.15887, 3.15887, 3.15887 ] }, "sensorCategoryCode": "conductivity", "sensorCode": "cond", "sensorName": "Conductivity", "unitOfMeasure": "S/m" }, { "data": { "qaqcFlags": [ 4, 4, 4, 4, 4 ], "sampleTimes": [ "2019-02-16T00:59:59.329Z", "2019-02-16T00:59:58.317Z", "2019-02-16T00:59:57.318Z", "2019-02-16T00:59:56.320Z", "2019-02-16T00:59:55.322Z" ], "values": [ 1033.216109844531, 1033.2163281809346, 1033.2162239082807, 1033.2161554700383, 1033.2160189481963 ] }, "sensorCategoryCode": "density", "sensorCode": "density", "sensorName": "Density", "unitOfMeasure": "kg/m3" }, { "data": { "qaqcFlags": [ 4, 4, 4, 4, 4 ], "sampleTimes": [ "2019-02-16T00:59:59.329Z", "2019-02-16T00:59:58.317Z", "2019-02-16T00:59:57.318Z", "2019-02-16T00:59:56.320Z", "2019-02-16T00:59:55.322Z" ], "values": [ 1271.616, 1271.612, 1271.641, 1271.626, 1271.636 ] }, "sensorCategoryCode": "pressure", "sensorCode": "Pressure", "sensorName": "Pressure", "unitOfMeasure": "decibar" }, { "data": { "qaqcFlags": [ 4, 4, 4, 4, 4 ], "sampleTimes": [ "2019-02-16T00:59:59.329Z", "2019-02-16T00:59:58.317Z", "2019-02-16T00:59:57.318Z", "2019-02-16T00:59:56.320Z", "2019-02-16T00:59:55.322Z" ], "values": [ 34.3026, 34.3029, 34.3026, 34.3026, 34.3024 ] }, "sensorCategoryCode": "salinity", "sensorCode": "salinity", "sensorName": "Practical Salinity", "unitOfMeasure": "psu" }, { "data": { "qaqcFlags": [ 4, 4, 4, 4, 4 ], "sampleTimes": [ "2019-02-16T00:59:59.329Z", "2019-02-16T00:59:58.317Z", "2019-02-16T00:59:57.318Z", "2019-02-16T00:59:56.320Z", "2019-02-16T00:59:55.322Z" ], "values": [ 27.334513191219912, 27.334752740942577, 27.334513191219912, 27.334513191219912, 27.334335494507968 ] }, "sensorCategoryCode": "sigma_t", "sensorCode": "sigmaT", "sensorName": "Sigma-t", "unitOfMeasure": "kg/m3" }, { "data": { "qaqcFlags": [ 4, 4, 4, 4, 4 ], "sampleTimes": [ "2019-02-16T00:59:59.329Z", "2019-02-16T00:59:58.317Z", "2019-02-16T00:59:57.318Z", "2019-02-16T00:59:56.320Z", "2019-02-16T00:59:55.322Z" ], "values": [ 27.342376762326467, 27.342616416723104, 27.342376937935114, 27.342376832569926, 27.34219951187515 ] }, "sensorCategoryCode": "sigma_theta", "sensorCode": "SIGMA_THETA", "sensorName": "Sigma-theta (0 dbar)", "unitOfMeasure": "kg/m3" }, { "data": { "qaqcFlags": [ 4, 4, 4, 4, 4 ], "sampleTimes": [ "2019-02-16T00:59:59.329Z", "2019-02-16T00:59:58.317Z", "2019-02-16T00:59:57.318Z", "2019-02-16T00:59:56.320Z", "2019-02-16T00:59:55.322Z" ], "values": [ 1482.157, 1482.157, 1482.157, 1482.157, 1482.157 ] }, "sensorCategoryCode": "sound_speed", "sensorCode": "Sound_Speed", "sensorName": "Sound Speed", "unitOfMeasure": "m/s" }, { "data": { "qaqcFlags": [ 1, 1, 1, 1, 1 ], "sampleTimes": [ "2019-02-16T00:59:59.329Z", "2019-02-16T00:59:58.317Z", "2019-02-16T00:59:57.318Z", "2019-02-16T00:59:56.320Z", "2019-02-16T00:59:55.322Z" ], "values": [ 2.9319, 2.9319, 2.9319, 2.9319, 2.9321 ] }, "sensorCategoryCode": "temperature", "sensorCode": "Temperature", "sensorName": "Temperature", "unitOfMeasure": "C" } ] }