{
"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/14428/natural+language+web+scraper+api/36437/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/14428/natural+language+web+scraper+api/36438/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 端点。要使用 Natural Language Web Scraper API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
Natural Language Web Scraper 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与您为该URL和指令存储的最后一个数字一起使用验证将与其进行比较而不是服务历史记录 当您的答案有多个数字时使用value_field
不是 页面和答案在过期秒数(默认为600秒)之前被重新使用于相同的URL和指令 发送0以强制重新获取
从页面提取读取服务器渲染的文本 对于仅在页面运行脚本后才出现的内容,请使用从截图提取,它在读取之前在浏览器中渲染页面
响应带有错误为真,并提供描述问题的消息(页面被阻止 超时 上游错误)该调用不被视为成功
两个端点返回结构化的 JSON 数据 "从页面提取" 端点根据页面文本提供字段 "从截图提取" 返回渲染视觉的数据 每个响应都包括一个 "数据" 部分包含请求的字段和一个 "验证" 部分用于数字检查
响应数据中的关键字段包括“value”(提取的数值数据)、“raw_text”(页面上出现的文本)和“validation”对象,其中包含状态、原因和产生该状态的检查
响应数据分为两个主要部分:“数据”和“验证”。“数据”部分包含提取的字段,而“验证”部分包括状态和任何差异的原因
“从页面提取”端点可以检索基于文本的数据,如价格、产品规格和可用性。“从截图提取”端点适用于需要渲染才能显示的视觉数据,例如图表、图形和动态内容
用户可以通过为“从页面提取”端点指定“parse_description”或为“从截图提取”端点指定“llm_instructions”来自定义请求 他们可以定义想要提取的字段并提供可选参数,如“expiration_seconds”和“last_value”
数据来自公开可访问的网页 API直接从指定的URL获取内容 验证将提取的值与页面文本进行比较并添加状态 不会更改值
一个验证层检查提取的数值与页面文本、历史数据和潜在的小数偏移进行比较 每个响应都包含一个验证状态 提取的值始终返回,并且状态指示置信度
典型用例包括商品价格监测、竞争对手分析、从电子商务网站提取产品规格,以及从报告或仪表板收集数据。该API旨在优化数据提取以适用于各种应用,增强决策过程