cURL
curl -X POST "https://openapi.bazhuayu.com/taskanalytics/queries" \
-H "Authorization: Bearer <access_token>" \
-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 = {
"Authorization": "Bearer <access_token>",
"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: {Authorization: 'Bearer <token>', 'Content-Type': '<content-type>'},
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: {Authorization: 'Bearer <token>', 'Content-Type': '<content-type>'},
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("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "<content-type>")
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("Authorization", "Bearer <token>")
.header("Content-Type", "<content-type>")
.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 => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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["Authorization"] = 'Bearer <token>'
request["Content-Type"] = '<content-type>'
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("Authorization", "Bearer <token>");
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("Authorization", "Bearer <token>")
.addHeader("Content-Type", "<content-type>")
.build()
val response = client.newCall(request).execute()false任务分析
查询任务采集与执行分析
POST
/
taskanalytics
/
queries
cURL
curl -X POST "https://openapi.bazhuayu.com/taskanalytics/queries" \
-H "Authorization: Bearer <access_token>" \
-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 = {
"Authorization": "Bearer <access_token>",
"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: {Authorization: 'Bearer <token>', 'Content-Type': '<content-type>'},
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: {Authorization: 'Bearer <token>', 'Content-Type': '<content-type>'},
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("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "<content-type>")
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("Authorization", "Bearer <token>")
.header("Content-Type", "<content-type>")
.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 => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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["Authorization"] = 'Bearer <token>'
request["Content-Type"] = '<content-type>'
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("Authorization", "Bearer <token>");
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("Authorization", "Bearer <token>")
.addHeader("Content-Type", "<content-type>")
.build()
val response = client.newCall(request).execute()false所需套餐: 旗舰版、旗舰+、企业版
端点
POST https://openapi.bazhuayu.com/taskanalytics/queries
描述
按日/周/月粒度查询任务采集量、执行次数、成功率及资源消耗等指标。时间范围为 UTC 自然日,仅支持查询最近 3 个月内数据。 未传memberNames 或传空数组时,仅查询当前登录用户;传入成员名称时须为当前用户团队成员。
选填字段未填写时应为空值(如 ""、[]、null),不要使用 <string>、123 等自动生成的占位值。
请求头
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
Authorization | String | 是 | 身份令牌 |
Content-Type | String | 是 | application/json |
{
"Authorization": "Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImdXS3hWc0F4SHhaMD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hbBfzI1xS6yo-Ue1CFHzMaUIfzw4gJlubNBOkUT4SSTlhuS4bVQ4t4UHuYGbE9VX6XgNVgkcDnx6XapqcPohSy7vPv9TIAsjtbrQSA3mj13SnVVAPWwfAVJ-I7g9HDnyPEEOVSvmZUJhiz-irH5L0ojbnt3ck2rQ9tIFuSd7j2eh5BS4ItjNoHY00rh_QPZltk66a9q-fNE33GrxOaXUdHH47WMlsENnh1gybB7QtGtd6bZ982Qa9JljpFnZWSdEf4VfkN4JmhkUTTC908DqS3stT-LD-9tpztFwB54sd0D4CyOBnESkKrUwjxchYYZo4l1O7auiZVGV48YhZYMw",
"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"
}
授权
身份令牌
请求头
身份令牌,格式 Bearer {access_token}
示例:
"Bearer <access_token>"
application/json
示例:
"application/json"
请求体
application/json
响应
200
成功
⌘I
