cURL
curl -X POST "https://openapi.bazhuayu.com/taskanalytics/queries" \
-H "x-api-key: op_sk_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"start":"","end":"","page":null,"pageSize":null,"taskIds":[],"memberNames":[],"collectionMethod":"","timeGranularity":""}'import requests
url = "https://openapi.bazhuayu.com/taskanalytics/queries"
headers = {
"x-api-key": "op_sk_xxxxxx",
"Content-Type": "application/json",
}
payload = {
"start": "",
"end": "",
"page": None,
"pageSize": None,
"taskIds": [],
"memberNames": [],
"collectionMethod": "",
"timeGranularity": "",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '',
end: '',
page: null,
pageSize: null,
taskIds: [],
memberNames: [],
collectionMethod: '',
timeGranularity: ''
})
};
fetch('https://openapi.bazhuayu.com/taskanalytics/queries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '',
end: '',
page: null,
pageSize: null,
taskIds: [],
memberNames: [],
collectionMethod: '',
timeGranularity: ''
})
};
fetch('https://openapi.bazhuayu.com/taskanalytics/queries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.bazhuayu.com/taskanalytics/queries"
payload := strings.NewReader("{\n \"start\": \"\",\n \"end\": \"\",\n \"page\": null,\n \"pageSize\": null,\n \"taskIds\": [],\n \"memberNames\": [],\n \"collectionMethod\": \"\",\n \"timeGranularity\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.bazhuayu.com/taskanalytics/queries")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"\",\n \"end\": \"\",\n \"page\": null,\n \"pageSize\": null,\n \"taskIds\": [],\n \"memberNames\": [],\n \"collectionMethod\": \"\",\n \"timeGranularity\": \"\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.bazhuayu.com/taskanalytics/queries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start' => '',
'end' => '',
'page' => null,
'pageSize' => null,
'taskIds' => [
],
'memberNames' => [
],
'collectionMethod' => '',
'timeGranularity' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://openapi.bazhuayu.com/taskanalytics/queries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start\": \"\",\n \"end\": \"\",\n \"page\": null,\n \"pageSize\": null,\n \"taskIds\": [],\n \"memberNames\": [],\n \"collectionMethod\": \"\",\n \"timeGranularity\": \"\"\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://openapi.bazhuayu.com/taskanalytics/queries");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"start\": \"\",\n \"end\": \"\",\n \"page\": null,\n \"pageSize\": null,\n \"taskIds\": [],\n \"memberNames\": [],\n \"collectionMethod\": \"\",\n \"timeGranularity\": \"\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"start\": \"\",\n \"end\": \"\",\n \"page\": null,\n \"pageSize\": null,\n \"taskIds\": [],\n \"memberNames\": [],\n \"collectionMethod\": \"\",\n \"timeGranularity\": \"\"\n}")
val request = Request.Builder()
.url("https://openapi.bazhuayu.com/taskanalytics/queries")
.post(body)
.addHeader("x-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()false任务分析
查询任务采集与执行分析
介绍“查询任务采集与执行分析”接口的功能、参数与调用方法。
POST
/
taskanalytics
/
queries
cURL
curl -X POST "https://openapi.bazhuayu.com/taskanalytics/queries" \
-H "x-api-key: op_sk_xxxxxx" \
-H "Content-Type: application/json" \
-d '{"start":"","end":"","page":null,"pageSize":null,"taskIds":[],"memberNames":[],"collectionMethod":"","timeGranularity":""}'import requests
url = "https://openapi.bazhuayu.com/taskanalytics/queries"
headers = {
"x-api-key": "op_sk_xxxxxx",
"Content-Type": "application/json",
}
payload = {
"start": "",
"end": "",
"page": None,
"pageSize": None,
"taskIds": [],
"memberNames": [],
"collectionMethod": "",
"timeGranularity": "",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '',
end: '',
page: null,
pageSize: null,
taskIds: [],
memberNames: [],
collectionMethod: '',
timeGranularity: ''
})
};
fetch('https://openapi.bazhuayu.com/taskanalytics/queries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '',
end: '',
page: null,
pageSize: null,
taskIds: [],
memberNames: [],
collectionMethod: '',
timeGranularity: ''
})
};
fetch('https://openapi.bazhuayu.com/taskanalytics/queries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.bazhuayu.com/taskanalytics/queries"
payload := strings.NewReader("{\n \"start\": \"\",\n \"end\": \"\",\n \"page\": null,\n \"pageSize\": null,\n \"taskIds\": [],\n \"memberNames\": [],\n \"collectionMethod\": \"\",\n \"timeGranularity\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.bazhuayu.com/taskanalytics/queries")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"\",\n \"end\": \"\",\n \"page\": null,\n \"pageSize\": null,\n \"taskIds\": [],\n \"memberNames\": [],\n \"collectionMethod\": \"\",\n \"timeGranularity\": \"\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.bazhuayu.com/taskanalytics/queries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start' => '',
'end' => '',
'page' => null,
'pageSize' => null,
'taskIds' => [
],
'memberNames' => [
],
'collectionMethod' => '',
'timeGranularity' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://openapi.bazhuayu.com/taskanalytics/queries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start\": \"\",\n \"end\": \"\",\n \"page\": null,\n \"pageSize\": null,\n \"taskIds\": [],\n \"memberNames\": [],\n \"collectionMethod\": \"\",\n \"timeGranularity\": \"\"\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://openapi.bazhuayu.com/taskanalytics/queries");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-api-key", "<api-key>");
request.AddJsonBody("{\n \"start\": \"\",\n \"end\": \"\",\n \"page\": null,\n \"pageSize\": null,\n \"taskIds\": [],\n \"memberNames\": [],\n \"collectionMethod\": \"\",\n \"timeGranularity\": \"\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"start\": \"\",\n \"end\": \"\",\n \"page\": null,\n \"pageSize\": null,\n \"taskIds\": [],\n \"memberNames\": [],\n \"collectionMethod\": \"\",\n \"timeGranularity\": \"\"\n}")
val request = Request.Builder()
.url("https://openapi.bazhuayu.com/taskanalytics/queries")
.post(body)
.addHeader("x-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()false所需套餐: 旗舰版、旗舰+、企业版
端点
POST https://openapi.bazhuayu.com/taskanalytics/queries
描述
按日/周/月粒度查询任务采集量、执行次数、成功率及资源消耗等指标。时间范围为 UTC 自然日,仅支持查询最近 3 个月内数据。 未传memberNames 或传空数组时,仅查询当前登录用户;传入成员名称时须为当前用户团队成员。
选填字段未填写时应为空值(如 ""、[]、null),不要使用 <string>、123 等自动生成的占位值。
请求头
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
x-api-key | String | 是 | API Key,例如 op_sk_xxxxxx;创建方式见获取 API Key |
Content-Type | String | 是 | application/json |
{
"x-api-key": "op_sk_xxxxxx",
"Content-Type": "application/json"
}
请求体
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
start | String | 是 | 查询开始日期(含),格式 yyyy-MM-dd,如 2026-02-01 |
end | String | 是 | 查询结束日期(含),格式 yyyy-MM-dd;不得晚于当前 UTC 日期,且不能早于 start |
page | Number | 选填 | 页码,≥1,默认 1 |
pageSize | Number | 选填 | 每页条数,1~500,默认 20 |
taskIds | String[] | 选填 | 任务 Id 列表,最多 100 个;不传表示不过滤任务 |
memberNames | String[] | 选填 | 团队成员名称,最多 100 个;不传或空数组表示仅查当前用户 |
collectionMethod | String | 选填 | 采集方式:Cloud / Local / All;不传或 All 表示不过滤 |
timeGranularity | String | 选填 | 时间粒度:Day / Week / Month,默认 Day |
{
"start": "2026-02-01",
"end": "2026-04-01"
}
{
"start": "2026-02-01",
"end": "2026-04-01",
"page": 1,
"pageSize": 20,
"timeGranularity": "Week",
"collectionMethod": "All",
"taskIds": [
"task-id-1"
],
"memberNames": []
}
响应
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
data | Object | 是 | 响应数据 |
total | Number | 是 | 符合条件的总记录数(用于分页) |
data | Object[] | 是 | 当前页数据列表 |
taskId | String | 是 | 任务 Id |
userId | String | 是 | 用户 Id |
taskName | String | 否 | 任务名称(可能为 null) |
dayKey | String | 是 | 时间分桶键(日:yyyy-MM-dd;周:YYYY-WW;月:yyyy-MM) |
weekStartDate | String | 否 | 周开始日期 yyyy-MM-dd,仅 Week 粒度有值 |
weekEndDate | String | 否 | 周结束日期 yyyy-MM-dd,仅 Week 粒度有值 |
collectionMethod | String | 是 | 采集方式:Cloud / Local |
dataVolumeMetrics | Object | 是 | 数据量指标 |
totalCollected | Number | 否 | 采集总量;无数据为 null |
deduplicatedVolume | Number | 否 | 去重后保存量;无数据为 null |
executionMetrics | Object | 是 | 执行指标 |
runCount | Number | 否 | 运行次数 |
successCount | Number | 否 | 成功次数 |
failureCount | Number | 否 | 失败次数 |
durationPerRunSeconds | Number | 否 | 单次平均耗时(秒) |
totalExecutionSeconds | Number | 否 | 总耗时(秒) |
successRate | Number | 否 | 成功率,0~1 |
failureRate | Number | 否 | 失败率,0~1 |
resourceUsageMetrics | Object | 是 | 资源消耗指标 |
captchaCount | Number | 否 | 验证码次数 |
simpleTemplateCount | Number | 否 | 简易模板条数 |
proxyIpCount | Number | 否 | 代理 IP 用量 |
balance | Number | 否 | 资源消耗金额 |
requestId | String | 是 | 请求 Id |
{
"data": {
"total": 42,
"data": [
{
"taskId": "abc123",
"userId": "user001",
"taskName": null,
"dayKey": "2026-11",
"weekStartDate": "2026-03-10",
"weekEndDate": "2026-03-16",
"collectionMethod": "Cloud",
"dataVolumeMetrics": {
"totalCollected": 10000,
"deduplicatedVolume": 8000
},
"executionMetrics": {
"runCount": 50,
"successCount": 48,
"failureCount": 2,
"durationPerRunSeconds": 12.5,
"totalExecutionSeconds": 625,
"successRate": 0.96,
"failureRate": 0.04
},
"resourceUsageMetrics": {
"captchaCount": 10,
"simpleTemplateCount": null,
"proxyIpCount": 1.5,
"balance": 3.2
}
}
]
},
"requestId": "0HMD469L0I8Q1:00000001"
}
错误响应
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
requestId | String | 是 | 请求Id |
error | Object | 是 | 错误信息,参考错误码 |
code | String | 是 | 错误码 |
message | String | 是 | 错误描述 |
{
"error": {
"code": "MemberNotAllowed",
"message": "存在无权查询的成员名称"
},
"requestId": "0HMD469L0I8R0:00000001"
}
授权
apiKeyAuthbearerAuth
八爪鱼 API Key,格式 op_sk_xxxxxx;创建方式见 /zh/mcp/quick-start/api-key
请求体
application/json
响应
200
成功
