Custom HTML Screenshots
/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:
/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_htmlendpoint respects all standard screenshot options. - The
html_only=trueflag 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_contentparameter.
Support
Questions? Contact us anytime by email:
support-tickets@pagepixels.com
Or send us a message through our Support page.