Custom POST Data, Referer and Cookie

Browshot has some unique features that make it a good tool to track advertising on websites. Browshot can show the list of files (Javascript, iframes, images, etc.) contained on a page, and acts as a neutral third party.

Don't hesitate to contact us for any custom project.


Custom POST Data:

You can customize the request which is sent to the target page for the screenshot. You can include any POST Data, like you were sending a form.

For example, to take a screenshot of your Browshot dashboard at https://app.browshot.com/, you must be logged in. To login, fill out the login form with your username and password. Let's say your username is foo and password is bar. Pass this value to post_data:

username=foo&password=bar

$browshot->create_screenshot(url => 'https://app.browshot.com/login', post_data => 'username=foo&password=bar'); # Full API
$browshot->simple(url => 'https://app.browshot.com/login', post_data => 'username=foo&password=bar'); # Simple API
$browshot->screenshot_create('https://app.browshot.com/login', array('post_data' => 'username=foo&password=bar')); // Full API
$browshot->simple('https://app.browshot.com/login', array('post_data' => 'username=foo&password=bar')); // Simple API

From the command line, URL-encode the post_data value: & becomes %26, = becomes %3d, etc.:

wget "https://api.browshot.com/api/v1/simple?url=https://app.browshot.com/login&post_data=username%3dfoo%26password%3dbar&key=my_api_key" -O /tmp/dashboard.png


Custom Referrer:

You can set a custom HTTP referrer with the referer parameter. This is supported for paid screenshots (premium and private instances) only.

wget "https://api.browshot.com/api/v1/simple?url=http://mobilito.net/&referer=http://browshot.com/&key=my_api_key" -O /tmp/mobilito.png


Custom Cookie:

You can set a session cookie with the cookie parameter. Cookies should be separated by a semicolon. This is supported for paid screenshots only.

wget "https://api.browshot.com/api/v1/simple?url=http://example.com/&cookie=session=abc123&key=my_api_key" -O /tmp/example.png
Try it for free

no credit card required