Weather forecast
(Professional accounts only)
Get weather forecast for specific location defined by latitude and longitude.
URL
https://api.forecast.solar/:key/weather/:lat/:lon
key
- personal API key for registered userslat
- latitude of location,-90
(south) …90
(north)lon
- longitude of location,-180
(west) …180
(east)
You can poke around with the Swagger Editor to build proper request URLs.
Result
datetime
- Human readable date and timetimestamp
- The UNIX time, seconds since midnight GMT on 1 Jan 1970sky
- A numerical value between 0 and 1 (inclusive) representing the percentage of clear sky, a value of1
corresponds to clear sky.temperature
- Degrees Celsiuscondition
- Human-readable text summaryicon
- A machine-readable text summarywind_speed
- Numerical value representing the wind speed in kilometers per hourwind_degrees
- Numerical value representing the direction that the wind is coming from in degrees, with true north at 0° and progressing clockwise. (If windSpeed is zero, then this value will not be defined.)wind_direction
- Short name for wind Direction
Example
Get weather forecast for midpoint of Europe (54.9° north, 25.3° east), JSON by default
curl https://api.forecast.solar/<your-API-key>/weather/54.9/25.3
{ "result": [ { "datetime": "2016-02-08 00:00:00", "timestamp": 1454886000, "sky": 0.28, "temperature": -1.7, "condition": "Mostly Cloudy", "icon": "partly-cloudy-night", "wind_speed": 25, "wind_degrees": 177, "wind_direction": "S" }, { "datetime": "2016-02-08 00:15:00", "timestamp": 1454886900, "sky": 0.28, "temperature": -1.8, "condition": "Mostly Cloudy", "icon": "partly-cloudy-night", "wind_speed": 25, "wind_degrees": 177, "wind_direction": "S" }, { "datetime": "2016-02-08 00:30:00", "timestamp": 1454887800, "sky": 0.28, "temperature": -1.9, "condition": "Mostly Cloudy", "icon": "partly-cloudy-night", "wind_speed": 25, "wind_degrees": 177, "wind_direction": "S" }, ... ], "message": { "code": 0, "type": "success", "text": "Distance: 1.069 km" } }
The icon attribute can be used for example with Skycons or Adam Whitcroft's Climacons