AI Web Extraction API

API ID 14423

Turn any public web page into structured JSON with a plain-language instruction. Every numeric answer comes with a validation block that checks it against the page text and its history.

100% 正常运行时间 2,435 ms 平均响应

API 文档

端点

请求
获取给定URL的页面(缓存时间为expiration_seconds,默认10分钟)并请求语言模型提供parse_description中描述的字段。数字答案会与页面文本和之前接受的相同URL和指令的值进行校验;校验结果将在验证对象中返回,并且不会影响答案。默认使用此端点
Endpoint ID: 36427
GET https://zylalabs.com/api/14423/ai+web+extraction+api/36427/extract+from+page
输入参数

页面摘录 — 端点功能

对象 描述
url 必需 Page to extract from: full URL including http:// or https://.
parse_description 必需 What to extract from the page, in plain language. Name the fields you want back.
expiration_seconds 可选 Reuse a previous scrape and answer for the same URL and instruction if it is at most this many seconds old. Default 600 (10 minutes). 0 forces a fresh scrape.
raw_text 可选 true: the model also returns the value exactly as written on the page, in data and in validation.raw_text. Default false.
value_field 可选 Key of the answer that holds the number to check, when the answer has more than one number. Default: the answer's single number.
last_value 可选 Your last known value for this URL and instruction; big jumps against it are flagged in validation. Default: the service's own history.
max_chars 可选 Characters of page text sent to the model after pruning. Default 6000. 0 sends the whole page.

剩余免费测试请求:3 / 3。


输入参数

url
parse_description
expiration_seconds
raw_text
value_field
last_value
max_chars
API 示例响应
JSON
{
    "data": [
        {
            "value": "4010.00",
            "raw_text": "4,010.00"
        }
    ],
    "validation": {
        "status": "ok",
        "reason": "no_reference",
        "value": 4010,
        "model_value": 4010,
        "raw_text": "4,010.00",
        "reference": null,
        "change_pct": null,
        "suspect_pct": 10,
        "reject_pct": 30,
        "on_page": true,
        "votes": [],
        "mode": "shadow",
        "reference_source": null
    }
}
页面摘录 — 代码片段

curl --location --request GET 'https://zylalabs.com/api/14423/ai+web+extraction+api/36427/extract+from+page?url=https://www.investing.com/commodities/gold&parse_description=Current gold futures price as a plain number, in a field called value&expiration_seconds=600&raw_text=true&value_field=value&last_value=4012.5&max_chars=6000' --header 'Authorization: Bearer YOUR_API_KEY' 


    
请求
在浏览器中渲染页面,保存整页截图,并请求视觉模型获取llm_instructions中描述的字段。当数据仅在页面渲染后出现时使用:图表、组件、画布表或依赖JavaScript的应用程序。比从页面提取要慢。数字答案会与其历史记录进行核对,并在验证对象中报告。
Endpoint ID: 36428
GET https://zylalabs.com/api/14423/ai+web+extraction+api/36428/extract+from+screenshot
输入参数

从截图中提取 — 端点功能

对象 描述
url 必需 Page to extract from: full URL including http:// or https://.
llm_instructions 必需 What to read from a screenshot of the page, in plain language. Name the fields you want back.
expiration_seconds 可选 Reuse a previous screenshot and answer for the same URL and instruction if it is at most this many seconds old. Default 600 (10 minutes). 0 forces a fresh capture.
value_field 可选 Key of the answer that holds the number to check, when the answer has more than one number. Default: the answer's single number.
last_value 可选 Your last known value for this URL and instruction; big jumps against it are flagged in validation. Default: the service's own history.

剩余免费测试请求:3 / 3。


输入参数

url
llm_instructions
expiration_seconds
value_field
last_value
API 示例响应
JSON
{
    "data": [
        {
            "value": 4066.5
        }
    ],
    "validation": {
        "status": "ok",
        "reason": "no_reference",
        "value": 4066.5,
        "model_value": 4066.5,
        "raw_text": null,
        "suspect_pct": 10,
        "reject_pct": 30,
        "on_page": null,
        "votes": [],
        "mode": "shadow"
    }
}
从截图中提取 — 代码片段

curl --location --request GET 'https://zylalabs.com/api/14423/ai+web+extraction+api/36428/extract+from+screenshot?url=https://www.investing.com/commodities/gold&llm_instructions=Current gold price in USD as a number, in a field called value&expiration_seconds=600&value_field=value&last_value=4012.5' --header 'Authorization: Bearer YOUR_API_KEY' 


    

API 访问密钥和身份验证

注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 AI Web Extraction API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。

标头
标头 描述
授权 必需 应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。

无长期承诺。随时升级、降级或取消。

(年度计费可节省 2 个月 🎉)

起价
$10,000/年


  • 自定义数量
  • 自定义速率限制
  • 专业客户支持
  • 实时 API 监控

概览

AI Web Extraction API turns any public web page into structured JSON. Send a URL and say in plain language what you need, for example current gold futures price as a number, in a field called value. The service fetches the page, prunes it, asks a large language model for exactly those fields and returns them as JSON.

What makes it different: validated numbers

Language models misread pages: they drop a decimal point (27015 instead of 270.15), pick a neighbouring row, or echo a number from the instruction. Every numeric answer is therefore checked before it is returned:

  • On the page. The raw text the model read is searched in the page it was extracted from. If it is not there, the value was invented or misread.
  • Decimal shift. Values that are exactly x10, x100, x0.1 or x0.01 of the previous value are flagged.
  • Outlier. The value is compared with the last accepted value for the same URL and instruction (or with last_value if you send yours).

The result comes in a validation object: status (ok, suspect, rejected or unchecked), reason, raw_text exactly as written on the page, on_page, and the thresholds used. The check is informational: you always receive the answer and decide what to do with it. The same pipeline runs in production on hundreds of thousands of extractions per month for commodity, metal and index prices.

Two endpoints

  • Extract From Page reads the HTML text of the page. Fast and cheap; use it by default.
  • Extract From Screenshot renders the page, takes a full-page screenshot and asks a vision model. For charts, widgets, canvas tables and JavaScript-heavy apps whose data only appears once rendered.

Both accept an optional cache window (expiration_seconds, default 10 minutes), your own reference value (last_value) and the name of the field that holds the number when the answer has several (value_field).

Example

Request: the URL of a gold futures quote page and parse_description=Current gold futures price as a plain number, in a field called value

{
  "data": [{ "value": "4010.00", "raw_text": "4,010.00" }],
  "validation": {
    "status": "ok", "reason": "no_reference",
    "value": 4010.0, "raw_text": "4,010.00", "on_page": true,
    "suspect_pct": 10.0, "reject_pct": 30.0
  }
}

Typical uses

  • Price monitoring from supplier, exchange or retailer pages
  • Competitor tracking: prices, availability, specs
  • Pulling figures from reports, dashboards and statistics pages
  • Feeding AI agents with live numbers they can trust
  • Replacing brittle CSS selectors with one instruction that survives page redesigns

Good instructions

Name the fields you want back and be specific about which number: "the Last Price in the quote header, keeping its decimal point, in a field called value" works better than "the price". Do not put example numbers or ranges in the instruction: if the data is missing, a model tends to return the example.

AI Web Extraction API FAQs

一个包含两个部分的JSON对象:数据,您在指令中要求的字段,以及验证,对主要数值的检查(状态正常、可疑、被拒绝或未检查,原因,页面上写的原始文本和使用的阈值)

用简单的语言,通过parse_description(文本端点)或llm_instructions(截图端点)命名您想要返回的字段,例如“产品名称、价格(以美元为数字)和库存情况,字段分别命名为name、price和in_stock”

默认使用从页面提取:它更快并且适用于页面文本。当数据仅在页面呈现后显示时,比如图表、小部件、画布表格或JavaScript密集型应用程序,请切换到从屏幕截图提取

数字是否实际上写在页面上(on_page),它是否看起来像是小数位移(x10,x100),以及它从上一个接受的相同URL和指令的值移动了多远。你总是会收到答案;状态告诉你有多少值得信任它

是的 发送last_value与您为该URL和指令存储的最后一个数字进行比较 验证将与其进行比较,而不是服务历史 当您的答案包含多个数字时使用value_field

不 该页面和答案在 expiration_seconds(默认为600秒)之前被重用用于相同的URL和指令 发送0以强制进行新的获取

提取自页面读取服务器渲染的文本。对于仅在页面运行脚本后出现的内容,请使用从截图中提取,这将在浏览器中渲染页面后再读取它

响应的错误为真,并附有描述问题的消息(页面被阻止 超时 上游错误)该调用不被视为成功

请列出您想要的字段,并说明您指的是哪个编号(“报价头中的最后价格,保持其小数点,在一个名为值的字段中”)。避免在说明中使用示例数字或范围:当数据缺失时,模型往往会返回示例。

不 验证块是信息性的:您始终会获得提取的值,以及状态 原因和原始文本是否在页面上被找到 当数字很重要时 请根据状态在您这边拒绝或重试

一般常见问题

Zyla API Hub 就像一个大型 API 商店,您可以在一个地方找到数千个 API。我们还为所有 API 提供专门支持和实时监控。注册后,您可以选择要使用的 API。请记住,每个 API 都需要自己的订阅。但如果您订阅多个 API,您将为所有这些 API 使用相同的密钥,使事情变得更简单。
价格以 USD(美元)、EUR(欧元)、CAD(加元)、AUD(澳元)和 GBP(英镑)列出。我们接受所有主要的借记卡和信用卡。我们的支付系统使用最新的安全技术,由 Stripe 提供支持,Stripe 是世界上最可靠的支付公司之一。如果您在使用卡片付款时遇到任何问题,请通过 [email protected]

此外,如果您已经以这些货币中的任何一种(USD、EUR、CAD、AUD、GBP)拥有有效订阅,该货币将保留用于后续订阅。只要您没有任何有效订阅,您可以随时更改货币。
定价页面上显示的本地货币基于您 IP 地址的国家/地区,仅供参考。实际价格以 USD(美元)为单位。当您付款时,即使您在我们的网站上看到以本地货币显示的等值金额,您的卡片对账单上也会以美元显示费用。这意味着您不能直接使用本地货币付款。
有时,银行可能会因其欺诈保护设置而拒绝收费。我们建议您首先联系您的银行,检查他们是否阻止了我们的收费。此外,您可以访问账单门户并更改关联的卡片以进行付款。如果这些方法不起作用并且您需要进一步帮助,请通过 [email protected]
价格由月度或年度订阅决定,具体取决于所选计划。
API 调用根据成功请求从您的计划中扣除。每个计划都包含您每月可以进行的特定数量的调用。只有成功的调用(由状态 200 响应指示)才会计入您的总数。这确保失败或不完整的请求不会影响您的月度配额。
Zyla API Hub 采用月度订阅系统。您的计费周期将从您购买付费计划的那一天开始,并在下个月的同一日期续订。因此,如果您想避免未来的费用,请提前取消订阅。
要升级您当前的订阅计划,只需转到 API 的定价页面并选择您要升级到的计划。升级将立即生效,让您立即享受新计划的功能。请注意,您之前计划中的任何剩余调用都不会转移到新计划,因此在升级时请注意这一点。您将被收取新计划的全部金额。
要检查您本月剩余多少 API 调用,请参考响应标头中的 "X-Zyla-API-Calls-Monthly-Remaining" 字段。例如,如果您的计划允许每月 1,000 个请求,而您已使用 100 个,则响应标头中的此字段将显示 900 个剩余调用。
要查看您的计划允许的最大 API 请求数,请检查 "X-Zyla-RateLimit-Limit" 响应标头。例如,如果您的计划包括每月 1,000 个请求,此标头将显示 1,000。
"X-Zyla-RateLimit-Reset" 标头显示您的速率限制重置之前的秒数。这告诉您何时您的请求计数将重新开始。例如,如果它显示 3,600,则意味着还有 3,600 秒直到限制重置。
是的,您可以随时通过访问您的账户并在账单页面上选择取消选项来取消您的计划。请注意,升级、降级和取消会立即生效。此外,取消后,您将不再有权访问该服务,即使您的配额中还有剩余调用。
为了让您有机会在没有任何承诺的情况下体验我们的 API,我们提供 7 天免费试用,允许您免费进行最多 50 次 API 调用。此试用只能使用一次,因此我们建议将其应用于您最感兴趣的 API。虽然我们的大多数 API 都提供免费试用,但有些可能不提供。试用在 7 天后或您进行了 50 次请求后结束,以先发生者为准。如果您在试用期间达到 50 次请求限制,您需要"开始您的付费计划"以继续发出请求。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。或者,如果您在第 7 天之前不取消订阅,您的免费试用将结束,您的计划将自动计费,授予您访问计划中指定的所有 API 调用的权限。请记住这一点以避免不必要的费用。
7 天后,您将被收取试用期间订阅的计划的全额费用。因此,在试用期结束前取消很重要。因忘记及时取消而提出的退款请求不被接受。
当您订阅 API 免费试用时,您可以进行最多 50 次 API 调用。如果您希望超出此限制进行额外的 API 调用,API 将提示您执行"开始您的付费计划"。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。
付款订单在每月 20 日至 30 日之间处理。如果您在 20 日之前提交请求,您的付款将在此时间范围内处理。
您可以通过我们的聊天渠道联系我们以获得即时帮助。我们始终在线,时间为上午 8 点至下午 5 点(EST)。如果您在该时间之后联系我们,我们将尽快回复您。此外,您可以通过 [email protected]

相关 API


您可能还喜欢