Extract a page's declared data
extract_declaredExtract structured data (JSON-LD, microdata, OpenGraph) a web page declares, showing the source and location of each value. Works from a URL or raw HTML.
Instructions
Read the structured data a page declares, with where each value came from.
html_or_url: an http(s) URL to fetch, or the HTML itself. induce: also read repeated rows (a listing, a feed) from a page that declares nothing about them; those fields say source "induced". at: a date (2024, 2024-06, 2024-06-01): read the URL as the Wayback Machine captured it nearest to then; "fetch" says which capture. respect_tdm: answer tdm_reserved instead of the page when the site reserves its text and data mining rights (TDMRep: its tdmrep.json, headers or meta tags). records: also return every record, not only the summary and what was normalised; false keeps the answer small. Records that would make the answer larger than 75,000 bytes are left out and counted in records_left_out. visible: also guess the title, author, publication and update dates the page shows a reader, in "visible", each {"value", "where", "rule"}; guesses, never part of the summary, which holds only what the page declares.
Returns {"ok", "url", "summary", "records", "sources"}, and "fetch" for a URL. records are typed fields, each {"value", "source", "where"}: source is the vocabulary that declared it (jsonld, microdata, opengraph, html, ...), where the XPath of the element that did -- for JSON-LD the block's, with a JSON pointer after "#" -- or null for a meta tag, whose key is its place. A nested value such as a price inside "offers" arrives whole. summary answers title, author, date, price and the rest, one value each, naming its source, key and where. conflicts lists each question the page answers two ways that mean different things -- a price of 41.90 in JSON-LD and 39.90 in OpenGraph -- the summary's answer first: say so rather than trusting either. On failure ok is false and "error" says why; there is never a record. An answer weighs at most 75,000 bytes: past it the records go first, counted in records_left_out, then the conflicts, counted in conflicts_left_out, then the heaviest summary, visible, normalised and links entries, each named in summary_left_out, visible_left_out, normalised_left_out or links_left_out.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | No | a date (2024, 2024-06, 2024-06-01): read the URL as the Wayback Machine captured it nearest to then; "fetch" says which capture. | |
| induce | No | also read repeated rows (a listing, a feed) from a page that declares nothing about them; those fields say source "induced". | |
| records | No | also return every record, not only the summary and what was normalised; false keeps the answer small. Records that would make the answer larger than 75,000 bytes are left out and counted in records_left_out. | |
| visible | No | also guess the title, author, publication and update dates the page shows a reader, in "visible", each {"value", "where", "rule"}; guesses, never part of the summary, which holds only what the page declares. | |
| html_or_url | Yes | an http(s) URL to fetch, or the HTML itself. | |
| respect_tdm | No | answer tdm_reserved instead of the page when the site reserves its text and data mining rights (TDMRep: its tdmrep.json, headers or meta tags). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| url | No | ||
| error | No | ||
| fetch | No | ||
| links | No | ||
| rights | No | ||
| records | No | ||
| sources | No | ||
| summary | No | ||
| visible | No | ||
| conflicts | No | ||
| normalised | No | ||
| links_left_out | No | ||
| records_left_out | No | ||
| summary_left_out | No | ||
| visible_left_out | No | ||
| conflicts_left_out | No | ||
| normalised_left_out | No |