{
"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/14425/web+page+data+api/36431/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/14425/web+page+data+api/36432/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 端点。要使用 Web Page Data API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
Web Page Data 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)以及它从上一个接受的同一网址和指令的值移动了多远 你总是会得到答案 状态告诉你有多少信任它
是的 发送last_value与您为该网址和指令存储的最后一个数字进行比较 验证会与它进行比较而不是服务历史 在您的答案有多个数字时使用value_field
不 该页面和答案在过期秒数(默认600秒)之前被重复使用于同一URL和指令 发送0以强制重新获取
提取自页面读取服务器渲染的文本。对于在页面运行其脚本后才出现的内容,请使用提取自截图,这会在浏览器中渲染页面后再读取它
响应带有错误 true 和描述问题的消息(被阻止的页面 超时 上游错误)该调用不计为成功
两个端点返回结构化的JSON数据。从页面提取端点根据页面的文本提供字段,而从截图提取端点返回基于渲染视觉内容的数据,例如图表或小部件
关键字段包括“数据”,其中包含提取的值,以及“验证”,它提供提取的状态、该状态的原因,并与页面文本和历史值进行核对
响应被组织为两个主要部分:“数据”,其中包含提取的信息,以及“验证”,详细说明对数值进行的准确性检查,包括状态和任何差异的原因
从页面提取可以获取基于文本的数据,如价格和规格,而从截图提取适合需要呈现的视觉数据,如图表或来自JavaScript密集页面的动态内容
用户可以通过指定“parse_description”来定制Extract From Page的请求或通过指定“llm_instructions”来定制Extract From Screenshot的请求,详细说明他们想要的确切字段,如“当前价格”或“可用性”
数据直接来自公共网页 API获取内容并使用语言模型或视觉模型处理它 确保信息来源于页面上的实际文本或渲染视觉元素
验证层检查数值与页面文本、历史值和潜在的小数位移动进行比较 提取的值始终返回 状态指示对该值的置信度
典型的用例包括对商品的价格监控 竞争对手分析 提取产品规格以及将实时数据输入到人工智能系统中 使基于提取的信息进行动态决策