Take a screenshot
Render a URL, HTML or Markdown into a PNG, JPEG, WebP or PDF. Exactly one of url, html or markdown is required. A successful render uses one screenshot of the monthly quota; cache hits and failed renders are free.
Request
- Base URL: https://curlshot.com
- URL: https://curlshot.com/api/v1/screenshot
- Auth: one of:
- API key in query parameter access_key
- API key in header X-Access-Key
- HTTP bearer
Query parameters
Address of the page to capture.
HTML to render instead of a URL.
Markdown to render as a styled page instead of a URL.
File format of the result. mp4, webm and gif record a video of the page.
Compression quality for jpeg and webp. From 1 to 100.
Resize the final image to this width. In CSS pixels.
Resize the final image to this height. In CSS pixels.
Keep the page background transparent (png and webp).
Return the file itself, or JSON with a link to it.
Width of the browser window. In CSS pixels.
Height of the browser window. A video uses 720 unless you set it. In CSS pixels.
Pixel density; 2 gives a retina image.
Emulate a phone, tablet or laptop preset.
Render the mobile layout (honours the viewport meta tag).
Rotate the viewport to landscape.
Capture the whole page, not just the first screen.
Scroll through the page first so lazy-loaded images appear.
Cut a full-page capture off at this height. In CSS pixels.
Capture only the first element matching this CSS selector.
Left edge of the area to capture. In CSS pixels.
Top edge of the area to capture. In CSS pixels.
Width of the area to capture. In CSS pixels.
Height of the area to capture. In CSS pixels.
Page event that marks the page as loaded.
Extra time to wait after the page has loaded. In seconds.
Give up if the page is not ready after this long. In seconds.
Wait until this element is visible before capturing.
Ask the page for its dark theme.
Ask the page to turn animations off.
CSS media type to render with.
Hide every element matching these CSS selectors.
CSS to add to the page.
JavaScript to run on the page before the capture.
Click the first element matching this selector before the capture.
User-Agent header the browser sends.
Extra HTTP headers, as "Name: value". In a query string, repeat the parameter once per item.
Cookies to set, as "name=value; Domain=example.com". In a query string, repeat the parameter once per item.
Authorization header sent to the target site only.
IANA time zone the page sees.
Block requests to ad networks.
Block analytics and tracking scripts.
Hide cookie consent banners.
Block live-chat widgets.
Block whole kinds of resources.
Block requests whose URL matches these patterns (* is a wildcard).
Paper size of the PDF.
Use landscape pages.
Print background colors and images.
Margin on all four sides.
Top margin; overrides pdf_margin.
Right margin; overrides pdf_margin.
Bottom margin; overrides pdf_margin.
Left margin; overrides pdf_margin.
Put the whole page on a single tall PDF page.
Length of the video. Left out, it follows the height of the page. In seconds.
Longest the video may get when its length follows the page. A taller page then scrolls faster. In seconds.
Frames per second. A gif takes at most 15.
Scroll from the top of the page to the bottom while recording.
Scroll back to the top at the end, so the video loops cleanly.
How the scroll moves: a soft start and stop, or one even speed.
Serve a stored copy when the same request was made before.
How long a cached copy stays valid. In seconds.
Change this value to force a fresh render.
Return at once and render in the background.
Address that receives the result when the render is done.
Sign the webhook body so you can verify it came from us.
HMAC-SHA256 signature of the query string, for signed links.
Unix time in seconds after which the request is refused. Put it in a signed link to give the link a lifetime.
Response
The rendered file. With response_type=json the body is JSON describing the stored file instead.
Changes
No recorded changes to this operation across all 1 revision of this API.