Take a screenshot

Waits for the screenshot and returns the image. A failed screenshot is not charged. Send an Idempotency-Key header to make a retry safe: the same key returns the same screenshot without charging twice.

get/screenshot

Request

  • Base URL: https://localscreenshot.com/v1
  • URL: https://localscreenshot.com/v1/screenshot
  • Auth: HTTP bearer

Query parameters

urlstring uri required

The public http or https page to capture.

countrystring

Load the page from this country (ISO 3166-1 alpha-2 code, see /v1/countries). The response reports the country actually observed. If it cannot be obtained, the request fails and is not charged. Costs 2 credits instead of 1.

viewportstring

Screen size as WIDTHxHEIGHT, for example 1440x900. Shortcut for viewport_width and viewport_height.

viewport_widthinteger

Width of the browser window, in pixels.

viewport_heightinteger

Height of the browser window, in pixels. With full_page, the image is taller than this.

device_scale_factornumber

Pixel density. 2 gives a sharper, larger image.

device'desktop' | 'desktop_hd' | 'laptop' | 'ipad' | 'ipad_pro' | 'ipad_mini' | 'iphone_15' | 'iphone_15_pro_max' | 'iphone_se' | 'pixel_8' | 'galaxy_s24'

Capture as this device (screen size, pixel density, mobile browser).

orientation'portrait' | 'landscape'

Hold a phone or a tablet upright (portrait) or on its side (landscape). Needs a phone or tablet device.

full_pageboolean

Capture the whole scrollable page instead of the visible part.

selectorstring

Capture only the first element matching this CSS selector.

format'png' | 'jpeg' | 'webp' | 'pdf'

File format. pdf saves the whole page as a document; it cannot be combined with selector or max_width.

qualityinteger

Quality for jpeg and webp. Ignored for png and pdf.

color_scheme'light' | 'dark'

Ask the page for its light or dark theme.

languagestring

Browser language, for example fr or fr-FR. Without it, a screenshot from a country uses the main language of that country.

timezonestring

Browser time zone, for example Europe/Paris. Without it, a screenshot from a country uses the main time zone of that country.

user_agentstring

User-Agent the page receives. A preset (googlebot, googlebot_mobile) or your own string. Useful to compare what a site shows to a crawler and to a visitor. A site that checks the crawler's IP address is not fooled.

wait_forstring

Wait until an element matching this CSS selector is visible.

click_selectorstring

Click this one element before the screenshot, to open a menu, a tab or a dialog. A CSS selector matching exactly one element: use it when you know the code of the page. One click, no typing. Costs 1 more credit. Not with pdf, not with click_text.

click_textstring

Same click, pointed at by the text a visitor reads on the element, for example "Show all": use it when you do not know the code of the page. The whole text of exactly one visible button, tab or other clickable element, upper or lower case. Not a part of it, not a pattern. One click, no typing. Costs 1 more credit. Not with pdf, not with click_selector.

delay_msinteger

Extra wait before the capture, in milliseconds.

hide_selectorsstring[]

Hide every element matching these CSS selectors. In a URL, separate them with commas.

disable_animationsboolean

Freeze animations and transitions.

hide_sticky_elementsboolean

Hide headers, bars and buttons that stay fixed on screen.

block_cookie_bannersboolean

Removes most cookie banners. A banner the filters do not know stays in the picture.

block_adsboolean

Block ads. Screenshots taken from a country block ads by default: set block_ads to false to see them. Without a country, ads stay unless you set it to true.

block_chat_widgetsboolean

Hide chat bubbles.

close_popupsboolean

Close pop-ups and newsletter overlays.

max_widthinteger

Scale the image down to this width. Useful to keep it small for a vision model.

response'image' | 'json'

image returns the picture itself. json returns its link, the page details and the attestation.

asyncboolean

Return an id right away instead of waiting. Read the result at /v1/screenshots/{id}.

Headers

Idempotency-Keystring

Response

The image, or the JSON document when response=json.

idstring
status'queued' | 'running' | 'succeeded' | 'failed'
attestationobject nullable

Signed technical attestation, only when a country was requested. It is not legal proof.

errorobject nullable

Changes

No recorded changes to this operation across all 1 revision of this API.