Extract JSON from a web page
extract_page_jsonRead one public web page and fill a JSON object from it. Pass a JSON Schema in schema, a prompt in plain words, or both. A small model reads the first 12000 characters of the page's Markdown and fills the object; code then checks it against the schema's type, required, properties, items and enum keywords, and returns null with a warning when it does not match. Every value comes with its source: the start and end of the same text in the page, or found false when the page does not say it word for word. robots.txt, the per-site pace and the daily caps are the same as fetch_page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Full address of one public web page, such as "https://example.com/pricing". http is upgraded to https. | |
| prompt | No | What to pull from the page, in plain words. Needed when there is no schema. | |
| schema | No | A JSON Schema for the answer, such as {"type":"object","properties":{"price":{"type":"string"}},"required":["price"]}. The answer is checked against its type, required, properties, items and enum keywords. At most 8000 characters of JSON. | |
| include_markdown | No | Set true to also return the Markdown the model read. Default false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| json | No | ||
| note | Yes | ||
| as_of | Yes | ISO 8601 time the data was published by its source or fetched from it. A cached answer keeps the time of its fetch. | |
| model | No | ||
| notes | No | ||
| title | No | ||
| reason | No | ||
| source | Yes | Who the data comes from, to cite and to check it against. | |
| status | Yes | ||
| message | No | ||
| sources | No | ||
| warning | No | ||
| grounded | No | ||
| markdown | No | ||
| final_url | No | ||
| fetched_at | No | ||
| from_cache | No | ||
| untrusted_source | Yes | ||
| retry_after_seconds | No |