Forecast.Solar

Restful API for Solar plant production and Weather forecast data


Developers

Some tips for the integration of Forecast.Solar into your APP.

API key

The API key will always match this regular expression and should checked during configuration of an APP.

/[a-z0-9]{16}/

If a API key was given by user, you can check if it is valid with

https://api.forecast.solar/:apikey/info

Returns HTTP status 200 on success with key information as payload, 400 otherwise.

HTTP return codes

  • 200: ok
  • 400: A malformed API key was provided or the URL is not correct build
  • 401 or 403: An invalid API key was provided

See the message section of the reponse for error code and text.

Location pre-check

To check, if the given location is valid, you can use the check route.

Chart event

When a chart is loaded, a custom event is fired: fs.chart.loaded on window

The event details hold in container the chart wrapper.

window.addEventListener('fs.chart.loaded', e => console.log(e.detail.container));