Web Extract

每个计费页面或站点地图 32.5 积分
ae_web_extract

提取公开网页的可读正文并发现站内链接,也可按指定深度和页数抓取多个页面。结果以 JSON 返回,可包含页面标题、最终 URL、语言、Markdown 正文、发现的链接及各抓取页面的信息。

效率工具
每个计费页面或站点地图 32.5 积分

价格说明

模式费用
单页或站点地图每个计费请求 32.5 积分
多页抓取每个计费页面 32.5 积分

单页抓取和站点地图按完成的请求计费,多页抓取按实际计费页数结算。

工具参数

未传入的可选参数将使用平台默认值。

参数类型必填说明默认值
urlstring是暂无参数说明。—
modeenum (scrape | map | crawl)否Parameter defines the extraction mode. It can be set to: `scrape` (default) - Extract a single page. `map` - List the website's URLs from the page links and sitemaps. `crawl` - Follow links on the same website and extract every page visited. **Crawl mode consumes one search credit per successfully extracted page.**—
deviceenum (desktop | tablet | mobile)否Parameter defines the device to use to get the results. It can be set to `desktop` (default) to use a regular browser, `tablet` to use a tablet browser (currently using iPads), or `mobile` to use a mobile browser.—
timeoutnumber否Parameter defines the HTTP request timeout in milliseconds (1,000–120,000). Default: `30,000` (30 seconds).—
max_depthinteger否Used with `mode=crawl`. Parameter defines how many links deep the crawl follows from the starting page. `0` extracts only the starting page. Default: `2`. Maximum: `3`.2
max_pagesinteger否Used with `mode=crawl`. Parameter defines the maximum number of pages to extract, including the starting page. Default: `10`. Maximum: `100`. Each successfully extracted page consumes one search credit.10
exclude_tagsstring否Parameter defines a comma-separated list of CSS selectors to remove before parsing, e.g. `nav, footer, .ads, #cookie-banner`.—
include_tagsstring否Parameter defines a comma-separated list of CSS selectors to keep, e.g. `article, main, .post-content`. Everything else inside is removed before parsing.—
prefetch_delaynumber否Parameter defines a delay in milliseconds before the first page is fetched (0–10,000). Default: `0`. The Extract API doesn't run JavaScript, so this is not a rendering delay.—
include_sitemapboolean否Used with `mode=map`. Parameter defines whether to also read the website's sitemaps, from `/sitemap.xml` and `/robots.txt`. Default: `true`.—
include_markdownboolean否Parameter defines whether to include the page's main content as Markdown in `markdown`. Default: `true`.—
include_subdomainsboolean否Used with `mode=map` and `mode=crawl`. Parameter defines whether to include other subdomains of the same website, e.g. `blog.example.com` when starting from `www.example.com`. Default: `false` (same host only).—

调用示例

参数模板

根据参数配置生成,使用前请替换示例值。

POST/agent-api/v1/tool/executeX-Api-Key
请求代码request.sh
curl --request POST \
  --url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_web_extract' \
  --header "X-Api-Key: $AGENTEARTH_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "params": {
    "url": "xxx"
  }
}'

暂无返回示例。