油价预测
服务正常
金融数据
限时免费(至 2027-02-20)· 之后 5 点/次
查询国内成品油价格调整预测与下一轮调价幅度。
限时免费:2027-02-20 23:59:59 前调用不扣点数。
- 免费期结束后,每次调用扣 5 点。
- 上游异常自动退款(免费期外)。
- 参数错误在扣费前拦截,不扣点。
返回中的 is_free、free_until、credits_cost 可用来判断当前是否还在免费期。
返回下一轮油价调整的预测方向与幅度,适用于油价资讯、加油省钱类应用。
常见用途
- 油价调整提醒
- 加油优惠内容
- 财经资讯数据源
参数说明
参数按上游文档传参,本接口原样透传。
请求 HEADER
| 名称 | 值 | 必填 | 说明 |
|---|---|---|---|
Content-Type |
application/json |
必填 | 固定值 |
X-API-Key |
sk_你的KEY |
必填 | 控制台密钥管理页获取 |
请求参数
| 参数名 | 必填 | 类型 | 示例值 | 说明 |
|---|---|---|---|---|
(上游参数) |
否 | mixed | {"code":"sh000001"} |
按各产品文档传参,本接口原样透传给上游,不做字段校验;另需在 URL 上带 ?slug= |
返回参数
| 字段名 | 类型 | 说明 |
|---|---|---|
code | int | 0 表示调用成功 |
message | string | 提示信息 |
data.(业务字段) | mixed | 上游返回的业务数据,原样透传,字段随产品不同 |
data.slug | string | 本次调用的产品标识 |
data.title | string | 产品中文名 |
data.is_free | bool | 是否处于限时免费期 |
data.free_until | string | 免费截止时间 |
data.credits_cost | int | 本次消耗点数(免费期为 0) |
data.credits_balance | int | 剩余点数 |
data.duration_ms | int | 总耗时(毫秒) |
JSON
{
"code": 0,
"message": "success",
"data": {
"is_free": true,
"credits_cost": 0,
"duration_ms": 380
}
}
| 错误码 | 说明 |
|---|---|
0 | 成功 |
400 | 缺少 slug 参数 / slug 不在支持列表 |
401 | 缺少 API Key,或 Key 无效、已停用 |
402 | 点数不足(仅免费期结束后生效,每次 5 点) |
429 | 调用过于频繁,每分钟最多 30 次 |
500 | 服务未配置 |
502 | 上游服务异常或返回错误(免费期外自动退款) |
cURL
curl -X POST "https://www.wkidc.cn/api/v1/marketplace.php?slug=oil-price-forecast" \
-H "X-API-Key: sk_你的KEY" \
-H "Content-Type: application/json" \
-d '[]'
PHP
<?php
$endpoint = 'https://www.wkidc.cn/api/v1/marketplace.php?slug=oil-price-forecast';
$apiKey = 'sk_你的KEY';
$params = array (
);
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($params, JSON_UNESCAPED_UNICODE),
]);
$res = curl_exec($ch);
curl_close($ch);
var_dump(json_decode($res, true));
Python
import requests
url = 'https://www.wkidc.cn/api/v1/marketplace.php?slug=oil-price-forecast'
headers = {'X-API-Key': 'sk_你的KEY'}
params = array (
)
resp = requests.post(url, headers=headers, json=params)
print(resp.json())
Node.js
const res = await fetch('https://www.wkidc.cn/api/v1/marketplace.php?slug=oil-price-forecast', {
method: 'POST',
headers: {
'X-API-Key': 'sk_你的KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify([])
});
console.log(await res.json());
Go
package main
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
body := []byte(`[]`)
req, _ := http.NewRequest("POST", "https://www.wkidc.cn/api/v1/marketplace.php?slug=oil-price-forecast", bytes.NewBuffer(body))
req.Header.Set("X-API-Key", "sk_你的KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
b, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(b))
}
在线调试会真实请求接口并消耗你的点数,请勿填写私密信息。每账号每小时最多 30 次。
| 参数名 | 值 |
|---|---|
(上游参数)按各产品文档传参,本接口原样透传给上游,不做字段校验;另需在 URL 上带 ?slug= |