GET /v1/get-screenshot

This is the main endpoint to use GetScreenshot. This section contains a description of all the available query parameters to control the API, its behavior and the resulting captured screenshots.

get
Required Parameters

https://api.rasterwise.com/v1/get-screenshot
These URL query parameters are required to get a successful response from the API.
Request
Response
Request
Query Parameters
url
required
string
URL of the website / page you want to screenshot. Should start with http:// or https://
apikey
required
string
You secret API Key. This is required to authenticate your request.
Response
200: OK
Cake successfully retrieved.
{
"name": "Cake's name",
"recipe": "Cake's recipe name",
"cake": "Binary cake"
}
404: Not Found
Could not find a cake matching this query.
{
"message": "Ain't no cake like that."
}

get
Optional "Format" Parameter

https://api.rasterwise.com/v1/get-screenshot
Request
Response
Request
Query Parameters
format
optional
string
The file type/format in which you want to get your capture. It can be either png or jpeg. Defaults to png
Response
200: OK

get
Optional "PDF" Parameter

https://api.rasterwise.com/v1/get-screenshot
Request
Response
Request
Query Parameters
pdf
optional
boolean
If set to true, we will ignore any image format settings and instead generate an A4 PDF of the passed website. This will work the same and render the website as if you were printing it from your browser. Defaults to false
Response
200: OK

get
Optional "Dimensions" Parameters

https://api.rasterwise.com/v1/get-screenshot
Use these URL query parameters to control the size of the viewport at the time of taking a page screenshot.
Request
Response
Request
Query Parameters
height
optional
number
Height in pixels of the viewport when taking the page screenshot. Defaults to 800
width
optional
number
Width in pixels of the viewport when taking the page screenshot. Defaults to 1280
fullpage
optional
boolean
If set totrue, we will calculate the full height of the website and used it as the height in pixels of the viewport when taking the page screenshot. Any passed height value will be ignored. Defaults to false
Response
200: OK

get
Optional "DOM" Parameters

https://api.rasterwise.com/v1/get-screenshot
If you need to target specific DOM elements instead of taking dimension-based screenshots you can use the DOM capture parameters to target those elements.
Request
Response
Request
Query Parameters
element
optional
string
Pass DOM element selectors in jQuery fashion. https://api.jquery.com/category/selectors/ For example. if targeting a div with the id colordiv you can target it by passing the parameter #colordiv
Response
200: OK

get
Optional "Preset" Parameter

https://api.rasterwise.com/v1/get-screenshot
Request
Response
Request
Query Parameters
preset
optional
string
If set, we will control the dimension and user-agent to simulate the preset device or graphics display resolution. If a preset value is passed, we will ignore other passed dimension parameters. This parameter can accept any of the following presets: iphone 5 (iPhone 5) iphone678 (iPhone 6/7/8) iphone678_plus (iPhone 6/7/8 +) iphonex (iPhone X / XS) pixel2 (Google Pixel 2) pixel2_xl (Google Pixel 2 XL) ipad (iPad in Vertical) ipadpro (iPad Pro Vertical) hvga (320 x 480) wvga (480 x 800) dvga (640 x 960) wxga_v (768 x 1280) xga (1024 x 768) wxga_s (1280 x 800) wxga_l (1366 x 768) sxga (1280 x 1024) wsxga_plus (1680 x 1050)
Response
200: OK

get
Optional "Action" Parameters

https://api.rasterwise.com/v1/get-screenshot
Use these query parameters to dispatch actions to the browser as part of the rendering flow.
Request
Response
Request
Path Parameters
click
optional
string
The click parameter will dispatch a click at the start of the rendering flow to the passed coordinates. For example if you need to click in the coordinates X = 20px and Y = 100px you can pass an array [20, 100]
Response
200: OK

get
Optional "Modified-Rendering" Parameters

https://api.rasterwise.com/v1/get-screenshot
Use these URL query parameters to modify the final rendering of the page before taking a page screenshot. Use these to hide DOM elements, add custom styles, highlight words and more.
Request
Response
Request
Query Parameters
highlight
optional
string
A custom word or phrase you want to highlight. If passed, GetScreenshot will look for that string on the website and highlight all its instances with bright-yellow box.
customjs
optional
string
A custom JS evaluation you want to inject before the capture. If passed we will inject this statement as a header <script> with a just in time model, after all the required operations and just before the capture operation. This is important to have in mind when passing JS that changes the rendering.
customcss
optional
string
A custom CSS style you want to inject before the capture. If passed we will inject the style declaration as a header <style> just before the capture operation.
hidemsg
optional
boolean
If set to true, we will hide message, chat and customer support clients. Currently hides the following clients: Intercom, Drift, Facebook and Tawk (partiallly). Defaults to false
hidecookie
optional
boolean
If set to true, we will hide cookie disclaimers that will usually appear as floating boxes or fixed containers. The hiding is not guaranteed but it has a pretty broad coverage and the underlying hiding heuristic is updated weekly. Defaults to false
Response
200: OK

get
Optional "Workflow" Parameters

https://api.rasterwise.com/v1/get-screenshot
Request
Response
Request
Query Parameters
email
optional
string
A valid email address. If set, we will send a formatted email to this email address including the capture image and the details of the capture (capture time and URL). Example: test@example.com
webhook
optional
string
A valid endpoint url that can receive and respond to a POSTrequest (preferably an endpoint that you control). If set, we will send a POST request with the final response of the original call, to the provided endpoint (webhook listener). For your convenience, we send the response in the body and queryStringParameters of the request. Example: https://mywebhook.example.com
Response
200: OK

get
Optional "Rendering Strategy" Parameter

https://api.rasterwise.com/v1/get-screenshot
By default, GetScreenshot will use a rendering strategy that provides wide coverage for multiple rendering scenarios and use cases. However, there are situations where this strategy might not work so we provide alternative rendering strategies. For now, we only provide one alternative strategy which works is less aggressive than the default strategy when evaluating the DOM elements in the computed box model. In many cases, the reasult will be the same, but it's worth experimenting if the default strategy doesn't yield good results.
Request
Response
Request
Query Parameters
strategy
optional
string
If set to 1, changes the rendering strategy to our alternative rendering flow.
Response
200: OK