# Parameters
# token
- Required
- Type
string
This parameter is required for all calls
This is your authentication token. All your requests must be authorized with your private token.
Private token
_USER_TOKEN_
# url
- Required
- Type
string
You will need a url to take a screenshot for its web page. Make sure it starts with http or https and it's fully encoded.
For example, in the following url: https://www.apple.com/us/search/iphonex?src=globalnav
the url should be encoded when calling the screenshots API like the following: https%3A%2F%2Fwww.apple.com%2Fus%2Fsearch%2Fiphonex%3Fsrc%3Dglobalnav
- curl
- ruby
- node
- php
- python
- go
curl "https://api.crawlbase.com/screenshots?token=_USER_TOKEN_&url=https%3A%2F%2Fapple.com%2F"
# device
- Optional
- Type
string
Optionally, if you don't want to specify a user_agent but you want to have the requests from a specific device, you can use this parameter. There are two options available: desktop
and mobile
.
- curl
- ruby
- node
- php
- python
- go
curl "https://api.crawlbase.com/screenshots?token=_USER_TOKEN_&device=mobile&url=https%3A%2F%2Fapple.com%2F"
# user_agent
- Optional
- Type
string
If you want to make the request with a custom user agent, you can pass it here and our servers will forward it to the requested url.
- curl
- ruby
- node
- php
- python
- go
curl "https://api.crawlbase.com/screenshots?token=_USER_TOKEN_&user_agent=Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_12_5%29+AppleWebKit%2F603.2.4+%28KHTML%2C+like+Gecko%29+Version%2F10.1.1+Safari%2F603.2.4&url=https%3A%2F%2Fapple.com%2F"
# css_click_selector
- Optional
- Type
string
Optionally pass css_click_selector
parameter to click an element in the page before the browser captures the resulting HTML page.
It must be a full and valid CSS selector, for example #some-button
or .some-other-button
and properly encoded.
- curl
- ruby
- node
- php
- python
- go
curl "https://api.crawlbase.com/screenshots?token=_USER_TOKEN_&css_click_selector=%23some-nice-button&url=https%3A%2F%2Fapple.com%2F"
# scroll
- Optional
- Type
boolean
Optionally pass &scroll=true
parameter to scroll through the entire page before capturing the screenshot. This will be default scroll for a &scroll_interval
of 10 seconds.
If you want to scroll more than 10 seconds please send the &scroll=true&scroll_interval=20
.
The &scroll_interval
is a minimum of 10 seconds and a maximum of 60.
- curl
- ruby
- node
- php
- python
- go
curl "https://api.crawlbase.com/screenshots?token=_USER_TOKEN_&scroll=true&url=https%3A%2F%2Fapple.com%2F"
# store
- Optional
- Type
boolean
Optionally pass &store=true
parameter to store a copy of the screenshot in the crawlbase Cloud Storage (opens new window).
Crawlbase will send you back the screenshot_url
of the stored screenshot in the response headers.
- curl
- ruby
- node
- php
- python
- go
curl "https://api.crawlbase.com/screenshots?token=_USER_TOKEN_&store=true&url=https%3A%2F%2Fapple.com%2F"
# mode
- Optional
- Type
String
Optionally pass &mode=viewport
parameter, default is fullpage
to take a screenshot image of the viewport. The default width is the screen width and the height is max of 800 pixel.
- curl
- ruby
- node
- php
- python
- go
curl "https://api.crawlbase.com/screenshots?token=_USER_TOKEN_&mode=viewport&url=https%3A%2F%2Fapple.com%2F"
# width
- Optional
- Type
Integer
Optionally pass &width=1200
in pixel parameter to resize the screenshot at that maximum width. The default width is the screen width, takes only effect if combined with mode=viewport
.
- curl
- ruby
- node
- php
- python
- go
curl "https://api.crawlbase.com/screenshots?token=_USER_TOKEN_&width=1200&url=https%3A%2F%2Fapple.com%2F"
# height
- Optional
- Type
Integer
Optionally pass &height=1800
in pixel parameter to resize the screenshot at that maximum height. The default height is the screen height, takes only effect if combined with mode=viewport
.
- curl
- ruby
- node
- php
- python
- go
curl "https://api.crawlbase.com/screenshots?token=_USER_TOKEN_&height=1800&url=https%3A%2F%2Fapple.com%2F"