集蜂云平台API
  1. 任务
集蜂云平台API
  • 采集器
    • 运行采集器
      POST
    • 获取运行日志
      GET
    • 运行列表
      GET
  • 任务
    • 创建一个定时任务
      POST
    • 更新调度时间
      PUT
    • 任务调度启停
      PUT
    • 获取任务列表
      GET
    • 运行任务
      POST
    • 更新任务
      PUT
    • 获取任务详情
      GET
  • 数据
    • 获取数据列表
      GET
    • 获取采集的数据
      GET
    • 下载键值对文件
      GET
  • 数据接口
    • 获取抖音视频详情
      POST
    • 获取XHS笔记详情
      POST
    • 获取B站视频评论
      POST
  1. 任务

创建一个定时任务

POST
/v1/tasks

请求参数

Header 参数
beeize-api-token
string 
可选
beeize-api-token 在设置页面能找到
示例值:
xxxxxx
Body 参数application/json
input
object 
必需
input 参数同接口运行采集器
runOptions
object 
必需
buildTag
string 
必需
timeoutSecs
integer 
必需
memoryMbytes
integer 
必需
title
string 
任务标题
必需
scheduleCron
string 
必需
调度周期,支持 cron 表达式
desc
string 
任务描述
必需
scraperId
string 
采集器的 ID
必需
scheduleEnabled
boolean 
必需
是否启动调度,开启调度后,会根据调度周期的的设置,自动运行
示例
{
    "input": {   // input 参数同接口1
    },
    "runOptions": {
        "buildTag": "latest",
        "timeoutSecs": 600,
        "memoryMbytes": 2048
    },
    "title": "xxx 网站采集",  // 任务标题
    "scheduleCron": "0 0 0 */1 * ?",  // 调度周期,支持 cron 表达式
    "desc": "",  // 任务描述
    "scraperId": "", // 采集器的 ID,跟接口1一样,等待上线后会确定id
    "scheduleEnabled": true  // 是否启动调度
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/v1/tasks' \
--header 'beeize-api-token: xxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
    "input": {   // input 参数同接口1
    },
    "runOptions": {
        "buildTag": "latest",
        "timeoutSecs": 600,
        "memoryMbytes": 2048
    },
    "title": "xxx 网站采集",  // 任务标题
    "scheduleCron": "0 0 0 */1 * ?",  // 调度周期,支持 cron 表达式
    "desc": "",  // 任务描述
    "scraperId": "", // 采集器的 ID,跟接口1一样,等待上线后会确定id
    "scheduleEnabled": true  // 是否启动调度
}'

返回响应

🟢200成功
application/json
Body
code
integer 
必需
msg
string 
必需
data
object 
必需
id
string 
任务 id
必需
name
string 
必需
任务 name ,唯一
scraperId
string 
采集器 id
必需
title
string 
任务标题
必需
desc
string 
任务描述
必需
input
object 
输入
必需
proxyConfig
object 
代理配置
必需
scheduleCron
string 
调度配置
必需
scheduleEnabled
boolean 
是否启动调度
必需
runOptions
object 
必需
示例
{
  "code": 0,
  "msg": "",
  "data": {
    "id": "0k6ue1uo13g85fi4f",
    "name": "0k6ue1uo13g85fi4f",
    "scraperId": "mm5733d6hznnyyefr",
    "title": "微博贴文采集器-任务",
    "desc": "",
    "input": {},
    "proxyConfig": {
      "countryCode": "cn",
      "proxyType": "RESIDENTIAL"
    },
    "scheduleCron": "0 0 0 */1 * ?",
    "scheduleEnabled": true,
    "runOptions": {
      "buildTag": "latest",
      "timeoutSecs": 600,
      "memoryMbytes": 2048
    }
  }
}
修改于 2024-09-23 07:29:34
上一页
运行列表
下一页
更新调度时间
Built with