For developers

For developers

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

It is not allowed to share an API key with e.g. clients of your product! (It will also not work because of the rate limits for the API key.)

If you are developing an APP that will be delivered to customers in any way, the following setup is suggested:

  • Deliver the APP with the use of the Public API by default.
  • Provide an APP setting/configuration option where an API key can be entered.
  • Your customers can now decide whether they want to take out a subscription themselves if they are interested in having more data. (This is for example the way, how the Home Assistant integration works.)

Please keep in mind, that the result set for subscriptions have other time series steps.

If you host your APP yourself and the API key is not visible to your customers, please get in touch for an Enterprise account.

API key

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


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

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));


Script to convert API response to InfluxDB line format


# set -x

# Settings

# Forecast.Solar API key; optional
# "demo-key" works ONLY with the demo location at lat. 51.15 and lon. 10.45 :-)

# Location + plane parameters; required
# :lat/:lon/:dec/:az/:kwp

# Fields to use; required

# InfluxDB measurement; required

# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------

[ -z "$(which curl)" ] && echo "curl is needed!" && exit 1
[ -z "$API_PARAMS" ]   && echo "Forecast.Solar API_PARAMS= required!" && exit 2
[ -z "$MEASUREMENT" ]  && echo "InfluxDb MEASUREMENT= required!" && exit 3



# Fetch
curl -s -H 'Accept: text/csv' "${API_KEY}estimate/${API_PARAMS}?time=nanoseconds" | \
while read type timestamp value; do
    # Only defined fields
    grep -q $type <<<$FIELDS && echo "$MEASUREMENT,$type value=$value $timestamp"