html returns the cleaned page and rawHtml returns the page as the site sent it. Use html to keep the structure of the content, and rawHtml when you need every tag, script and style.
Make a request
This request asks for both formats so you can compare them.Read the response
Each format is a string indata. This real response is cut after the first paragraph of each format.
html has no head or styles, and by default only the main content of the page. rawHtml is the whole document.
Options
onlyMainContent, includeTags and excludeTags are described in Content filtering.
Limits and errors
- A PDF comes back as Markdown only. Asking for
htmlon a PDF returns400 invalidRequestwith the messageformats: a PDF comes back as markdown only. Ask for markdown. - A page that answers with a 404 or 410 status, or cannot be read, costs nothing.
Price
$1 per 1,000 pages, whether you ask forhtml, rawHtml or both.
Related
- Markdown returns the text instead.
- Bytes returns the bytes the site sent, Base64 encoded.
- Content filtering keeps or removes parts of the page.
- Browser actions change the page before it is read.