{
"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'
{
"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 端点。要使用 AI Web Extraction API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 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.
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:
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.
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).
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
}
}
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.
一个包含两个部分的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以强制进行新的获取
提取自页面读取服务器渲染的文本。对于仅在页面运行脚本后出现的内容,请使用从截图中提取,这将在浏览器中渲染页面后再读取它
响应的错误为真,并附有描述问题的消息(页面被阻止 超时 上游错误)该调用不被视为成功
请列出您想要的字段,并说明您指的是哪个编号(“报价头中的最后价格,保持其小数点,在一个名为值的字段中”)。避免在说明中使用示例数字或范围:当数据缺失时,模型往往会返回示例。
不 验证块是信息性的:您始终会获得提取的值,以及状态 原因和原始文本是否在页面上被找到 当数字很重要时 请根据状态在您这边拒绝或重试