Weather Forecast API

API provides weather forecast for 3 days at a 3-hour interval for certain area. It’s based on HTTP requests sent to the server, the response format is JSON. The area of interest is set via geojson notation in the body of request, or via an area identifier received from Cropper API.

POST /api/forecast/weather/?api_key=<API_KEY>
JSON Parameters:
 
  • polygon_id – resourse id of a GeoJSON representation of a geometry saved into data base using Cropper API, string
  • geometry – geojson geometry, object
  • full – optional, send full forecast: 180 hours instead of 72, bool

Important!!! It’s required to specify one of the parameters (polygon_id or geometry). If both parameters are specified, geometry is the prevailing one. If none of the parameters are specified, an error will be returned - “Geometry or polygon_id are required.”.

Examples

Example request:

http

POST /api/forecast/weather/?api_key=XXX HTTP/1.1
Host: gate.eos.com
Content-Type: application/json

    {
       "polygon_id": "0dgf09gmudf0gudgdf",
       "geometry":{
              "type":"Polygon",
              "coordinates":[[
                            [30.43212890625, 49.03786794532644],
                            [29.9267578125, 47.84265762816538],
                            [32.54150390625, 46.965259400349275],
                            [32.67333984375, 49.13859653703879],
                            [30.43212890625, 49.03786794532644]
                     ]]
       }
    }

curl

curl -i -X POST 'https://gate.eos.com/api/forecast/weather/?api_key=XXX' -H 'Content-Type: application/json' --data-raw '{"geometry": {"coordinates": [[[30.43212890625, 49.03786794532644], [29.9267578125, 47.84265762816538], [32.54150390625, 46.965259400349275], [32.67333984375, 49.13859653703879], [30.43212890625, 49.03786794532644]]], "type": "Polygon"}, "polygon_id": "0dgf09gmudf0gudgdf"}'

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[
        {
                "Date": "2019-01-30",
                "Temp_air_min": 0.688195800781273,
                "Temp_air_max": 7.49709472656252,
                "Temp_land_min": 0,
                "Temp_land_max": 0,
                "Rel_humidity": 90.9507777666805,
                "Snow_depth": 0.29296875,
                "Rain": {
                        "2h": 2.90234375,
                        "5h": 6.4765625,
                        "8h": 7.5703125,
                        "11h": 7.59375,
                        "14h": 7.62890625,
                        "17h": 7.62890625,
                        "20h": 7.6328125,
                        "23h": 7.6328125
                },
                "Windspeed": {
                        "2h": 0,
                        "5h": 0,
                        "8h": 0,
                        "11h": 0,
                        "14h": 0,
                        "17h": 0,
                        "20h": 0,
                        "23h": 0
                }
        },
        {
                "Date": "2019-01-31",
                "Temp_air_min": -1.04245605468748,
                "Temp_air_max": 5.38274536132815
        }
]

Response fields:

Date:forecast date, string
Temp_air_min:Min temperature at 2m above ground, number
Temp_air_max:Max temperature at 2m above ground, number
Temp_land_min:Min ground temperature , number
Temp_land_max:Max ground temperature , number
Rel_humidity:Avg relative humidity at 2m above ground, number
Snow_depth:Snow depth, number
Rain:Total precipitation (accumulated since model start), splited by 3 hours, object
Windspeed:Wind at 10m above ground, splited by 3 hours, object