Website Screenshot API

Website Screenshot API

Transform any URL to an image

Overview

The API is a simple endpoint that allows you to convert any URL into a PNG or PDF screenshot. It uses the Google Chrome browser to render the web page, ensuring accurate and reliable screenshots. The API can handle JavaScript-rendered pages, capturing the content as it would appear in a web browser.

Features

  • Render using Google Chrome: The API uses the Google Chrome browser to render the web pages, ensuring high-quality and consistent screenshots.
  • Renders JavaScript contents: Screenshot API can capture screenshots of web pages that use JavaScript to load and display content.
  • Follows redirects: The API will follow any redirects that occur when accessing a URL, ensuring that the final page is captured correctly.
  • Works with SSL/HTTPS: Web screenshot API supports taking screenshots of websites that use the HTTPS protocol, allowing users to capture content from secure web pages.

Getting Started

To access the Web Scraping API , you need to obtain an API key from AnyAPI.io. The API key is used for authentication and should be included in the request URL as a query parameter.

Let’s Try Sign In.

Take screenshot of a URL endpoint

Send a GET request to the following URL to Take screenshot of a URL

curl --request GET \
  --url 'https://anyapi.io/api/v1/screenshot?url=https%3A%2F%2Fexample.com&format=SOME_STRING_VALUE&width=SOME_INTEGER_VALUE&height=SOME_INTEGER_VALUE&quality=SOME_INTEGER_VALUE&fullPage=SOME_BOOLEAN_VALUE&apiKey=YOUR_API_KEY'
"The screenshot of the specified URL in JPEG format."

Request parameters

Use the parameters listed below to customize your request. Mandatory parameters are indicated

urlstringRequired
Webpage URL (urlencoded)
formatstringOptional
screenshot format (png, jpeg, pdf)
widthintegerOptional
Viewport width
heightintegerOptional
Viewport height
qualityintegerOptional
The quality of the screenshot. Not applicable to png images
fullPagebooleanOptional
When true, takes a screenshot of the full scrollable page
apiKeystringRequired
Your unique API key, which is required to authenticate your requests.

Response parameters

The API returns its response in a simple, lightweight JSON format.

contentimage/jpeg
This request will return the screenshot of the specified URL in either JPEG, PNG or PDF format, depending on the user's preference.

Response and error codes

Whenever you make a request that fails for some reason, an error is returned also in the JSON format. The errors include an error code and description, which you can find in detail below.

Status CodeTypeDetails
200OKThe request was successful.
400Bad RequestThe request was invalid or cannot be otherwise served.
401UnauthorizedAuthentication credentials were missing or incorrect.
422Quota reachedThe request cannot be served due to the application's rate limit having been exhausted for the resource.
404Not FoundThe requested resource could not be found.
429Too Many RequestsThe request cannot be served due to the application's rate limit having been exhausted for the resource.
500Internal Server ErrorSomething went wrong on the server.
503Service UnavailableThe service is temporarily unavailable.