Quick Start

If you don’t already have curl, install it to follow along below. If you are programming in Python, check out our Python client library to get started. You can also view some code snippets on our examples page on GitHub.

Insight API uses basic authentication. To get a user and password, sign up for a demo at the Skywise Marketplace.

Note: Application ID == username, and Application Key == password.

Point Data

Let’s get the high temperature forecast for Norman, OK.

$ curl -X GET "https://insight.api.wdtinc.com/daily-high-temperature/35.191/-97.439" \
  -H "Accept: application/vnd.wdt+json; version=1" \
  --user <username>:<password>

Create Asset

That was easy, but the best part of Insight-API is it’s use of boundaries to retrieve specific meteorological data. So lets create an asset, and get to it. When creating an asset, you must submit valid GeoJSON. To draw an asset boundary, lets use geojson.io. Copy the json you created and use it as the “body” of the request like below.

$ curl -X POST "https://insight.api.wdtinc.com/assets" \
  -H "Accept: application/vnd.wdt+json; version=1" \
  -H "Content-Type: application/json" \
  -d '{
       "type": "FeatureCollection",
       "features": [
         {
           "type": "Feature",
           "properties": {"Ex. Tag 1": "WDT Offices",
                          "Ex. Tag 2": "City of Norman"},
           "geometry": {
             "type": "Polygon",
             "coordinates": [
             [
               [
                 -97.49027252197266,
                 35.17436958581184
               ],
               [
                 -97.49027252197266,
                 35.25655344114116
               ],
               [
                 -97.38899230957031,
                 35.25655344114116
               ],
               [
                 -97.38899230957031,
                 35.17436958581184
               ],
               [
                 -97.49027252197266,
                 35.17436958581184
               ]
             ]
             ]
           }
       }]}' \
 --user <username>:<password>

You’ll see something output like...

HTTP/1.1 201 Created
{
  "type": "GeometryCollection",
  "centroid": {
    "latitude": 35.2154615135,
    "longitude": -97.4396324158
  },
  "id": "b17a4230-5b28-11e6-8516-9801a78e45d7",
  "geometries": [
    {
      "type": "MultiPolygon",
      "coordinates": [
        [
          [
            [
              -97.490272522,
              35.1743695858
            ],
            [
              -97.490272522,
              35.2565534411
            ],
            [
              -97.3889923096,
              35.2565534411
            ],
            [
              -97.3889923096,
              35.1743695858
            ],
            [
              -97.490272522,
              35.1743695858
            ]
          ]
        ]
      ]
    }
  ],
  "description": {
    "Ex. Tag 2": "City of Norman",
    "Ex. Tag 1": "WDT Offices"
  }
}

Make Asset Call

We can now use the “id” of the asset we created to make calls for data. This time lets try and get daily precipitation forecast for our “City of Norman” asset.

$ curl -X GET "https://insight.api.wdtinc.com/daily-precipitation/b17a4230-5b28-11e6-8516-9801a78e45d7" \
  -H "Accept: application/vnd.wdt+json; version=1" \
  --user <username>:<password>

You should get a response similar to...

HTTP/1.1 200 OK
{
  "asset": "/assets/b17a4230-5b28-11e6-8516-9801a78e45d7",
  "startDate": "2015-06-01",
  "endDate": "2015-06-03",
  "precipitation": 22.5,
  "accumulationStatistics": {
     "mean": 21.5,
     "maximum": 27.6,
     "minimum": 19.4
  },
  "unit": {
    "description": "millimeters",
    "label": "mm"
  },
  "contours": "/daily-precipitation/b17a4230-5b28-11e6-8516-9801a78e45d7/contours?start=2015-06-01&end=2015-06-03",
  "series": [
    {
      "validDate": "2015-06-01",
      "value": 11.25,
      "contours": "/daily-precipitation/b17a4230-5b28-11e6-8516-9801a78e45d7/contours?start=2015-06-01&end=2015-06-01",
      "assetStatistics": {
        "mean": 10.2,
        "maximum": 11.5,
        "minimum": 9.6
      },
      "products": [
        "skywise-24hr-precipitation-analysis"
      ]
    },
    {
      "validDate": "2015-06-02",
      "value": 11.0,
      "contours": "/daily-precipitation/b17a4230-5b28-11e6-8516-9801a78e45d7/contours?start=2015-06-02&end=2015-06-02",
      "assetStatistics": {
        "mean": 10.5,
        "maximum": 11.7,
        "minimum": 9.4
      },
      "products": [
        "skywise-24hr-precipitation-analysis"
      ]
    },
    {
      "validDate": "2015-06-03",
      "value": 10.0,
      "contours": "/daily-precipitation/b17a4230-5b28-11e6-8516-9801a78e45d7/contours?start=2015-06-03&end=2015-06-03",
      "assetStatistics": {
        "mean": 10.6,
        "maximum": 12.5,
        "minimum": 8.6
      },
      "products": [
        "skywise-24hr-precipitation-analysis"
      ]
    }
  ]
}

Contoured Data for Asset

We can also get the forecast precipitation accumulated and contoured in geojson format.

$ curl -X GET "https://insight.api.wdtinc.com/daily-precipitation/b17a4230-5b28-11e6-8516-9801a78e45d7/contours" \
  -H "Accept: application/vnd.wdt+json; version=1" \
  --user <username>:<password>

Which should return a geojson of the contours similar to...

HTTP/1.1 200 OK
{
  "asset": "/assets/b17a4230-5b28-11e6-8516-9801a78e45d7",
  "startDate": "2015-06-01",
  "endDate": "2015-06-03",
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [ [-102.3555, 39.8420], [-99.8945, 39.8420], ... ]
        ]
      },
      "properties": {
        "precipitation": 76.2
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [ [-102.3555, 39.8420], [-99.8945, 39.8420], ... ]
        ]
      },
      "properties": {
        "precipitation": 50.8
      }
    }
  ],
  "unit": {
    "description": "millimeters",
    "label": "mm"
  },
}