Misc

Table of Contents

Misc

Check location

To make sure to have a valid location, check it with

https://api.forecast.solar/check/:lat/:lon

For example, the demo location (center of Germany)

https://api.forecast.solar/check/51.15/10.45

will give this:

{
    "result": {
        "latitude": "51° 09' 00\" N",
        "longitude": "10° 27' 00\" E",
        "place": "Niederdorla, Vogtei, Unstrut-Hainich-Kreis, Thüringen, Deutschland",
        "timezone": "Europe/Berlin"
    },
    "message": {
        "code": 0,
        "type": "success",
        "text": "",
        "info": {
            "latitude": 51.15,
            "longitude": 10.45,
            "distance": 0,
            "place": "Niederdorla, Vogtei, Unstrut-Hainich-Kreis, Thüringen, Deutschland",
            "timezone": "Europe/Berlin",
            "time": "2023-02-13T10:22:46+01:00",
            "time_utc": "2023-02-13T09:22:46+00:00"
        }
    }
}

Check plane

If you have an APP where user can give parameters, check a whole plane it with

https://api.forecast.solar/check/:lat/:lon/:dec/:az/:kwp

For example, the demo location (center of Germany), 20° declination, 0° south with 12.34 kWp

https://api.forecast.solar/check/51.15/10.45/20/0/12.34

will give this:

{
    "result": {
        "latitude": "51° 09' 00\" N",
        "longitude": "10° 27' 00\" E",
        "declination": "20°",
        "azimuth": "0°",
        "power": "12.34 kWp",
        "place": "Niederdorla, Vogtei, Unstrut-Hainich-Kreis, Thüringen, Deutschland",
        "timezone": "Europe/Berlin"
    },
    "message": {
        "code": 0,
        "type": "success",
        "text": "",
        "info": {
            "latitude": 51.15,
            "longitude": 10.45,
            "distance": 0,
            "place": "Niederdorla, Vogtei, Unstrut-Hainich-Kreis, Thüringen, Deutschland",
            "timezone": "Europe/Berlin",
            "time": "2023-02-13T10:28:07+01:00",
            "time_utc": "2023-02-13T09:28:07+00:00"
        }
    }
}

Errors

Any invalid location or plane will result in a HTTP status 400, error code 600, 601 or 602 and a meaningful message > text.

{
    "result": null,
    "message": {
        "code": 600,
        "type": "error",
        "text": "..."
    }
}