GET
https://shot.screenshotapi.net/screenshot?token=TOKEN&url=URL&[OPTIONS]
The following options for the API call are:
TOKEN: The TOKEN
or your API key should be replaced by your real ScreenshotAPI API, you can find your API key after you Sign Up or Log In to the service via the Dashboard page.
Note: If for any reason you need to get a new API key, simply click "Roll API Key" in the "Settings" card on the Dashboard. This will issue you a fresh API key and revoke access from the previous key.
URL: Website URL for the site you would like to render for the screenshot. We support a wide variety of websites types, such as single page apps, very long-content, and sites that require lazy loading or delays ensuring accurate and complete screenshots of these unique sites.
OPTIONS: Options indicates the different URL parameters keys and values that can be used to render your "perfect" screenshot. All the options for screenshots will be detailed below.
Note: Default options for the screenshot will be shown in the Options table below.
Example:
This will render the following png
image output when you paste in the above string into your browsers URL bar (replacing TOKEN with your API key):
POST
https://shot.screenshotapi.net/screenshot
POST mode accepts the exact same parameters in the request body, but you need to use a JSON.
When you take a screenshot, it automatically get cached on our backend, so when you make a get request to the same URL this will return the same screenshot that got cached, but if you want to take a newer screenshot of the URL provided, you may want to use our fresh screenshot functionality.
Example:
In the following video, you will see an example of how the 'Fresh Screenshot' functionality is used. First, we demonstrate how a regular request to a specific URL is made for the first time, which typically takes a few seconds since it's the initial request. Then, the same request is made a second time, which is much faster because it retrieves the cached screenshot. However, if you want to capture a completely new screenshot without using the cached one, you should click the checkbox labeled 'Fresh screenshot' as shown in the example during the third request in the video.
You can select elements by class name, ID, or other CSS selectors and then add the display: none
attribute to hide them on the inject CSS feature.
Example:
In the following video, you'll find a more illustrative example of how to use the 'Inject CSS' functionality to remove an element from a page. In the first request, you'll see a standard screenshot to observe the page's initial state. Then, in the second request, we demonstrate how to achieve this by utilizing the 'Inject CSS' feature to remove the desired element.
Available file types:
PNG — A widely supported lossless image format. Ideal for high-quality screenshots with transparency support.
JPG — A lossy image format best suited for photographs or images with gradients. It offers smaller file sizes but may lose some image quality.
WebP — A modern image format that provides superior compression and quality characteristics compared to PNG and JPG. It supports both lossless and lossy compression, making it a versatile choice.
PDF — Used for generating screenshot files in a portable document format. Suitable for documents, reports, or multi-page captures.
The default value is PNG
.
Available options:
true — The screenshot (or PDF) will not be stored on the server after it is rendered. It must be downloaded immediately, as it will not be accessible again.
false — The screenshot (or PDF) is stored on the server and can be accessed later (default behavior).
The default value is false
.
Available options:
true — The API will return an error if the render encounters a 4xx
or 5xx
status code. This is useful when you want to ensure the response indicates a failure in case of server or client-side issues during rendering.
false — The API will ignore 4xx
and 5xx
status codes, proceeding without returning an error (default behavior).
The default value is false
.
Sets the User-Agent string for the render for a particular request.
This allows you to specify a custom User-Agent, which is sent in the request headers to identify the browser or device making the request.
Example: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
Default value: " "
(empty string).
Sets the Accept-Language header on the request for the specified URL rendered.
This allows you to specify the language preferences for the content to be rendered, determining how the server responds based on language.
Default value: en-US,en;q=0.8
(English - United States, with fallback to English).
Time delay in milliseconds (ms) before the screenshot is rendered from the browser instance (this includes PDFs).
This setting allows you to introduce a delay between the page load and the rendering process, ensuring all elements have fully loaded before capturing the screenshot or PDF.
Default value: 0
(no delay).
The width in pixels of the thumbnail generated from the render. If not set, the fallback behavior is the outputted screenshot.
This setting controls the width of the thumbnail image. If you don’t specify a width, the original screenshot will be used.
Default value: null
(no thumbnail generated by default).
Set the output of the results from the render. The output can be either JSON
or the raw image captured.
If you select JSON
, the result will be returned in a structured JSON format containing metadata and other details about the render.
If you select image
, the result will be the raw image file (PNG, JPG, WebP, PDF, etc.) depending on the file type specified.
Default value: image
.
If lazy load is set to true, the browser will scroll down the entire page to ensure all content is loaded before the render.
Set to true
to ensure that all content, including lazy-loaded elements, is fully loaded.
Set to false
to render the page with only the initially loaded content.
Default value: false
.
If full_page
is set to true, the screenshot or render will capture the entire webpage, including areas that are not currently visible in the viewport. This means the full content of the page will be included, even if the user would need to scroll to see it.
Set to true
to capture the entire page.
Set to false
to capture only the visible portion of the page.
Default value: false
.
If retina
s set to true, the screenshot or render will be captured with a higher pixel density (2x). This is useful for devices with Retina or high-definition displays where images need to appear sharper. Enabling this option will result in a higher-quality image, but may increase the processing time due to the larger image size.
Set to true
for high-definition screenshots.
Set to false
for standard screenshots.
Default value: false
.
The height
option specifies the viewport height of the browser when the render is captured. It determines how much of the page is visible in the viewport before the render is taken. Adjusting the height can be useful if you need to capture a larger or smaller section of the webpage in your screenshot.
Set to a specific integer
value (in pixels) to define the height of the viewport.
Default value: 867 pixels
.
The width
option specifies the viewport width of the browser when the render is captured. It determines how much of the page is visible horizontally before the render is taken. You can adjust the width if you want to capture a wider or narrower view of the webpage.
Set to a specific integer
value (in pixels) to define the width of the viewport.
Default value: 1680 pixels
.
The custom_html
option allows you to provide custom HTML content that will be rendered instead of loading a URL. This is useful if you want to capture a screenshot of a specific HTML structure or dynamically generated content.
Set to a string
containing the HTML you want to render.
This will override the URL
option, and the screenshot will be based on the provided HTML.
Default value: " "
(empty string).