Description
Gets raw data from an instrument from a date, to a date, or between two given dates.
If no time is specified, the last hour of data will be returned for getByStation, or the data will be from the beginning of time to the present, subject to (default or otherwise) row and size limits (for getByDevice and getByLocation).
If time is specified, the data is limited to 100,000 rows.
URL
http://data.oceannetworks.ca/api/rawdata
Method | Description | Example |
---|---|---|
rawdata service#getByDevice | Retrieve raw data available for a given device within a time range | method=getByDevice |
rawdata service#getByLocation | Retrieve raw data for the specified location and date range. This method is replacing getByStation. | method=getByLocation |
Deprecated Methods | ||
rawdata service#getByStation | Retrieve raw data available at given station. This method is still available but is deprecated as of October 1, 2017 and has been replaced by the getByLocation method. | method=getByStation |
getByStation
getByDevice
Retrieve raw data for a given device. A date range is optional–if not specified, data from all time will be returned within (possibly default) row and size limits.
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=2010-07-27T00:00:00.000Z dateFrom=2010-07-27 dateFrom=-P1DT1H
|
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=2016-08-01T00:00:00.000Z dateTo=2016-08-01 dateTo=PT12H30M
|
rowLimit | Integer | The limit on the number of raw data readings to return. If not specified the row limit is 100,000. | rowLimit=300 |
sizeLimit | Integer | The limit on the size of raw data readings to return, specified in MB. If not specified the size limit is 250 MB. | sizeLimit=20 |
convertHexToDecimal | Boolean | Format of raw data readings. By default, binary data will be returned in decimal. When set to false, it will be returned in hexadecimal. | convertHexToDecimal=false |
outputFormat | String | There are two values:
| outputFormat=array 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 |
skipErrors | Boolean | On rare occasions, badly formatted data without a leading time stamp can be encountered. In these cases the rawdata service will return an error (see below). This option provides a way to skip these instances and return the data. skipErrors=true will return all correctly formatted raw data with timestamps skipErrors=false (default) will return error message when there are some badly formatted raw data within requested time range Example of error message in the return: { | skipErrors=true |
Response
Success (outputFormat = Array)
|
Property | Type | Description | Example |
---|---|---|---|
data | Object | An object containing the raw data readings and time stamps | |
| Array of Strings | An array of lineTypes, one for each reading in the requested date range. LineTypes are ">" for CommandSent, " " for DataReceived, and "<" for CommandResponse. | [" ",">","<"," "," "," "," ",">"] |
| Array of Strings OR Array of Integer Arrays | An array of readings one for each reading in the requested date range. If the raw data is text then this is an array of strings. If the raw data is binary then each item in the array is an array of integers. If conversion is turned off, array of hexadecimal strings returned. | Text:
Binary:
Binary: (convertHexToDecimal = false)
|
| Array of Strings | An array of timestamps one for each reading in the requested date range. Each timestamp is a string in ISO8601 (extended) format, yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. | [ "2014-04-25T00:00:00.005Z" ] |
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 plus dateFrom if dateFrom hadn't been specified. | "parameters": { "method": "getByDevice", "rowLimit": "1", |
| String | As passed into the original call | "YOUR_TOKEN_HERE" |
| String | getByDevice, as passed into the original call. | "getByDevice" |
| String | As passed into the original call | "SBECTD19p7128" |
| String | This is set to 1 millisecond more than the date of the last reading sent in the current call. | "2014-04-25T00:00:00.006Z" |
| String | Any optional parameters passed into the original call. | "dateTo":"2014-04-25T00:00:00.001Z", "rowLimit":"5", "outputFormat": "array" |
| String | The complete URL that can be used to get the next set of data in the requested range. | "https://data.oceannetworks.ca/api/rawdata?method=getByDevice&dateTo=2014-04-25T00%3A00%3A00.001Z&deviceCode=SBECTD16p6934&rowLimit=5&dateFrom=2014-04-24T23%3A51%3A00.003Z&token=YOUR_TOKEN_HERE" |
queryUrl | String | The complete URL for the current call. | "https://data.oceannetworks.ca/api/rawdata?method=getByDevice&token=YOUR_TOKEN_HERE&deviceCode=BARIX001&dateFrom=2017-06-08T00:00:00.000Z&dateTo=2017-06-08T00:00:00.010Z" |
Success (outputFormat = Object)
|
Property | Type | Description | Example |
---|---|---|---|
data | Array of Objects | An array containing the raw data readings and time stamps | |
| Strings | A lineType. LineTypes are ">" for CommandSent, " " for DataReceived, and "<" for CommandResponse. | ">" |
| String OR Integer Array | A single raw data reading. If the raw data is text then this is a string. If the raw data is binary then this is an array of integers. If conversion is turned off, a hexadecimal string is returned. | Text:
Binary:
Binary: (convertHexToDecimal = false)
|
| String | A timestamp. Each timestamp is a string in ISO8601 (extended) format, yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. | "2014-04-25T00:00:00.005Z" |
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 plus dateFrom if dateFrom hadn't been specified. | "parameters": { "method": "getByDevice", "rowLimit": "1", |
| String | As passed into the original call | "YOUR_TOKEN_HERE" |
| String | getByDevice, as passed into the original call. | "getByDevice" |
| String | As passed into the original call | "SBECTD19p7128" |
| String | This is set to 1 millisecond more than the date of the last reading sent in the current call. | "2014-04-25T00:00:00.006Z" |
| String | Any optional parameters passed into the original call. | "dateTo":"2014-04-25T00:00:00.001Z", "rowLimit":"5", "outputFormat": "object" |
| String | The complete URL that can be used to get the next set of data in the requested range. | "https://data.oceannetworks.ca/api/rawdata?method=getByDevice&dateTo=2014-04-25T00%3A00%3A00.001Z&deviceCode=SBECTD16p6934&rowLimit=5&dateFrom=2014-04-24T23%3A51%3A00.003Z&token=YOUR_TOKEN_HERE" |
queryUrl | String | The complete URL for the current call. | "https://data.oceannetworks.ca/api/rawdata?method=getByDevice&token=YOUR_TOKEN_HERE&deviceCode=BARIX001&dateFrom=2017-06-08T00:00:00.000Z&dateTo=2017-06-08T00:00:00.010Z" |
Example Service Call
|
Example Service Call with outputFormat parameter
|
getByLocation
Retrieve the raw data at a given location for the given device category. A date range is optional–when not specified, data from all time will be returned within (possibly default) row and size limits.
Parameters
Parameter | Type | Description | Example |
---|---|---|---|
Required | |||
token | String | All Web Services require a token. This can be generated at http://data.oceannetworks.ca/Profile. Click on the "Web Services" tab and click "Generate Token". | token=YOUR_TOKEN_HERE |
locationCode | String | Return raw data from a specific Location.
| locationCode=SCVIP |
deviceCategoryCode | String | Return raw data belonging to a specific Device Category Code.
| deviceCategoryCode=CTD |
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=2010-07-27T00:00:00.000Z dateFrom=2010-07-27 dateFrom=-P1DT1H
|
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=2016-08-01T00:00:00.000Z dateTo=2016-08-01 dateTo=PT12H30M
|
rowLimit | Integer | The limit on the number of raw data readings to return. If not specified the row limit is 100,000. | rowLimit=300 |
sizeLimit | Integer | The limit on the size of raw data readings to return specified in MB. If not specified the size limit is 250 MB. | sizeLimit=20 |
outputFormat | String | Array (default or if missing) (case insensitive) Object (case insensitive) | outputFormat= array 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 |
skipErrors | Boolean | On rare occasions, badly formatted data without a leading time stamp can be encountered. In these cases the rawdata service will return an error (see below). This option provides a way to skip these instances and return the data. skipErrors=true will return all correctly formatted raw data with timestamps skipErrors=false (default) will return error message when there are some badly formatted raw data within requested time range Example of error message in the return: { | skipErrors=true |
Response
Success (outputFormat = Array)
|
Property | Type | Description | Example |
---|---|---|---|
data | Object | An object containing the raw data readings and time stamps | |
| Array of Strings | An array of lineTypes, one for each reading in the requested date range. LineTypes are ">" for CommandSent, " " for DataReceived, and "<" for CommandResponse. | [" "," "," "," "," "," "," "," "] |
| Array of Strings OR Array of Integer Arrays | An array of readings one for each reading in the requested date range. If the raw data is text then this is an array of strings. If the raw data is binary then each item in the array is an array of integers. | Text:
Binary:
|
| Array of Strings | An array of timestamps one for each reading in the requested date range. Each timestamp is a string in ISO8601 (extended) format, yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. | [ "2014-04-25T00:00:00.005Z" ] |
metadata | Object | An object containing metadata items. | |
| String | The name of the location for the requested location code. | "Strait of Georgia VENUS Instrument Platform" |
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 plus dateFrom if dateFrom hadn't been specified. | "parameters": { "method": "getByLocation", "rowLimit": "1", "locationCode": "SCVIP", "deviceCategoryCode": "CURRENTMETER", "dateFrom": "2014-04-25T00:00:00.006Z", "token": "YOUR_TOKEN_HERE" }, |
| String | As passed into the original call | "YOUR_TOKEN_HERE" |
| String | getByLocation, as passed into the original call. | "getByLocation" |
| String | As passed into the original call | "SCVIP" |
| String | As passed into the original call | "CURRENTMETER" |
| String | This is set to 1 millisecond more than the date of the last reading returned in the current call. | "2014-04-25T00:00:00.006Z" |
| String | Any optional parameters passed into the original call. | "dateTo":"2009-08-15T17:50:00.000Z", "rowLimit": "1", "outputFormat": "object" |
| String | The complete URL that can be used to get the next set of data in the requested range. | https://data.oceannetworks.ca/api/rawdata? |
queryUrl | String | The complete URL for the current call. | "https://data.oceannetworks.ca/api/rawdata?method=getByLocation&locationCode=NCBC&deviceCategoryCode=BPR&dateFrom=2009-07-24T17:50:00.000Z&rowLimit=5&token=YOUR_TOKEN_HERE" |
Success (outputFormat = Object)
|
Property | Type | Description | Example |
---|---|---|---|
data | Array of Objects | An array containing the raw data readings and time stamps | |
| String | A lineType. LineTypes are ">" for CommandSent, " " for DataReceived, and "<" for CommandResponse. | ">" |
| String OR Integer Array | A single raw data reading. If the raw data is text then this is a string. If the raw data is binary then this is an array of integers. If conversion is turned off, a hexadecimal string is returned. | Text:
Binary:
Binary: (convertHexToDecimal = false)
|
| String | A timestamp. Each timestamp is a string in ISO8601 (extended) format, yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. | "2014-04-25T00:00:00.005Z" |
metadata | Object | An object containing metadata items. | |
| String | The name of the location for the requested location code. | "Strait of Georgia VENUS Instrument Platform" |
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 plus dateFrom if dateFrom hadn't been specified. | "parameters": { "method": "getByLocation", "rowLimit": "1", "locationCode": "SCVIP", "deviceCategoryCode": "CURRENTMETER", "dateFrom": "2014-04-25T00:00:00.006Z", "token": "YOUR_TOKEN_HERE" }, |
| String | As passed into the original call | "YOUR_TOKEN_HERE" |
| String | getByLocation, as passed into the original call. | "getByLocation" |
| String | As passed into the original call | "SCVIP" |
| String | As passed into the original call | "CURRENTMETER" |
| String | This is set to 1 millisecond more than the date of the last reading returned in the current call. | "2014-04-25T00:00:00.006Z" |
| String | Any optional parameters passed into the original call. | "dateTo":"2009-08-15T17:50:00.000Z", "rowLimit": "1", "outputFormat": "object" |
| String | The complete URL that can be used to get the next set of data in the requested range. | https://data.oceannetworks.ca/api/rawdata? |
queryUrl | String | The complete URL for the current call. | "https://data.oceannetworks.ca/api/rawdata?method=getByLocation&locationCode=NCBC&deviceCategoryCode=BPR&dateFrom=2009-07-24T17:50:00.000Z&rowLimit=5&token=YOUR_TOKEN_HERE" |
Examples
Get 5 raw data readings for BPR data from Barkley Canyon Upper Slope (NCBC):
|
Get 1 raw data reading for Current Meter (CURRENTMETER) data from Strait of Georgia VENUS Instrument Platform (SCVIP):
|