Baidu Tieba Scrape Content
按输入采集规格计费,提交前确定价格
ae_baidu_tieba_scrape_content
这是一个异步百度贴吧采集工具。请提供关键词、话题、贴吧板块或帖子/主页链接等采集规格,并按需设置帖子、评论和楼中楼的采集范围;提交后先等待任务完成,成功时返回实际采集到的帖子与评论,不将采集规格误当作结果。
按输入采集规格计费,提交前确定价格
价格说明
按输入采集规格计费,提交前确定价格
工具参数
未传入的可选参数将使用平台默认值。
| 参数 | 类型 | 必填 | 说明 | 默认值 |
|---|---|---|---|---|
urls | array | 条件必填 | You can add direct URLs to scrape here. It can be a post URL, User Profile URL or Hot Topic URL. | — |
urls[].url | string | 是 | 暂无参数说明。 | — |
forums | array | 条件必填 | Enter the forums you want to scrape. You can enter the forum name, URL or ID. This is required if you are not using search terms above. | — |
forums[].tabs | array | 条件必填 | Select the tabs you want to scrape. | — |
forums[].forum | string | 是 | Enter the forum name, ID or URL you want to scrape | — |
forums[].customTabs | array | 条件必填 | Write the tab names in Chinese, it must match the website exactly | — |
forums[].maxPostsPerTab | integer | 是 | Maximum number of posts to scrape per forum tab. The Actor will stop scraping once this limit is reached for the tab. | — |
topics | array | 条件必填 | Enter the topics you want to scrape. Example: '剧情' or '#剧情'. Alternatively, you can also add Topic URLs in the Start URLs section above. | — |
timeout | number | 否 | 本次 Actor 执行超时,单位秒。 | — |
maxPosts | integer | 否 | Maximum number of posts to be scraped per search term, topic, profile or hot topic. | 100 |
searchTerms | array | 条件必填 | Enter one or more keywords to search for. Each keyword runs as a separate search. | — |
sortSearchBy | enum (most_relevant | latest | oldest) | 否 | Choose how to sort the search results. 'Most Relevant' sorts by relevance to the search term, 'Latest' sorts by date with the newest posts first, and 'Oldest' sorts by date with the oldest posts first. | most_relevant |
sortCommentsBy | enum (popular | latest | oldest) | 否 | Choose how to sort the comments when scraping a post. 'Most Relevant' sorts by relevance to the post, 'Latest' sorts by date with the newest comments first, and 'Oldest' sorts by date with the oldest comments first. | popular |
sortTopicPostsBy | enum (hottest | latest) | 否 | Choose how to sort the posts when scraping a Hot Topic URL or Topic. 'Hottest' sorts by popularity, while 'Latest' sorts by date with the newest posts first. | hottest |
maxTotalChargeUsd | number | 否 | 按事件计费运行的费用上限,单位美元。 | — |
searchWithinForum | string | 否 | If you want to search within a specific forum, enter the forum name, ID or URL here. This will limit the search results to that forum. Leave empty to search across all forums. | "" |
maxCommentsPerPost | integer | 否 | The maximum number of top-level comments to scrape per post. | 0 |
maxRepliesPerComment | integer | 否 | The maximum number of replies to scrape per comment. | 0 |
调用示例
提交任务并查询完成结果
POST
/agent-api/v1/tool/executeX-Api-Key先提交任务,再用返回的 task_id 查询,直至完成。
请求代码request.sh
curl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_baidu_tieba_scrape_content' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"maxCommentsPerPost": 1,
"maxPosts": 1,
"maxRepliesPerComment": 0,
"timeout": 300,
"urls": [
{
"url": "https://tieba.baidu.com/p/11191193772"
}
]
}
}'返回示例response.json
{
"description": "task accepted; poll the result via query_tool with this task_id",
"query_tool": "ae_get_result",
"status": "created",
"task_id": "370cd169-1e2f-4ea5-9d9b-af2b941db712"
}返回示例仅展示部分内容,不代表完整响应;复制内容为合法 JSON。

