跳到主要内容

集成

通过我们提供的API,轻松将模型与预测结果集成到您的其他应用系统中或用于分析新数据。

创建分布式光伏预测任务

请求参数

longitude # 经度,精度到小数点后3位,必填
latitude # 纬度,精度到小数点后3位,必填
capacity # 太阳能电池板系统的额定功率,即在标准测试条件下可输出的最大功率,单位为千瓦(KW),必填
altitude # 高度/海拔,单位米,默认为地表高度,非必填
tiltAngle # 太阳能板的倾斜角,单位为度 (°),默认同维度值,范围为 0-90,非必填
orientationAngle # 朝向角度,单位为度 (°),180时为朝向正南,默认为 180°,非必填
targetDateDurationNum # 预测时长范围数值,非必填
targetDateDurationUnit # 预测时长范围单位,D日Y年,非必填
freq # 预测结果的时间分辨率,包括 FIVE_MIN 5分钟,FIFTEEN_MIN 15分钟,ONE_H 1小时,ONE_D 日 默认为 15 分钟,非必填
inputModelKey # 使用的模型Key,默认为光伏功率预测基础模型。自己微调过的模型,可以使用微调页面中返回的模型Key,非必填
timeZone # 输出结果的时区,默认是Asia/Shanghai东八区,非必填

请求示例

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

返回示例

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

查询分布式光伏预测任务结果

请求示例

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'
}

# 设置查询参数(将 <your_task_key> 替换为实际的 taskKey)
params = {
"taskKey": "<your_task_key>"
}

# 发送 GET 请求
response = requests.get(url, headers=headers, params=params)

# 打印响应结果
print(response.json())

响应状态

PENDING # 任务排队等待中
RUNNING # 任务运行中
COMPLETED # 任务已完成
FAILED # 任务失败

响应示例

{
"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
}