GET 25 FREE SCREENSHOTS PER MONTH  →
API REFERENCE

Custom HTML Screenshots

Create screenshots from your own HTML content. Send the markup to the snap_html endpoint and get the rendered image back.

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

Custom HTML Screenshots

GET /snap_html

Creates screenshots from HTML content using the snap_html endpoint. This endpoint accepts HTML content directly and generates a screenshot based on the value of the html_content parameter.

Examples of how you can use Custom HTML Screenshot functionality:

  • Convert HTML versions of emails into screenshots of email messages
  • Create screenshots of data from third-party APIs
  • Create custom reports
Option Expected Value
html_content HTML content to convert into a screenshot.
access_token Your account's Private API Key.

Simple example of how to create a Custom HTML screenshot:

GET REQUEST /snap_html http
https://api.pagepixels.com/snap_html?html_content=<h1>Hello World</h1>&access_token=your-api-key

Returns a screenshot of the provided HTML content if successful.

JSON Parameter

By default, the snap_html endpoint returns the screenshot image as a raw binary. To return a link to the screenshot image instead, you can use the json parameter.

Key Description
json Pass json=true to receive links to the image and thumbnail, instead of the raw image.

Additional Notes

  • The snap_html endpoint respects all standard screenshot options.
  • The html_only=true flag is not applicable here since the HTML is provided directly.
  • The example in this section is kept simple for quick demonstrative purposes. For most use cases, you'll need to URL encode the value of the html_content parameter.

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