Take Endpoint
On this page, we’ll dive into the take endpoint you can use to render a website.
Render a Website
This endpoint lets you render a website.
Required attributes
- Name
url- Type
- string
- Description
The URL of the website you want to render.
Optional attributes
- Name
format- Type
- string
- Description
The format of the image returned. Supported: jpg, jpeg, png, gif, webp Default value is png.
- Name
quality- Type
- integer
- Description
The quality of the image returned. Only supported when the format is jpg or jpeg. Default value is 80.
- Name
full_page- Type
- boolean
- Description
To take the screenshot of the full page, set full_page=1. Default value is 0.
- Name
viewport_width- Type
- integer
- Description
The width of the browser viewport in pixels. The browser's viewport is the window area where you can see the website. Default value is 1280.
- Name
viewport_height- Type
- integer
- Description
The height of the browser viewport in pixels. The browser's viewport is the window area where you can see the website. Default value is 800.
- Name
ip_country_code- Type
- string
- Description
The country code (ISO 3166-1 alpha-2) to use for the IP address when taking the screenshot. This allows you to simulate requests from different countries. Must be a valid country code from the supported list.
- Name
delay- Type
- integer
- Description
The delay in seconds to wait before taking the screenshot. Minimum value is 0, maximum value is 30. Default value is 0.
- Name
timeout- Type
- integer
- Description
The timeout in seconds for the page load. Minimum value is 5, maximum value is 60. Default value is 60.
- Name
wait_until- Type
- string
- Description
Determines when the screenshot should be taken based on page load state. Supported values:
load: Waits for the load event (entire page and all resources loaded)domcontentloaded: Waits for HTML document to be loaded and parsednetworkidle0: Waits until there are no active network connections for 500msnetworkidle2: Waits until there are no more than two active network connections for 500ms Default value is load.
- Name
block_cookie_banners- Type
- boolean
- Description
Whether to block cookie banners on the page. Set to 1 to enable, 0 to disable. Default value is 0.
- Name
block_ads- Type
- boolean
- Description
Whether to block ads on the page. Set to 1 to enable, 0 to disable. Default value is 0.
- Name
block_chats- Type
- boolean
- Description
Whether to block chat widgets on the page. Set to 1 to enable, 0 to disable. Default value is 0.
- Name
hide_selectors- Type
- array
- Description
An array of CSS selectors to hide on the page. Elements matching these selectors will be hidden using CSS display: none and visibility: hidden. You can pass multiple selectors by using the parameter multiple times. Maximum 255 characters per selector. Example:
hide_selectors[]=.cookie-banner&hide_selectors[]=#newsletter-popup
- Name
styles- Type
- string
- Description
Custom CSS styles to inject into the page before taking the screenshot. This allows you to modify the page's appearance using any valid CSS. You should urlencode this value. Maximum 10,000 characters. Example:
body { background-color: red !important; }
Request
curl -G https://api.screenshotbase.com/v1/take?url=https%3A%2F%2Fbbc.com \
-H "apikey: YOUR-API-KEY"