...
No Format |
---|
http://data.oceannetworks.ca/api/scalardata |
Method | Description | Example |
---|---|---|
getByStation* | Returns scalar data by given station code and device category | method=getByStation |
getByLocation | Returns scalar data by given location code and device category | method=getByLocation |
* getByStation is still available but is was deprecated as of October 1, 2017 (see bottom of this page for documentation). It has been replaced by the getByLocation method.
Anchor |
---|
...
|
...
|
...
getByLocation
Returns scalar data in JSON format by given station location code and device category code.
Parameters
Parameter | Type | Description | Example | |||
---|---|---|---|---|---|---|
Required | ||||||
token | string | credential token in GUID format | ffffffff-ffff-ffff-ffff-ffffffffffff | |||
stationlocationCode | string | the code of a stationlocation | NCBCKVIP.C2 | |||
deviceCategorydeviceCategoryCode | string | the code of a device category | BPR | |||
Optional | sensors||||||
propertyCode | stringString | the code of a property | seawatertemperature | |||
sensorCategoryCodes | String | A comma separated list of sensor code name. If missing, the system will return all search scalar data within the | stationlocation code | and, device category pair, and propertyCode (if given). | pressure, | temperatureborehole_pressure1,oxygen |
dateFrom | date | inclusive start date in "yyyy-MM-ddTHH:mm:ss.SSSZ" format. If missing, the system will return last reading. | 2015-05-25T00:00:00.000Z | |||
dateTo | date | exclusive end date in "yyyy-MM-ddTHH:mm:ss.SSSZ" format. If missing , the system will use a 24-hour 1 day range. | 2015-05-26T0026T20:0001:0023.000Z456Z | |||
metadata | String | Minimum (default or if missing) (case insensitive) Full (case insensitive) metadata is for the latest deployment overlapping dateFrom and dateTo or, if no dates specified, the latest deployment overall | MinimumoutputFormat | |||
rowLimit | integer | maximum row scalar data returns for each sensor code. For those data they are sorted by sample time. If missing or invalid number, the maximum 100,000 will be used. If given number is over 100,000, the maximum 100,000 will be used. | 80000 | |||
outputFormat | String | String | Array (default or if missing) | (case insensitive) Object | ||
rowLimit | integer | maximum row scalar data returns for each sensor code. For those data they are sorted by sample time. If missing or invalid number, the maximum 100,000 will be used. If given number is over 100,000, the maximum 100,000 will be used. | 80000 |
...
(case insensitive) | Object | ||
getLatest | Boolean | Whether 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 | true |
Response
Success
Code Block | |||||
---|---|---|---|---|---|
| |||||
{ "metadata": { "bbox "boundingBox": { "maxDepth": double<Double>, "maxLat": double<Double>, "maxLon": double<Double>, "minDepth": double<Double>, "minLat": double<Double>, "minLon": double<Double> }, "dateFrom": string, "dateTo": string, "depth": double, "deviceCategoryName": string, "latitude": double, "longitude": double, "stationName": string }, "sensorData": [ "depth":<Double>, "deviceCategoryCode":<String>, "lat":<Double>, "locationName":<String>, "lon":<Double> }, "next": { "parameters": { "actualSamplesmetadata": integer<String>, "data": [//outputFormat=object {method":"getByLocation", "sampleTimedateTo": string<String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')>, "valuerowLimit": double<String>, "qaqcFlaglocationCode": integer<String>, }"deviceCategoryCode":<String>, ... ]"sensorCategoryCodes":<String>, "datadateFrom": [//outputFormat=array {<String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')>, "sampleTimesoutputFormat" : [array of strings], "values": [array of doubles], "qaqcFlags": [array of integers] }, ... ] <String>, "token":<String (GUID)> }, "url": <String (URL)> }, "queryUrl": <String (URL)>, "sensorData": [ { "data": { "qaqcFlags": <Array of integers>, "sensorsampleTimes": string, <Array of "sensorName": string, "unitOfMeasure": string String (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')>, "values": <Array of doubles> }, ... ] "sensorCode":<String>, "serviceMetadatasensorName": {<String>, "dateFromunitOfMeasure": string, "dateTo": string, "deviceCategory": string, "metadata": string, "nextDateFrom": string, "outputFormat": string, "rowLimit": string, "sensors": string, "station": string, "totalActualSamples": integer } } |
...
double
...
double
...
double
...
<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 | "ffffffff-ffff-ffff-ffff-ffffffffffff" |
| 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=ffffffff-ffff-ffff-ffff-ffffffffffff" |
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=ffffffff-ffff-ffff-ffff-ffffffffffff" |
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
Note: If the value is null, this may be displayed in the resulting JSON as a null.
Example
https://data.oceannetworks.ca/api/scalardata?method=getByStationgetByLocation&token=ffffffff-ffff-ffff-ffff-ffffffffffff&station=SCHDW.O1&deviceCategory=OXYSENSORffffffffffffffff&locationCode=NC27&deviceCategoryCode=CORK&dateFrom=2015-02-25T00:00:00.000Z&dateTo=2015-02-25T00:00:01.000Z&propertyCode=totalpressure&sensorCategoryCodes=pressure
Code Block |
---|
{ "sensorDatanext":{ [{ "actualSamples "parameters":{ 1, "data": [{ "qaqcFlag": 0, "sampleTime": "2015-08-20T17:30:53.058Z", "value": 23.4859 }], "sensor": "Temperature", "sensorName": "Temperature", "unitOfMeasure": "C" }, { "actualSamples": 1, "data": [{ "qaqcFlag": 1, "sampleTime": "2015-08-20T17:30:53.058Z", "value": 4.417862252 }], "sensor": "oxygen", "sensorName": "Oxygen", "unitOfMeasure": "ml/l" }], "serviceMetadata": { "dateFrom": null, "dateTo": null, "deviceCategory": "OXYSENSOR", "nextDateFrom": null, "outputFormat": null, "rowLimit": null, "sensors": null, "station": "SCHDW.O1", "totalActualSamples": 2 } } |
...
Returns scalar data in JSON format by given location code and device category code.
Parameters
...
Minimum (default or if missing) (case insensitive)
provides only basic property information
Full (case insensitive)
provides all property information
metadata is for the latest deployment overlapping dateFrom and dateTo or, if no dates specified, the latest deployment overall
...
Object(case insensitive)
data will be output as a list of objects for a given sensor. Inside each data object, there are sampleTime, value, and qaqcFlag
"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":"c9ed940d-1c48-49ca-9bbd-1b126cb50917"
},
"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=fffffffffffff"
},
"queryUrl":"https://data.oceannetworks.ca/api/scalardata?method=getByLocation&token=fffffffffffff&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
Code Block |
---|
{
"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":"c9ed940d-1c48-49ca-9bbd-1b126cb50917"
},
"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=fffffffffffff"
},
"queryUrl":"https://data.oceannetworks.ca/api/scalardata?method=getByLocation&token=fffffffffffff&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"
}
]
} |
Anchor | ||||
---|---|---|---|---|
|
Expand | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns scalar data in JSON format by given station code and device category code. Parameters
ResponseSuccess
|
...
Success
Code Block | ||
---|---|---|
| ||
{
"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>,
"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>
},
...
]
} |
...
...
- next.parameters
...
...
- next.parameters.metadata
...
- next.parameters.method
...
- next.parameters.dateTo
...
"2015-02-25T00:00:01.000Z"
...
- next.parameters.rowLimit
...
- next.parameters.locationCode
...
- next.parameters.deviceCategoryCode
...
- next.parameters.dateFrom
...
"2015-02-25T00:00:01.189Z"
...
- next.parameters.outputFormat
...
- next.parameters.token
...
- next.url
...
"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=ffffffff-ffff-ffff-ffff-ffffffffffff"
...
"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=ffffffff-ffff-ffff-ffff-ffffffffffff"
...
- sensorData.data
...
- sensorData.data.qaqcFlags
...
QAQC test results of each data point–guidelines for what each number means:
- 0 No quality control on data
- 1 Data passed all tests
- 2 Data probably good
- 3 Data probably bad. Failed minor tests
- 4 Data bad. Failed major tests
- 7 Averaged value
- 8 Interpolated value
- 9 Missing data
...
- sensorData.data.sampleTimes
...
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
...
- sensorData.data.values
...
- sensorData.sensorCode
...
- sensorData.sensorName
...
"Uncompensated Borehole Pressure"
...
- sensorData.unitOfMeasure
...
"Gregorian days since 19700101T000000Z"
...
- metadata.boundingBox
...
- metadata.boundingBox.maxDepth
...
- metadata.boundingBox.maxLat
...
- metadata.boundingBox.maxLon
...
- metadata.boundingBox.minDepth
...
- metadata.boundingBox.minLat
...
- metadata.boundingBox.minLon
...
- metadata.depth
...
- metadata.deviceCategoryCode
...
- metadata.lat
...
- metadata.locationName
...
- metadata.lon
...
Note: Not all the properties above may be included in the resulting JSON, especially parameters that were not in the original call.
Example
Code Block | |||||||||
---|---|---|---|---|---|---|---|---|---|
{
"next":{
"parameters":{
"propertyCode":"totalpressure",
"method":"getByLocation"
|
Example with outputFormat option
Note: If the value is null, this may be displayed in the resulting JSON as a null.
Example | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Code Block | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{
"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":"c9ed940d-1c48-49ca-9bbd-1b126cb50917"
},
"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=fffffffffffff"
},
"queryUrl":" https://data.oceannetworks.ca/api/scalardata?method= getByLocationfffffffffffff&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" } ]ffffffff-ffff-ffff-ffff-ffffffffffff&station=SCHDW.O1&deviceCategory=OXYSENSOR
|