The OOI Machine-to-Machine (M2M) interface provides programmatic access to OOI data via a RESTful Application Programming Interface (API). This interface allows authenticated users to request small amounts of data via synchronous JSON requests, request larger amounts of data in NetCDF or CSV format in order to download multiple data streams or data from multiple platforms, or set up recurring downloads to procedurally update an existing dataset. Additional commands allow for searches of the asset management system to find deployment, calibration, quality control (QC) parameters, annotations, and other information, both in bulk and for specific instruments or platforms.
Full documentation of the M2M system is underway, but there are several existing “Community Tools” resources to assist in getting started using the API. The links below use some of the Cabled Array instruments as examples, but they include some step by step instructions and sample code that can be modified to request the data you are interested in. We recommend familiarizing yourself with OOI terminology and data structure using the OOI Knowledge Base and the additional resources at the bottom of this page before you dive into the M2M system.
OOI Machine to Machine (M2M) Demo Workbooks
The following ipython notebooks include examples for how to use python’s requests library to access data from the OOI M2M web service.Basic M2M Examples JSON Requests NetCDF Requests Real-Time Requests
Getting Started – Obtaining User Login Information
- Create a user account on ooinet.oceanobservatories.org, or use the CILogon button with an academic or Google account.
- Log in
- Navigate to the drop down menu screen in the top-right corner menu
- Click on the “User Profile” element of the drop down.
- Copy and save the following data from the user profile: API Username and API Token.
Tools to access OOI M2M Web Services
Here is a quick rundown on how to access the OOI M2M via some common coding tools.
python (using the Requests library)
requests.get('https://ooinet.oceanobservatories.org/api/m2m/...', auth=(API_USERNAME, API_TOKEN))
urlread('https://ooinet.oceanobservatories.org/api/m2m/...', 'Authentication', 'Basic', 'Username', API_USERNAME, 'Password', API_TOKEN);
curl –k https://API_USERNAME:API_TOKEN@ooinet.oceanobservatories.org/api/m2m/...
http --auth API_USERNAME:API_TOKEN https://ooinet.oceanobservatories.org/api/m2m/...
- Data Team QC Database http://ooi.visualocean.net
- Data Portal https://ooinet.oceanobservatories.org
- Sampling Strategy http://oceanobservatories.org/observation-and-sampling-approach
- Data Product Specifications http://oceanobservatories.org/technical-data-package
- Data Product Algorithms https://github.com/oceanobservatories/ion-functions/tree/master/ion_functions/data
For additional help using the interface, if you encounter errors, or if you have suggestions, please contact the OOI Help Desk.
We will also be holding instructional webinars and posting additional guides and video tutorials in the Knowledge Base as they become available.