Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

As of January 2020 GLTG has 32,122,836 datapoints. 

Status
colourRed
titleWarning
 Please don't fetch all of them at once.

Table of Contents

Step 1: Create an Account 

Step 2: Acquire Data from API by using CURL

You can acquire the data from API by using curl command or python library (we provide the example in jupyter notebook in attached)

Using CURL

Get all Sensors in JSON format

Currently, pulling sensors does not require authentication.

InputsOutput typeOutput Example
url

JSON


Code Block
languagejs
titleOutput JSON example
collapsetrue
{ "sensors":[

         { "id":1445,
         "name":"03254520",
         "created":"2018-03-23T15:48:32Z",
         "geoType":"Feature",
         "geometry":{ "type":"Point",
                                 "coordinates":[ -84.44799549,38.9203417,0]
         },
         "properties":{ "name":"03254520",
                                 "huc":{ "huc8":{ "code":"05100101"},
                                              "huc2":{"code":"05" },
                                              "huc4":{"code":"0510"},
                                              "huc6":{"code":"051001"},
                                               "huc_name":"Licking"
                                            },
           "region":"0510",
           "location":"LICKING RIVER AT HWY 536 NEAR ALEXANDRIA, KY",
           "type":{ 
               "title":"United States Geological Survey",
               "network":"NWIS",
               "id":"usgs"
            },
            "popupContent":"03254520",
            "online_status":"online",
            "id":1445
         },
         "min_start_time":"2007-10-01T06:00:00Z",
         "max_end_time":"2020-02-05T12:30:00Z",
         "parameters":[ 
            "discharge-ft3s",
            "discharge-ft3s-qc",
            "dissolved-oxygen-mgl",
            "dissolved-oxygen-mgl-qc",
            "nitrate-nitrite-as-n-mgl",
            "nitrate-nitrite-as-n-mgl-qc",
            "pH",
            "pH-qc",
            "specific-conductance-uScm",
            "specific-conductance-uScm-qc",
            "turbidity-fnu",
            "turbidity-fnu-qc",
            "water-temperature-c",
            "water-temperature-c-qc"

            ],

            ....

    ]

}}



Code Block
titleGet all Sensors
curl -X GET --compressed https://greatlakestogulf.org/geostreams/api/sensors

Authenticate

InputsOutputDetails
  • url
  • email
  • password
X-Auth-TokenUse the token for fetching datapoints

...

Code Block
titleAuthenticate
curl -X POST -H 'Content-Type: application/json' -d '{"password": "****", "identifier": "email"}' --compressed -i https://greatlakestogulf.org/geostreams/api/authenticate

Get all Datapoints for Single Sensor

We request that a user not try to pull all datapoints concurrently.  It is preferred that datapoints be pulled in series by sensor id.

...