GET 25 FREE SCREENSHOTS PER MONTH  →
API REFERENCE

Extract HTML

Fetch the fully rendered HTML of any web page instead of a screenshot by adding html_only=true to a snap request. Pass a CSS selector to get only one element's outerHTML.

BASE URL https://api.pagepixels.com
GET YOUR FREE API KEY →
ENDPOINT

Extract HTML

GET /snap

Instead of creating a screenshot, you can extract the fully rendered raw HTML from a web page using the snap endpoint and the html_only parameter.

Extract HTML functionality is optimized to fetch html content from websites and web applications that dynamically generate their HTML using JavaScript.

Note: Extract HTML uses 1 screenshot credit per request
Option Expected Value
url The URL to fetch HTML
access_token Your account's Private API Key.
html_only Pass html_only=true to retrieve the full HTML from the web page, instead of creating a screenshot of the web page.
selectors (Optional) Instead of the full HTML, returns only the outerHTML associated with an element identified by a CSS Selector.

Example: Get the full HTML for the entire page

The following example fetches the full raw HTML from the Mars Rover Perseverance's Wikipedia page:

GET REQUEST /snap http
https://api.pagepixels.com/snap?url=https://en.wikipedia.org/wiki/Perseverance_(rover)&access_token=your-api-key&html_only=true
JSON RESPONSE
{
  "success": true,
  "html": "\u003C!DOCTYPE html\u003E\u003Chtml..."
}

Example: Get only the HTML for a specified element

The example below fetches only the outerHTML for the table.infobox element from the Ring-tailed lemur's Wikipedia page:

GET REQUEST /snap bash
curl -X GET "https://api.pagepixels.com/snap" \
  --data-urlencode "url=https://en.wikipedia.org/wiki/Ring-tailed_lemur" \
  -d html_only=true \
  --data-urlencode "selectors=table.infobox" \
  -d access_token="your-api-key"
JSON RESPONSE
{
  "success": true,
  "html": "\u003ctable class=\"infobox biota\"..."
}

Support

Questions? Contact us anytime by email:

Or send us a message through our Support page.

FREE PLAN

Start free. Upgrade when you’re ready.

Every feature and integration is included on the free plan. No credit card and no phone number required.

Free $0 / month
25 screenshots every month
32 MB of Real Location proxy bandwidth
25 AI Analysis credits