With the API, you can automate taking a screenshot of any website.
Need a social card for every page?
Use an OG Image Config to map every public page path on a website or CMS to a screenshot or template—without making a separate API request for each page.
Pass the url param to the hcti.io/v1/image endpoint, and we’ll generate a screenshot for you. Here’s an example using cURL.
curl -X POST https://hcti.io/v1/image -u'UserID:APIKey'--data-urlencodeurl="https://google.com"
Don’t write code? Don’t worry, you can also do this with our Zapier integration.
Additional parameters
To customize your image further, you can take advantage of the following optional parameters.
Reuse an identical recent image without consuming image credits. Sets the lookback window in seconds; defaults and allowed values vary by image type and plan.
Set the width of Chrome’s viewport. Both dimensions must be set when using either.
Screenshot examples
A full screenshot of stripe.com. With device scale set to 2, for a super high resolution image.
Screenshot part of a page with Selector
You can set a selector to target a specific part of the page.
For example, on Stripe’s homepage, there is an element with the CSS selector section#complete-toolkit.container-lg.
When passing that to the API, we crop to that element only.
CSS Selectors
To learn about CSS Selectors, we recommend this article. There are also Chrome extensions that detect them for you, we like using: Selector Gadget.
Blocking cookie consent banners
Many websites display cookie consent popups that can interfere with your screenshots. Use the block_consent_banners parameter to automatically hide these:
curl -X POST https://hcti.io/v1/image -u'UserID:APIKey'\--data-urlencodeurl="https://example.com"\--datablock_consent_banners=true
This automatically detects and blocks common consent frameworks like OneTrust, Cookiebot, and others. For more advanced cases, see our complete guide to blocking cookie banners.
Pages requiring login or sign-in
Our API does not support pages that require login. The URL must be publicly accessible for us to generate an image of it. Supporting login is a common request, but we have chosen not to support it due to the risk of storing and transmitting credentials.
Some sites have the option of creating an “embed” of a page. This is the best option if it’s available to you. You can then use the embed’s HTML to generate a screenshot without login.
Do you have an IP allowlist?
We don’t provide a static IP list. Our rendering servers scale dynamically on AWS, so the source IPs can change.
If you are screenshotting protected URLs, we recommend adding a custom query parameter to the URL (for example ?hcti=1) and creating a firewall rule (such as in Cloudflare) that allows requests when that query parameter is present.
Need help getting started?
We’d be happy to walk you through getting started. Send us an email: support@htmlcsstoimage.com. We’re experts at generating images and will help you get going using the API.