API Documentation¶
Every user of the "personal" plan receives an unique API key with their account with which they can down load the forecast data and upload the solar energy generation data of their panel
You can find you api_key inside the app at the "API Documention" section.
Get Method at Forecast Endpoint:¶
import requests
key = "XXXXXXXXXXXXXXXXXX123456"
url = "https://www.solar-forecast.com/forecast?api_key="+key
response = requests.get(url)
json_resp = response.json()
The json response contains power forecast series (15-minute local datetime keys) and system configuration:
kWatt: total system power forecast (kW)
personalised_kWatt: personalised power forecast (kW), included only when personalised forecasting is trained
array_N_kWatt: DC power forecast for each array (e.g.
array_1_kWatt,array_2_kWatt, ...)system_info: PV system details (location, inverter, and per-array capacity / tilt / orientation)
{
"kWatt": {
"2024-10-07 00:00:00": 0,
"2024-10-07 00:15:00": 0,
"2024-10-07 00:30:00": 0,
"2024-10-07 00:45:00": 0,
"...": "..."
},
"personalised_kWatt": {
"2024-10-07 00:00:00": 0,
"2024-10-07 00:15:00": 0,
"...": "..."
},
"array_1_kWatt": {
"2024-10-07 00:00:00": 0,
"2024-10-07 00:15:00": 0,
"...": "..."
},
"array_2_kWatt": {
"2024-10-07 00:00:00": 0,
"2024-10-07 00:15:00": 0,
"...": "..."
},
"system_info": {
"latitude": 28.89,
"longitude": 76.63,
"time_zone": "Asia/Kolkata",
"panel_age": 5,
"inverter": "Brand",
"inverter_capacity_kw": 5.0,
"arrays": [
{
"array": 1,
"capacity_kw": 3.0,
"tilt": 20,
"orientation": 180
},
{
"array": 2,
"capacity_kw": 2.0,
"tilt": 15,
"orientation": 180
}
]
}
}
Post Method at Generation Endpoint:¶
There two parameters for the post in generation endpoint:
energy: number in kWh unit
datetime(optinal): date-time value strictly in "%Y-%m-%d %H:%M:%S" format
Note: Please do not send datetime unless you are completely sure
Python code for sending energy values:
import requests
key = "XXXXXXXXXXXXXXXXXX123456"
energy_value = "0.5"
url = "https://www.solar-forecast.com/generation?api_key="+key+"&energy="+energy_value
response = requests.post(url)
Python code for sending energy values:
import requests
key = "XXXXXXXXXXXXXXXXXX123456"
energy_value = "0.5"
ddtt = '2024-10-09 13:15:00'
url = "https://www.solar-forecast.com/generation?api_key="+key+"&energy="+energy_value+"&datetime="+ddtt
response = requests.post(url)
You can check if the post was successful or not:
print(response)
will print "response [200]"
Number of API calls:¶
- We restrict the number of API calls for "personal" profiles to 15 for every 15 minutes.
- Our forecast data are updated every 15 minutes. So, all api calls within this interval will provide same data.
- Both post and get method reduces the number of API calls.
- Logout and fresh login into the dashboard will also use 1 API call.
- You can see the number of API calls left in the left-bottom corner of the dashboard.