Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added getByLocation

...

No Format
https://data.oceannetworks.ca/api/scalardata


MethodDescriptionExample
getByStationreturns scalar data by given station code and device categorymethod=getByStation
getByLocationreturns scalar data by given location code and device category codemethod=getByStationgetByLocation


Anchor
getByCodes
getByCodes
getByStation

...

ParameterTypeDescriptionExample
Required
tokenstringcredential token. 
stationstringthe code of a station (For a list of stations see stations)NCBC
deviceCategorystringthe code of a device category (For a list of device categories for stations see  stations)BPR
Optional
sensorsstringa comma separated list of sensor codes for a station and device category. If missing, the system will return all search scalar data within to station code and device category code pair. pressure,temperature
dateFromdateinclusive start date in "yyyy-MM-ddTHH:mm:ss.SSSZ" format. If missing, the system will return last reading.2015-05-25T00:00:00.000Z
dateTodateexclusive end date in "yyyy-MM-ddTHH:mm:ss.SSSZ" format. If missing the system will use 1 day range.2015-05-26T00:00:00.000Z
metadataString (case insensitive)

Minimum default
Provides only basic property information

Full 
Provides all property information

Minimum
outputFormatString (case insensitive)

Object – default

Data will be output as a list of objects for a given sensor. Inside each data object, there are sampleTime, value, and qaqcFlag

Array 
Data will be out put as three arrays for a given sensor. Array of sampleTime, array of values, array of qaqcFlags

Object
rowLimitintegerMaximum number of rows of scalar data returned for each sensor code. Default is 100,000. Maximum is 100,000.80000

...

Code Block
titleScalar Data Response
{
	"serviceMetadata": {
    	"station": string,
        "deviceCategory": string,
		"sensors": string,
		"dateFrom": string,
        "dateTo": string,
        "metadata": string,
        "rowLimit": string,
		"outputFormat": stirng,
		"totalActualSamples": integer,
		"nextDateFrom": string
	},
    "metadata": {
        "stationName": string,
        "deviceCategoryName": string,
        "dateFrom": string,
        "dateTo": string,
        "longitude": double,
        "latitude": double,
        "depth": double,
        "bbox": {
			"minLon": double,
			"maxLon": double,
			"minLat": double,
			"maxLat": double,
			"minDepth": double,
			"maxDepth": double
		}
	},
	"sensorData": [
		{
			"sensor": string,
            "sensorName": string,
            "unitOfMeasure": string,
			"actualSamples"" integer,
			"data": [//outputFormat=object
				{
					"sampleTime": string,
					"value": double,
	   				"qaqcFlag": integer
	 			},
				...
			"data": [//outputFormat=array
				{
					"sampleTimes": [array of strings],
					"values": [array of doubles],
	   				"qaqcFlags": [array of integers]
	 			},
				...
			]
		},
		...
	]
}

...

https://data.oceannetworks.ca/api/scalardata?method=getByStation&token=a3079716-7d07-4d4a-bb5d-e521ad60b784YOUR_TOKEN&station=SCHDW.O1&deviceCategory=OXYSENSOR&sensors=oxygen_corrected

...

Code Block
titleJson response
{
	"sensorData": [{
		"actualSamples": 1,
		"data": [{
			"qaqcFlag": 1,
			"sampleTime": "2015-12-08T18:52:35.089Z",
			"value": 2.42722139
		}],
		"sensor": "oxygen",
		"sensorName": "Oxygen",
		"unitOfMeasure": "ml/l"
	}],
	"serviceMetadata": {
		"dateFrom": null,
		"dateTo": null,
		"deviceCategory": "OXYSENSOR",
		"nextDateFrom": null,
		"outputFormat": null,
		"rowLimit": null,
		"sensors": "oxygen",
		"station": "SCHDW.O1",
		"totalActualSamples": 1
	}
}

 

Anchor
getByLocation
getByLocation
getByLocation

Returns scalar data in JSON format by given location code and device category code.

Parameters

ParameterTypeDescriptionExample
Required
tokenstringcredential token in GUID formatffffffff-ffff-ffff-ffff-ffffffffffff
locationCodestringthe code of a locationKVIP.C2
deviceCategoryCodestringthe code of a device categoryBPR
Optional
propertyCodeStringthe code of a propertyseawatertemperature
dateFromdateinclusive start date in "yyyy-MM-ddTHH:mm:ss.SSSZ" format. If missing, the system will return last reading.2015-05-25T00:00:00.000Z
dateTodateexclusive end date in "yyyy-MM-ddTHH:mm:ss.SSSZ" format. If missing the system will use 1 day range.2015-05-26T20:01:23.456Z
metadataString

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

Minimum
rowLimitintegermaximum 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


Response

Success

Code Block
languagejs
{
	"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')>,
			"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>
		},
		...
	]
}


PropertyTypeDescriptionExample
nextObjectAn 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.
 
  • next.parameters
ObjectAn 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.
 
    • next.parameters.metadata
StringAs passed into the original call"minimum"
    • next.parameters.method
StringgetByLocation, as passed into the original call."getByLocation"
    • next.parameters.dateTo
StringAs passed into the original call
"2015-02-25T00:00:01.000Z"
    • next.parameters.rowLimit
StringAs passed into the original call"10"
    • next.parameters.locationCode
StringAs passed into the original call"NC27"
    • next.parameters.deviceCategoryCode
StringAs passed into the original call"CORK"
    • next.parameters.dateFrom
StringThis is set to 1 millisecond more than the date of the last reading sent in the current call.
"2015-02-25T00:00:01.189Z"
    • next.parameters.token
StringAs passed into the original call"ffffffff-ffff-ffff-ffff-ffffffffffff"
  • next.url
StringThe 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"
queryUrlStringURL 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"
sensorDataArray of objectsData sets returned for all applicable sensors 
  • sensorData.data
ObjectData sets returned for a single sensor 
    • sensorData.data.qaqcFlags
Array of integers

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
[1]
    • sensorData.data.sampleTimes
Array of stringsSampling times of sensor data returned, formatted as
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
["2015-02-25T00:00:00.188Z"]
    • sensorData.data.values
Array of doublesValues of sensor data returned, units of measurement are given in sensorData.unitOfMeasure[2706.1145305467917]
  • sensorData.sensorCode
StringCode of sensor, can be null"sigmaT"
  • sensorData.sensorName
StringName that denotes what the sensor measures
"Uncompensated Borehole Pressure"
  • sensorData.unitOfMeasure
StringUnit of measurement or "NA" if none apply; temperature units of measure are "C" for degrees Celsius
"Gregorian days since 19700101T000000Z"
metadataObjectOptional; only returned if the metadata parameter is set to full 
  • metadata.boundingBox
ObjectBounding limits statistics 
    • metadata.boundingBox.maxDepth
DoubleMaximum depth in meters below water surface (negative numbers denote above)982.0
    • metadata.boundingBox.maxLat
DoubleMaximum latitude in degrees north of the equator (negative numbers denote south)48.316583
    • metadata.boundingBox.maxLon
DoubleMaximum longitude in degrees east of the prime meridian (negative numbers denote west)-126.050796
    • metadata.boundingBox.minDepth
DoubleMinimum depth in meters below water surface (negative numbers denote above)982.0
    • metadata.boundingBox.minLat
DoubleMinimum latitude in degrees north of the equator (negative numbers denote south)48.316583
    • metadata.boundingBox.minLon
DoubleMinimum longitude in degrees east of the prime meridian (negative numbers denote west)-126.050796
  • metadata.depth
DoubleDepth in meters below water surface (negative numbers denote above)2660.5
  • metadata.deviceCategoryCode
StringShould be the same as next.parameters.deviceCategoryCode"CORK"
  • metadata.lat
DoubleLatitude in degrees north of the equator (negative numbers denote south)47.7626
  • metadata.locationName
StringName of location"ODP 1026"
  • metadata.lon
DoubleLongitude 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.

Failure

See scalardata service

Example

https://data.oceannetworks.ca/api/scalardata?method=getByLocation&token=YOUR_TOKEN&locationCode=NC27&deviceCategoryCode=CORK&dateFrom=2015-02-25T00:00:00.000Z&dateTo=2015-02-25T00:00:01.000Z

Code Block
{"next":{"parameters":{"method":"getByLocation","dateTo":"2015-02-25T00:00:01.000Z","locationCode":"NC27","deviceCategoryCode":"CORK","dateFrom":"2015-02-25T00:00:01.189Z","token":"YOUR_TOKEN"},"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=YOUR_TOKEN"},"queryUrl":"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=c9ed940d-1c48-49ca-9bbd-1b126cb50917","sensorData":[{"data":{"qaqcFlags":[1],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[2705.9145624950315]},"sensorCode":null,"sensorName":"Uncompensated Borehole Pressure","unitOfMeasure":"decibar"},{"data":{"qaqcFlags":[0],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[15044.155636574074]},"sensorCode":null,"sensorName":"Instrument Clock","unitOfMeasure":"Gregorian days since 19700101T000000Z"},{"data":{"qaqcFlags":[0],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[15044.157647118056]},"sensorCode":null,"sensorName":"Corrected Instrument Clock","unitOfMeasure":"Gregorian days since 19700101T000000Z"},{"data":{"qaqcFlags":[1],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[0.0731633552918538]},"sensorCode":null,"sensorName":"DART Pressure Residual","unitOfMeasure":"decibar"},{"data":{"qaqcFlags":[0],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[0.12011008833997039]},"sensorCode":null,"sensorName":"Detider Peak Value","unitOfMeasure":"NA"},{"data":{"qaqcFlags":[0],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[0.0]},"sensorCode":null,"sensorName":"Direct Detider Weighted Threshold","unitOfMeasure":"NA"},{"data":{"qaqcFlags":[0],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[0.0]},"sensorCode":null,"sensorName":"Kurtosis Weighted Threshold","unitOfMeasure":"NA"},{"data":{"qaqcFlags":[1],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[2706.1145305467917]},"sensorCode":null,"sensorName":"Uncompensated Seafloor Pressure","unitOfMeasure":"decibar"},{"data":{"qaqcFlags":[0],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[-0.0021135619302466158]},"sensorCode":null,"sensorName":"Seismic Detector","unitOfMeasure":"NA"},{"data":{"qaqcFlags":[1],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[1.804350543379081]},"sensorCode":null,"sensorName":"Housing Temperature","unitOfMeasure":"C"},{"data":{"qaqcFlags":[0],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[3.0629564319830638]},"sensorCode":null,"sensorName":"WARN Kurtosis","unitOfMeasure":"NA"},{"data":{"qaqcFlags":[0],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[1.5]},"sensorCode":null,"sensorName":"WARN Watcher","unitOfMeasure":"NA"},{"data":{"qaqcFlags":[0],"sampleTimes":["2015-02-25T00:00:00.188Z"],"values":[1.0]},"sensorCode":null,"sensorName":"WARN Watcher Weighted Threshold","unitOfMeasure":"NA"}]}