Automate image generation
Save time on creating similar images with different texts and brandings!
Create account
Share article

Taking screenshots using REST API

Published October 19, 20212 min read

Taking screenshots using REST API

Have you ever wondering if you could quickly take a screenshot of a webpage using just a single request?

RenderForm API allows you to not only create images using templates and API but also take a screenshots using REST API.

There are plenty use cases of that:

  • Post it on social media
  • Make a list of websites
  • Detect branding based on colors
  • Test or health-check your webpage
  • Read texts from screen

How to take a screenshot with API?

Generate your API key in RenderForm by signing up to the system. Get the API key from your account section and then you can make a request like below.

curl 
    --location 
    --request POST 'https://api.renderform.io/api/v1/screenshots' \
    --header 'X-API-KEY: <API_KEY>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "url": "https://renderform.io"
        "width": 1366,
        "height": 768,
    }'

RenderForm API will respond after a couple of seconds with link where you can download the screenshot. Example successful response is shown below.

{
  "requestId": "ed39c85ac41f4c54b95e4caaad4ebff8",
  "href": "https://cdn.renderform.io/.../image.png",
  "request": {
    "width": 1366,
    "height": 768,
    "url": "https://renderform.io"
  }
}

Screenshot API parameters

As you seen above we passed url of the website, width and height of the screenshot. These parameters are required but you can add more options:

  • url (required) - website URL of which RenderForm should take a screenshot
  • height (required) - screenshot height
  • width (required) - screenshot width,
  • expires (optional) - add expiration time in seconds for the image, available values from 1 to 604800
  • waitTime (optional) - add wait time in milliseconds before taking a screenshot, available values from 500 to 5000
  • webhookUrl (optional) - send response to the given webhookUrl as POST request

Does it integrate with other tools?

Yes! RenderForm is integrated with Zapier and Make.com (Integromat). Soon we will add more integrations like n8n.io. Please also notice that every request supports a webhook. Taking a screenshot takes time because it's very resource demanding and complex process for servers. You can pass a URL in webhookUrl field, thanks to that RenderForm API will accept your request and immediately return you a response. Once RenderForm finish processing your request a new request will be sent to the given URL in webhookUrl.

Can I set an expiration date?

Yes, you can set expiration date on every screenshot from 1 second up to 7 days. Add a field expires and put there an expiration value in seconds. RenderForm API return you a link in href field which will be valid for requested period of time.

Relevant posts

Image Generation with Zapier

Image Generation with Zapier

Jakub PomykałabyJakub PomykałaAugust 17, 2022

Automate image generation using Zapier and RenderForm. Create mutiple images with your templates, or take website screenshot using Zapier.

Read more
Image Generation with Airtable

Image Generation with Airtable

Jakub PomykałabyJakub PomykałaJune 17, 2022

Automate image generation using Airtable. Create images using your templates, or take website screenshot with Airtable.

Read more
Image Generation with Google Sheets

Image Generation with Google Sheets

Jakub PomykałabyJakub PomykałaJune 04, 2022

Automate image generation using Google Sheets. Create images using your templates, or take website screenshot with Google Sheets.

Read more
What is Image Generation?

What is Image Generation?

Jakub PomykałabyJakub PomykałaJune 04, 2022

Learn what is image automation. Grow your business with no-code automation tools. Generate images using REST API, Zapier, Make, Google Sheets, and more!

Read more
What is RenderForm?

What is RenderForm?

Jakub PomykałabyJakub PomykałaJune 04, 2022

Learn more about RenderForm, its features and how you can scale your designs with external tools like Zapier and Make.

Read more
Image Generation with Make.com

Image Generation with Make.com

Kinga WojciechowskabyKinga WojciechowskaJune 02, 2022

Automate image generation using Make.coms and RenderForm. Create personalized images from templates and automatize your marketing workflow.

Read more

Design. Automate. Scale.

Free plan • No credit card required • Get started in minutes