{
"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/14427/page+and+screenshot+data+api/36435/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/14427/page+and+screenshot+data+api/36436/extract+from+screenshot?expiration_seconds=600&value_field=value&last_value=4012.5&url=https://www.investing.com/commodities/gold&llm_instructions=Current gold price in USD as a number, in a field called value' --header 'Authorization: Bearer YOUR_API_KEY'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 Page And Screenshot Data API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
Page And Screenshot 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对象:data,即您在指令中要求的字段,以及validation,检查主要数值(状态正常、可疑、拒绝或未检查,原因,页面上书写的原始文本和使用的阈值)
用简单的语言,通过parse_description(文本端点)或llm_instructions(截屏端点)获取。命名您想要返回的字段,例如“产品名称,美元价格作为数字和可用性,在名为name、price和in_stock的字段中”
默认使用“从页面提取”:它更快,并且对页面文本有效。当数据仅在页面渲染后显示时(例如图表、小部件、画布表或JavaScript密集型应用),切换到“从截图提取”
是否数字实际上写在页面上(on_page)、是否看起来像是小数位移动(x10、x100),以及它从上一个相同URL和指令接受的值移动了多远。您总是会收到答案;状态告诉您该多信任它
是的 将last_value与您为该URL和指令存储的最后一个数字一起发送 验证会与它进行比较而不是服务历史 当您的答案有多个数字时使用value_field
不 页面和答案在expiration_seconds(默认600秒)之前被重复使用于相同的URL和指令 发送0以强制获取新的内容
提取页面内容从服务器呈现的文本 对于仅在页面运行脚本后出现的内容,请使用提取自截图,该方法在读取之前在浏览器中渲染页面
响应包含错误为真和描述问题的消息(被阻止的页面 超时 上游错误)该调用不会计为成功
两个端点返回结构化的JSON数据 从页面提取端点提供基于页面HTML文本的字段,而从屏幕截图提取则返回渲染内容的数据,例如图表或小部件 每个响应包括带有数字值状态的验证块
响应数据中的关键字段包括"value",其中包含提取的数字数据,以及"raw_text",显示页面上的原始文本。验证块包括"status"、"reason"和"on_page"。状态标记了置信度。提取的值总是会返回
响应数据分为两个主要部分:"data"和"validation"。"data"部分包含提取的字段,而"validation"部分包括状态和任何差异的原因
页面提取适用于基于文本的数据,如价格和规格,而截图提取则专为需要呈现的视觉数据而设计,例如图表和动态内容。这两个端点都可以根据用户指令提取各种类型的信息
用户可以通过指定“parse_description”来定制Extract From Page的请求,或通过指定“llm_instructions”来定制Extract From Screenshot的请求。他们可以定义想要提取的字段,并提供“last_value”,即与之比较的前一个数字
数据来源于公开可访问的网页 API直接从指定的URL获取内容 验证添加状态 这不会改变提取的值
一个验证层将提取的数值与页面文本、历史值和潜在的小数位移进行检查 提取的值始终返回 状态标记对该值的信心
典型的用例包括商品价格监测 竞争对手分析 提取产品规格 以及为人工智能系统提供实时数据 该API特别适用于需要根据网页设计变化调整数据提取的场景