Web Scraping API

Web Scraping 爬取网站 API

爬取一个网站,在一个标准化响应中返回最多 10 个页面的干净文本内容,适合把网站内容输入 LLM 和搜索索引。

US$1.25/千条结果,按请求付费,无需订阅。

Example
example.com

Example - Build something great

Example is the platform teams use to ship faster…

Get startedView docs
1
2
3
API 返回的内容items[0]
{
"url": "https://www.example.com",
"title": "Example - Build something great",
"text": "Example is the platform teams use to ship faster…",
"author": string | null,
"canonicalUrl": string | null,
"contentType": string | null,
"description": string,
"domain": string,
... 还有 9 个字段
}
可用率
95.53%
30d · 1,208 次调用
请求数
1,215
30d · 按周,近 12 周
响应时间
10.4s
中位数 · 30d

价格与服务商

Web Scraping 爬取网站 API 价格:一个 API,3 个可互换的服务商

最便宜的服务商优先响应。如果它失败,下一个会在同一次调用中接手。

你需支付
US$12.50
US$1.25/千条结果,只为实际用量付费。没有月度套餐。
单次请求最多 US$0.0125(10 results)。
US$0.10 的初始余额至少够 8 次请求。

试一试

一个请求获取 Web Scraping 爬取网站

requireFieldsarray
Optional; omit it and routing is unchanged. Name the output fields this request must be able to return, for example `language`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. Every source charges the same per page, so this never changes your price. A named field can still be empty on a page that genuinely lacks it.
打开于
获取免费密钥
示例响应
免费运行只返回前 3 条结果。为密钥充值即可获得完整响应。

这个示例展示了 31 个字段中的 6 个。查看全部字段

{
  "found": true,
  "data": {
    "items": [
      {
        "url": "https://www.example.com",
        "title": "Example - Build something great",
        "text": "Example is the platform teams use to ship faster…"
      },
      {
        "url": "https://www.example.com/pricing",
        "title": "Pricing - Example",
        "text": "Simple plans for teams of every size…"
      }
    ]
  }
}

完整的参数与响应参考:这个接口的每个字段、类型和示例。

参考

一个请求,一种响应结构。

你发送的每个字段和收到的每个字段,都附有真实示例。

最近验证于 2026-11-14 · 可用率和延迟按 30d 统计

请求体

JSON,POST 到这个接口。

  • urlstring

    https://www.example.com

    The website URL or domain to crawl. Pages linked from it on the same site are crawled too.

  • limitinteger

    Maximum number of pages to crawl and return (1-10, default 10). You are billed per page returned, so a lower limit costs less.

  • requireFieldsarray

    Optional; omit it and routing is unchanged. Name the output fields this request must be able to return, for example `language`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. Every source charges the same per page, so this never changes your price. A named field can still be empty on a page that genuinely lacks it.

你发送。 一个简短的 JSON 请求体。显示的值只是示例,请换成你自己的。

响应

JSON,每个字段一个示例值。

each issuedata.issues[]

Pages the crawl reported as failed or skipped. They are never in items and never billed. The list holds what the crawl reported, not every page of the site.

  • outcome"failed" | "robots_disallowed" | "skipped"

    failed: the page could not be fetched or answered with an HTTP error. robots_disallowed: the site's robots.txt does not allow crawling it. skipped: the crawl did not fetch it, for example because it is outside the crawled site.

  • statusCodeinteger

    The HTTP status code the page answered with, or null when unknown.

  • urlstring

    The page's URL.

each itemdata.items[]

One record per crawled page: its URL and domain, page title, meta description, language, HTTP status, the page content as Markdown text, and the page metadata the source reports. You are billed for these pages only. Populated whenever the provider has data for the entity.

  • authorstring可设为必填

    The author the page declares, or null when unknown.

  • canonicalUrlstring可设为必填

    The canonical URL the page declares in its own markup, or null when it declares none or the source does not report it.

  • contentTypestring可设为必填

    The content type the page was served with (for example text/html;charset=utf-8), or null when unknown.

  • descriptionstring

    The page's meta description, empty when the page has none.

  • domainstring

    The page's host name, without a leading www. Populated whenever the provider has data for the entity.

  • jsonLdany[]可设为必填

    The JSON-LD structured data blocks the page publishes (schema.org Organization, LocalBusiness, BreadcrumbList and so on), as parsed JSON, or null when the source does not report them. They are the publisher's own claims, not verified facts.

  • languagestring可设为必填

    The page's declared language code (for example en-US), or null when unknown.

  • modifiedUtcinteger可设为必填

    When the page says it was last modified, as a UTC epoch timestamp in seconds (Unix time), or null when unknown. Multiply by 1000 for a JS Date in milliseconds.

  • publishedUtcinteger可设为必填

    When the page says it was published, as a UTC epoch timestamp in seconds (Unix time), or null when unknown. Multiply by 1000 for a JS Date in milliseconds.

  • robotsstring可设为必填

    The page's robots meta directives (for example noindex, nofollow), or null when it declares none or the source does not report them.

  • siteNamestring可设为必填

    The site name the page declares (its og:site_name), or null when unknown.

  • sourceUrlstring

    The URL the crawler requested for this page, before any redirect, or null when unknown.

  • statusCodeinteger

    The HTTP status code the page answered with, or null when unknown.

  • textstring

    Example is the platform teams use to ship faster…

    The page content as Markdown. Populated whenever the provider has data for the entity.

  • titlestring

    Example - Build something great

    The page title, empty when the page has none (a PDF, for example).

  • urlstring

    https://www.example.com

    The crawled page's URL, after any redirect. Populated whenever the provider has data for the entity.

each headingdata.items[].headings[]

The page's headings in document order, each with its level (1 for an h1) and text, or null when the source does not report them.

  • levelinteger

    The heading level, 1 to 6.

  • textstring

    The heading text.

summarydata.summary

Counts for this crawl. They describe the pages this crawl visited and reported, not the whole website, and are not added together into a total.

  • pagesReturnedinteger

    The number of pages in items, which is the number you are billed for.

  • reportedFailedinteger

    The number of pages the crawl reported as failed, or null when the source does not report a complete count.

  • reportedSkippedinteger

    The number of pages the crawl reported as skipped, including those robots.txt disallows, or null when the source does not report a complete count.

top level
  • foundboolean

    true

  • reason"not_found"

    Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost.

你收到。 字段有名称、有类型,无论哪个数据源响应,结构都一样。

常见问题

关于 Web Scraping 爬取网站 API

AnyAPI 的 Web Scraping 爬取网站 API 只需一次 POST 请求 /v1/run/web.crawl,就以统一格式的 JSON 返回 Web Scraping 数据。爬取一个网站,在一个标准化响应中返回最多 10 个页面的干净文本内容,适合把网站内容输入 LLM 和搜索索引。AnyAPI 会在 3 个数据源之间路由每个请求,某个数据源失败时自动切换。费用:每千条结果 US$1.25,单次请求最多 US$0.0125,以美元计价,无需订阅,也没有每月最低消费。过去 30 天,通过 AnyAPI 发起的 Web Scraping 爬取网站 API 调用中有 95.5% 成功,响应时间中位数为 10.4 秒,共测量 1,208 次调用。

费用:每千条结果 US$1.25,单次请求最多 US$0.0125,以美元计价,无需订阅,也没有每月最低消费。你只需为一个美元钱包充值,每次调用从中扣费。部分由钱包付费的失败请求会产生处理费用,我们按成本原价转嫁,不加价;错误响应会显示收取的金额。

爬取一个网站,在一个标准化响应中返回最多 10 个页面的干净文本内容,适合把网站内容输入 LLM 和搜索索引。响应是统一格式的 JSON,外层结构与每个 AnyAPI 接口相同,所以解析另一个接口只需换一个 URL,别的都不用改。

过去 30 天,通过 AnyAPI 发起的 Web Scraping 爬取网站 API 调用中有 95.5% 成功,响应时间中位数为 10.4 秒,共测量 1,208 次调用。这些是 AnyAPI 对经过网关的流量的自有测量,持续重新计算,并非公开承诺的服务等级目标。

可以。新的 AnyAPI 账户自带 US$0.10 免费余额,无需绑卡,至少足够调用 8 次 Web Scraping 爬取网站,每次最多 US$0.0125。

AnyAPI 会在同一个请求中依次尝试它的 3 个数据源,从最便宜的开始,所以一个数据源宕机不会让你的调用失败。

向 https://api.getanyapi.com/v1/run/web.crawl 发送 POST 请求,在 “Authorization: Bearer” 请求头中放入你的 AnyAPI 密钥,并以 JSON 请求体传入参数。同一个密钥和同一个钱包适用于所有 AnyAPI 接口。

不需要。你向一个预付费的 AnyAPI 余额充值美元,每个请求从中扣费。没有月度套餐,也没有最低消费,同一个余额可用于所有 AnyAPI 接口。

有。TypeScript 用 npm 安装 @getanyapi/sdk,Python 用 pip 安装 getanyapi。两者都用同一个密钥调用所有 AnyAPI 接口,任何 HTTP 客户端也都可以。

可以。智能体可以连接 https://api.getanyapi.com/mcp 上的 AnyAPI MCP 服务器,或者向 https://api.getanyapi.com/agent/signup 发送一次无需认证的 POST 来创建自己的免费试用密钥,再通过 HTTP 调用这个接口。