Table of Contents

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

There is also a helper page to build proper request URLs. It can help you also to find the coordinates for your address with Google maps API.

Result

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