Skip to main content

Integration

Easily integrate models and prediction results into your other application systems or use them for analyzing new data through the APIs we provide.

Create a Distributed Photovoltaic Prediction Task

Request Parameters

longitude # Longitude, accurate to three decimal places, required
latitude # Latitude, accurate to three decimal places, required
capacity # Rated power of the solar panel system, i.e., the maximum power output under standard test conditions, in kilowatts (KW), required
altitude # Altitude/Elevation, in meters, defaults to ground level, optional
tiltAngle # Tilt angle of the solar panels, in degrees (°), defaults to the same value as latitude, range 0-90, optional
orientationAngle # Orientation angle, in degrees (°), 180° for true south, defaults to 180°, optional
targetDateDurationNum # Number value for the prediction duration range, optional
targetDateDurationUnit # Unit for the prediction duration range, D for days, Y for years, optional
freq # Time resolution of the prediction results, including FIVE_MIN (5 minutes), FIFTEEN_MIN (15 minutes), ONE_H (1 hour), ONE_D (1 day). Defaults to 15 minutes, optional
inputModelKey # Model Key to be used, defaults to the basic photovoltaic power prediction model. For self-tuned models, use the model key returned from the tuning page, optional
timeZone # Time zone for the output results, defaults to Asia/Shanghai (UTC+8), optional

Request Example

curl

curl -X POST 'https://time.xm-opt.com/api/solar_power_predict_async'
--header 'Content-Type: application/json'
--header 'apikey: your apikey'
--data-raw '{
"longitude": 120.714,
"latitude": 30.229,
"capacity": 200,
"tiltAngle": 30,
"orientationAngle": 180,
"targetDateDurationNum": 1,
"targetDateDurationUnit": "D",
"freq": "FIFTEEN_MIN",
"timeZone": "Asia/Shanghai"
}'

python

import requests

url = 'https://time.xm-opt.com/api/solar_power_predict_async'
headers = {
'Content-Type': 'application/json',
'apikey': 'your apikey'
}
data = {
"longitude": 120.714,
"latitude": 30.229,
"capacity": 200,
"tiltAngle": 30,
"orientationAngle": 180,
"targetDateDurationNum": 1,
"targetDateDurationUnit": "D",
"freq": "FIFTEEN_MIN",
"timeZone": "Asia/Shanghai"
}

response = requests.post(url, headers=headers, json=data)

print(response.json())

Response Example

{
"code": 0,
"message": null,
"requestId": null,
"data": {
"taskKey": "2c9d1a14-60f7-4d78-a402-ebf3af95ee2a"
},
"success": true
}

Query Distributed Photovoltaic Prediction Task Result

Request Example

curl

curl -X GET 'https://time.xm-opt.com/api/solar_power_predict_async_result?taskKey=<your_task_key>' 
--header 'Content-Type: application/json'
--header 'apikey: your_apikey'

python

import requests

url = 'https://time.xm-opt.com/api/solar_power_predict_async_result'
headers = {
'Content-Type': 'application/json',
'apikey': 'your apikey'
}

# Set query parameters (replace <your_task_key> with the actual taskKey)
params = {
"taskKey": "<your_task_key>"
}

# Send GET request
response = requests.get(url, headers=headers, params=params)

# Print response
print(response.json())

Response Status

PENDING # Task is queued and waiting
RUNNING # Task is in progress
COMPLETED # Task has been completed
FAILED # Task has failed

Response Example

{
"code": 0,
"message": null,
"requestId": null,
"data": {
"taskStatus": "COMPLETED",
"predictResult": {
"datetime": [
"2024-10-22 00:15:00+08:00",
"2024-10-22 00:30:00+08:00",
"2024-10-22 00:45:00+08:00",
"2024-10-22 01:00:00+08:00",
"2024-10-22 01:15:00+08:00",
"2024-10-22 01:30:00+08:00",
"2024-10-22 01:45:00+08:00",
"2024-10-22 02:00:00+08:00",
"2024-10-22 02:15:00+08:00",
"2024-10-22 02:30:00+08:00",
"2024-10-22 02:45:00+08:00",
"2024-10-22 03:00:00+08:00",
"2024-10-22 03:15:00+08:00",
"2024-10-22 03:30:00+08:00",
"2024-10-22 03:45:00+08:00",
"2024-10-22 04:00:00+08:00",
"2024-10-22 04:15:00+08:00",
"2024-10-22 04:30:00+08:00",
"2024-10-22 04:45:00+08:00",
"2024-10-22 05:00:00+08:00",
"2024-10-22 05:15:00+08:00",
"2024-10-22 05:30:00+08:00",
"2024-10-22 05:45:00+08:00",
"2024-10-22 06:00:00+08:00",
"2024-10-22 06:15:00+08:00",
"2024-10-22 06:30:00+08:00",
"2024-10-22 06:45:00+08:00",
"2024-10-22 07:00:00+08:00",
"2024-10-22 07:15:00+08:00",
"2024-10-22 07:30:00+08:00",
"2024-10-22 07:45:00+08:00",
"2024-10-22 08:00:00+08:00",
"2024-10-22 08:15:00+08:00",
"2024-10-22 08:30:00+08:00",
"2024-10-22 08:45:00+08:00",
"2024-10-22 09:00:00+08:00",
"2024-10-22 09:15:00+08:00",
"2024-10-22 09:30:00+08:00",
"2024-10-22 09:45:00+08:00",
"2024-10-22 10:00:00+08:00",
"2024-10-22 10:15:00+08:00",
"2024-10-22 10:30:00+08:00",
"2024-10-22 10:45:00+08:00",
"2024-10-22 11:00:00+08:00",
"2024-10-22 11:15:00+08:00",
"2024-10-22 11:30:00+08:00",
"2024-10-22 11:45:00+08:00",
"2024-10-22 12:00:00+08:00",
"2024-10-22 12:15:00+08:00",
"2024-10-22 12:30:00+08:00",
"2024-10-22 12:45:00+08:00",
"2024-10-22 13:00:00+08:00",
"2024-10-22 13:15:00+08:00",
"2024-10-22 13:30:00+08:00",
"2024-10-22 13:45:00+08:00",
"2024-10-22 14:00:00+08:00",
"2024-10-22 14:15:00+08:00",
"2024-10-22 14:30:00+08:00",
"2024-10-22 14:45:00+08:00",
"2024-10-22 15:00:00+08:00",
"2024-10-22 15:15:00+08:00",
"2024-10-22 15:30:00+08:00",
"2024-10-22 15:45:00+08:00",
"2024-10-22 16:00:00+08:00",
"2024-10-22 16:15:00+08:00",
"2024-10-22 16:30:00+08:00",
"2024-10-22 16:45:00+08:00",
"2024-10-22 17:00:00+08:00",
"2024-10-22 17:15:00+08:00",
"2024-10-22 17:30:00+08:00",
"2024-10-22 17:45:00+08:00",
"2024-10-22 18:00:00+08:00",
"2024-10-22 18:15:00+08:00",
"2024-10-22 18:30:00+08:00",
"2024-10-22 18:45:00+08:00",
"2024-10-22 19:00:00+08:00",
"2024-10-22 19:15:00+08:00",
"2024-10-22 19:30:00+08:00",
"2024-10-22 19:45:00+08:00",
"2024-10-22 20:00:00+08:00",
"2024-10-22 20:15:00+08:00",
"2024-10-22 20:30:00+08:00",
"2024-10-22 20:45:00+08:00",
"2024-10-22 21:00:00+08:00",
"2024-10-22 21:15:00+08:00",
"2024-10-22 21:30:00+08:00",
"2024-10-22 21:45:00+08:00",
"2024-10-22 22:00:00+08:00",
"2024-10-22 22:15:00+08:00",
"2024-10-22 22:30:00+08:00",
"2024-10-22 22:45:00+08:00",
"2024-10-22 23:00:00+08:00",
"2024-10-22 23:15:00+08:00",
"2024-10-22 23:30:00+08:00",
"2024-10-22 23:45:00+08:00",
"2024-10-23 00:00:00+08:00"
],
"predictPower": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.5965,
0.7952,
4.0249,
7.2533,
10.4804,
13.7062,
15.8896,
18.0726,
20.2552,
22.4373,
19.852,
17.2678,
14.6846,
12.1024,
12.849,
13.5959,
14.3431,
15.0906,
18.3172,
21.5438,
24.7704,
27.997,
33.911,
39.8273,
45.7461,
51.6672,
54.7308,
57.7926,
60.8525,
63.9106,
67.7809,
71.6513,
75.5216,
79.392,
74.1323,
68.8726,
63.6128,
58.3531,
50.9101,
43.4671,
36.0241,
28.5811,
22.329,
16.0769,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"predictEnergy": null
},
"taskKey": "19eee177-05b2-4e91-aef1-7a4e6feddae0"
},
"success": true
}