{
"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/14424/extract+web+page+data+api/36429/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/14424/extract+web+page+data+api/36430/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 端点。要使用 Extract Web Page Data API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
Extract Anything 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对象:data,您在指令中要求的字段,以及validation,主要数值的检查(状态正常、可疑、被拒绝或未检查,原因,页面上写的原始文本和使用的阈值)
用通俗的语言,通过parse_description(文本端点)或llm_instructions(截图端点)。命名你想要返回的字段,例如“产品名称、美元价格作为数字和可用性,字段分别叫做name、price和in_stock”
默认使用从页面提取:它更快并且可以对页面文本进行操作。当数据仅在页面呈现后显示时,如图表、小部件、画布表或JavaScript密集型应用程序,请切换到从截图提取
无论数字是否实际上写在页面上(on_page)无论它是否看起来像十进制移动(x10,x100)以及它距离上一个接受的相同URL和指令的值移动了多远。你总是会收到答案;状态告诉你有多少信任它
是的 发送 last_value 与您为该 URL 和指令存储的最后一个数字进行比较 验证将根据它进行比较而不是服务历史记录 当您的答案有多个数字时使用 value_field
不 该页面和答案在小于过期秒数(默认600秒)时被重复使用于相同的URL和指令 发送0可强制刷新获取
从页面提取读取服务器呈现的文本对于在页面运行脚本后才出现的内容,请使用从截图提取,它会在浏览器中呈现页面然后再读取它
响应带有错误为真和描述问题的消息(被阻止的页面 超时 上游错误)该调用不计为成功
两个端点返回结构化的JSON数据。从页面提取的端点提供基于页面文本的字段,而从截图提取的端点返回源自渲染视觉的数据显示,例如图表或小部件
关键字段包括“数据”,其中包含提取的值,以及“验证”,它提供了提取的状态、任何差异的原因,以及与先前值的检查
返回的数据是JSON格式,结构包含一个“data”数组用于提取的值和一个“validation”对象,里面有状态、原因和历史比较
提取页面适用于基于文本的数据,如价格和规格,而提取屏幕截图则非常适合视觉数据,如图表和需要渲染的动态内容
用户可以通过指定“parse_description”来定制从页面提取的请求或“llm_instructions”来定制从截图提取的请求,详细说明他们想要提取的确切字段
在验证对象中“status”表示对提取的信心(ok suspect rejected)“reason”解释任何问题“on_page”确认值是否在页面文本中找到
验证层会将数字值与页面文本、历史数据和小数位移等模式进行核对 提取的值始终会被返回,包括在状态被拒绝时 状态指示置信度
典型的用例包括价格监测 竞争对手分析 提取产品规格以及为人工智能系统提供来自各种网络源的实时数据