Documentation

Endpoint

https://api.octopic.in/api/screenshot?api_key=abc123&option1=value1&option2=value2

Options

Option Default Notes
api_key required Provide your API key
url Required Provide a valid URL you want to capture
width 1200 Viewport width in pixels
height 800 Viewport height in pixels
fullpage 0 Set it to 1 to get full page screenshot
user_agent <blank> User Agent string to set while requesting the page
accept_lang en-US Accept-Lang header
authorization <blank> Authorization header
cookie <blank> Cookie header
delay 0 Time in milliseconds to wait before taking screenshot
timeout 40000 Time in milliseconds to wait for page to load
selector <blank> Element selector to take scrrenshot. We will use document.querySelector to find the element.
quality 90 JPG image quality

Example

To request a screenshot of https://www.nytimes.com/ with viewport of 1280x800 use following curl command


curl -G "http://api.octopic.in/api/screenshot" \
     -d api_key=yourapikey \
     -d url=https://www.nytimes.com/ \
     -d width=1280 \
     -d height=800 > scrrenshot.jpg