Blue Water - Data Insights for Water Management - Accessing Water Data
Code Sample
See sample code in Java (on GitHub) on how to use the APIs:
https://github.com/sandeep-iitr/BlueWater_REST_API_DEMO
Docs
See slides (35-41) in the "AI for Water" tutorial.
API Methods
- Generating the license key to use the API.
Go to the below URL, and fill details to generate license key.
https://bluewater.mybluemix.net/license.jsp
- General query (gives the metadata)
Purpose |
Get the metadata about the data available in the database |
URL |
https://bluewater.mybluemix.net/query |
Sample URL |
https://bluewater.mybluemix.net/query |
Format |
JSON |
Required API Keys |
No |
Sample output
[ |
- Get water quality data within the given range (in metres) around the given latitude longitude
Purpose |
Get water quality data within the given range around the given latitude longitude |
URL |
https://bluewater.mybluemix.net/query?Latitude=lat&Longitude=lon&Range=range&Lic=key |
Sample URL |
https://bluewater.mybluemix.net/query?Latitude=29.70&Longitude=77.56&Range=10&Lic=xxx |
Format |
JSON |
Required API Keys |
Yes |
Arguments
Field Name |
Description |
Latitude |
Latitude near which you need the data |
Longitude |
Longitude near which you need the data |
Range |
Distance from the give latitude and longitude for which you want water quality data |
Lic |
API key (Replace the key with the key provided to you) |
Sample output
|
Possible Errors
- Code 1- Wrong values for parameters.
- Code 2- Inadequate number of parameters.
- Code 3- License key not valid.
4. Get water quality data between a period of time (Input as unix timestamps)
Purpose |
Get water quality data between the period of time specified by unix timestamp |
URL |
https://bluewater.mybluemix.net/query Time_1=time&Time_2=time&Lic=xxx |
Sample URL |
https://bluewater.mybluemix.net/query?Time_1=1456566092&Time_2=1457689451&Lic=xxx |
Format |
JSON |
Required API Keys |
Yes |
Arguments
Field Name |
Description |
Time_1 |
Starting time from which you want data |
Time_2 |
Ending time till which you want data (both in Unix timestamp format) |
Lic |
API key (Replace the key with the key provided to you) |
Possible Errors
- Code 1- Wrong values for parameters.
- Code 2- Inadequate number of parameters.
- Code 3- License key not valid.
5. Get water quality data between a period of time (Input as date (date format- yyyy-mm-dd))
Purpose |
Get water quality data between the period of time specified by two dates |
URL |
https://bluewater.mybluemix.net/query Date_1=date&Date_2=date&Lic=xxx |
Sample URL |
https://bluewater.mybluemix.net/query Date_1=2016-02-27&Date_2=2016-02-30&Lic=xxx |
Format |
JSON |
Required API Keys |
Yes |
Arguments
Date_1 |
Starting date from which you want data |
Date_2 |
Ending date till which you want data |
Lic |
API key (Replace the key with the key provided to you) |
Possible Errors
- Code 1- Wrong values for parameters
- Code 2- Inadequate number of parameters
- Code 3- License key not valid
6. Get water quality data between a period of time and within the given range around the given latitude longitude
Purpose |
Get water quality data between the period of time specified by Unix timestamp and within the given range around the given latitude longitude |
URL |
https://bluewater.mybluemix.net/query?Latitude=lat&Longitude=lon&Range=ran&Time_1=time&Time_2=time&Lic=xxx |
Sample URL |
https://bluewater.mybluemix.net/query?Latitude=29.70&Longitude=77.56&Range=10&Time_1=1456566092&Time_2=1457689451&Lic=xxx |
Format |
JSON |
Required API Keys |
Yes |
Arguments
Field Name |
Description |
Latitude |
Latitude near which you need the data |
Longitude |
Longitude near which you need the data |
Range |
Distance from the give latitude and longitude for which you want water quality data |
Time_1 |
Starting time from which you want data |
Time_2 |
Ending time till which you want data |
Lic |
API key (Replace the key with the key provided to you) |
Possible Errors
- Code 1- Wrong values for parameters
- Code 2- Inadequate number of parameters
- Code 3- License key not valid
7. Get water quality data between a the dates and within the given range around the given latitude longitude
Purpose |
Get water quality data between the period of time specified by date (date format- yyyy-mm-dd) and within the given range around the given latitude longitude |
URL |
https://bluewater.mybluemix.net/query?Latitude=lat&Longitude=lon&Range=range&Date_1=date&Date_2=date&Lic=xxx |
Sample URL |
https://bluewater.mybluemix.net/query?Latitude=29.70&Longitude=77.56&Range=10&Date_1=2016-02-27&Date_2=2016-02-30&Lic=xxx |
Format |
JSON |
Required API Keys |
Yes |
Arguments
Field Name |
Description |
Latitude |
Latitude near which you need the data |
Longitude |
Longitude near which you need the data |
Range |
Distance from the give latitude and longitude for which you want water quality data |
Date_1 |
Starting date from which you want data |
Date_2 |
Ending date till which you want data |
Lic |
API key (Replace the key with the key provided to you) |
Possible Errors
- Code 1- Wrong values for parameters
- Code 2- Inadequate number of parameters
- Code 3- License key not valid
Tutorial: AI for Data-Driven Decisions in Water Management
We will be giving a tutorial, titled AI for Data-Driven Decisions in Water Management, at the premier AAAI conference in Feb 2017 at San Francisco, CA, USA. Details: see site.