If you are a Python, MATLAB or R programmer, you can quickly start using the Oceans 3.0 API, by taking advantage of our client libraries. This guide will take you step-by-step through getting setup, writing code and retrieving data.
1. Choose your Language
- All code samples and client libraries are available in Python, MATLAB and R; however, any programming language that can make HTTP GET requests can be used, along with the API Reference to make requests and download data using the ONC web services.
3. Discover your Data
- Use the Discovery services to find your data
- Use the getLocations() function to find locations by code, name, device category, device, data product and deployment date range.
- Use the getDevices() function to find devices by code, name, location, device category, property data product and deployment date range.
- Use the getDeployments() function to find device deployments by location code, device code, device category code, property code and deployment date range.
- Use the getDeviceCategories() function to find device categories by code, name, description, location, device and property.
- Use the getProperties() function to find properties by code, name, description, location, device category and device.
- Use the getDataProducts() function to find data products and extensions, by code, extension, name, location, device category, device and property.
- Use the following pages for valid codes that can be used as filters in both the discovery and delivery services
- Use the Discovery services to find your data
4. Download your Data
- Decide how you want to retrieve your data
- Do you want a data product?
- If so, use the orderDataProduct() function
- Figure out what data product options to include using the Data Products documentation
- Pass the filter criteria identified in #3 into the function
- For Site Device data request include locationCode and deviceCategoryCode
- For Primary Sensor level data request include locationCode and propertyCode
- For Sensor Level data request include locationCode, deviceCategoryCode and propertyCode
- For Device (all properties) data request use deviceCode
- For Device Property data request use deviceCode and deviceCategoryCode
- Include dateFrom and dateTo
- Include dataProductCode, extension and appropriate data product options
- If so, use the orderDataProduct() function
- Do you want a data product?
- Decide how you want to retrieve your data
- Do you want a small amount of scalar data in near real-time?
- if so, use the getDirectScalar() function
- Pass the filter criteria identified in #3 into the function
- Include locationCode, deviceCategoryCode
- Include dateFrom and dateTo
- Pass the filter criteria identified in #3 into the function
- if so, use the getDirectScalar() function
- Do you want a small amount of scalar data in near real-time?
- Do you want to raw data directly from the instrument?
- if so, use the getDirectRaw() function
- Pass the filter criteria identified in #3 into the function
- Include locationCode, deviceCategoryCode
- Include dateFrom and dateTo
- Do you want to raw data directly from the instrument?
- Execute a data request.
- Do something with the results.
- Execute a data request.