{
"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/14426/data+from+any+url+api/36433/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/14426/data+from+any+url+api/36434/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 端点。要使用 Data From Any URL API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
Data From Any URL 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 并且验证与它进行比较而不是服务历史 使用value_field当你的答案有几个数字时
不 页面和答案在过期秒数(默认600秒)之前被重用同一URL和指令 发送0以强制进行新的获取
提取自页面读取服务器渲染的文本。对于仅在页面运行其脚本后显示的内容,请使用从屏幕截图提取,这会在浏览器中渲染页面然后读取它
响应带有错误为真和描述问题的消息(被阻塞的页面 超时 上游错误)此调用不被计为成功
两个端点返回结构化的 JSON 数据。从页面提取端点根据页面的文本提供字段,而从屏幕截图提取端点返回来自呈现内容的数据,例如图表或小部件。每个响应都包括一个有效性块,其中包含数字值的状态
响应数据中的关键字段包括“value”(提取的数值数据) “raw_text”(页面上的文本)和“validation”对象 它包含状态 理由和产生该状态的检查
响应数据组织为两个主要部分:“数据”和“验证”。“数据”部分包含提取的字段,而“验证”部分包括状态和任何差异的原因
提取页面端点可以检索任何基于文本的数据,例如价格、规格或可用性。提取屏幕截图端点旨在处理需要渲染的视觉数据,例如图表或来自JavaScript重应用程序的动态内容
一个验证层检查提取的数值与页面文本、历史值和潜在的小数位移进行比对 提取的值始终返回 状态标记对该值的信心
典型的用例包括商品价格监控 竞争对手分析 提取产品规格以及为人工智能系统提供实时数据 该API在数据提取需要适应网页设计变更的场景中特别有用
用户可以通过为“从页面提取”指定“parse_description”或为“从截图提取”指定“llm_instructions”来自定义数据请求。他们可以定义所需的字段,例如“美元价格”或“可用性”,并包含参数,例如“expiration_seconds”用于缓存
质量检查包括与页面文本的验证以确认数值的存在、与历史数据的比较以及对小数位移的检查。验证对象记录这些检查和状态。它不会改变提取的值