Unparalleled suite of productivity-boosting Web APIs & cloud-based micro-service applications for developers and companies of any size.

APIAutomationPython

Enhance Your Business Intelligence With Reliable Screenshot Automation

Enhance Your Business Intelligence With Reliable Screenshot Automation

In today’s world, business intelligence is greatly inspired by truthful facts and figures from third-party credible sources that are experts in a given domain. Not just that, but the digital world demands that the arguments must be supported by relevant evidence that is enough to prove the credibility of the information. Screenshots are one of the possible ways to achieve that. 

Screenshotlayer is a lightweight REST API built to deliver high-quality PNG, JPEG & GIF website screenshots at unparalleled speeds and through a simple interface. To ensure the highest possible level of image resolution, the Screenshotlayer API relies on a powerful rendering engine capable of processing, storing, and returning all sorts of website content within just a few seconds. Another great API to pair with this API is a geolocation with IP API.

In this blog post, we’ll explore the Screenshotlayer API and look at its different available options to make the screenshot process smooth and desirable. 

How can I capture full-height screenshots using Screenshotlayer API?

While using the /capture endpoint of the Screenshotlayer API, it renders the screenshots based on the height of the selected viewport by default. You can change this behavior if you want a full-height screenshot of the website.

To get the full-height screenshot, you additionally need to provide the fullpage query parameter to the endpoint with the value equal to 1.

The example endpoint looks like the following.

How can I get a thumbnail screenshot of a website?

In addition to the full-height feature, the Screenshotlayer API also allows you to request a thumbnail of the target website. By default, the snapshot is of the original size i.e. 1:1. 

To request a thumbnail, simply append the endpoint with the width query parameter containing your preferred thumbnail width in pixels. 

The example endpoint for the thumbnail snapshot looks like this.

Can I control the viewport in Screenshotlayer API?

The default viewport setting of the Screenshotlayer API is 1440×900. However, you can specify a custom viewport by setting the viewport parameter to your desired dimensions in the format of widthxheight, where width and height are the values in pixels.

An example API endpoint for custom viewport looks somewhat like below.

What is an easy way to do custom styling in the screenshot?

It is a completely valid use case that you want to customize the screenshot before using it in your application. But how will you do it in runtime? Guess what, the Screenshotlayer API allows you to customize the screenshots as well. 

The Screenshotlayer API enables you to inject a custom CSS stylesheet into the target website by appending an existing CSS file URL to the API’s css_url parameter.

An example API request with custom styling looks like follows. 

How can I add a delay to the screenshot capturing process?

The Screenshotlayer API allows you to take delayed screenshots as well. The delay parameter of the API enables you to specify a custom delay time (in seconds) before the snapshot is captured. This feature may especially useful if certain contents of your target website i.e. CSS animations, JavaScript effects, etc, appear after the initial page load.

The following example query sets a delay time of 3 seconds in order to capture any delayed/animated content on the target website.

How to add screenshot automation using Screenshotlayer in Python?

Following is a simple Python code snippet that allows you to integrate Screenshotlayer’s API in your applications.

As you can see, adding screenshot automation in your applications with Screenshotlayer is pretty simple and quick. Not only that, Screenshotlayer is reliable and easy on your budget to help you enable a diverse digital ecosystem that focuses on user experience. Moreover, the free plan of Screenshotlayer is an ideal choice for experimentation, trials, and proof of concepts.

Head over to Screenshotlayer and start enhancing your business intelligence with reliable screenshot automation.

Related posts
API

What Is an API Endpoint? What Does It Matter?

APILocation

Ipstack Case Study: How Airbnb Uses Geolocation IP Address for Listings

APIJavascript

How to Create a Phone Number Verification Web App Using Node.js

API

What Is Open API? Pros, Cons, and Examples

Leave a Reply

Your email address will not be published. Required fields are marked *