Capture a website screenshot
apiflash_capture_screenshotCapture a screenshot of a public web page with ApiFlash's headless Chrome and return it as an image (up to 4 MB; a larger one comes back as a link only) together with ApiFlash's cache link. The link needs your own ApiFlash access key to open, so it is an identifier, not a shareable URL. USES YOUR APIFLASH QUOTA: each successful new capture counts as one screenshot of your monthly plan (a repeat with identical options inside ttl seconds comes from ApiFlash's cache and is free; fresh=true always counts). Options cover format, viewport size, full page, wait conditions, element or area capture, scale factor, ad / cookie-banner / tracker blocking, language, time zone and caching. Optionally also extract the page's HTML and text files (cache links returned; use apiflash_extract_page_content to read the text). Remaining quota is included. GET /urltoimage?response_type=json.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ttl | No | Seconds the screenshot stays cached (default 86400, max 30 days). Identical calls within ttl are free. | |
| url | Yes | Public page to capture, a full http:// or https:// address (a public domain name; IP addresses, internal hosts and credentials are refused). | |
| crop | No | Capture an area: left,top,width,height in pixels, e.g. 10,20,50,100. | |
| delay | No | Extra seconds to wait after load, 0 to 10. Prefer wait_for or wait_until. | |
| fresh | No | Force a new capture instead of the cached one (always uses quota). | |
| width | No | Viewport width in pixels (default 1920). width x height must not exceed 33,177,600. | |
| format | No | Image format (default jpeg). webp is limited to 16350 px per side after scale_factor. | |
| height | No | Viewport height in pixels (default 1080). Ignored with full_page. | |
| no_ads | No | Block ads. | |
| element | No | CSS selector: capture only the first matching element (ignored with full_page). | |
| quality | No | Image quality 0-100 for jpeg and webp (default 80). | |
| wait_for | No | CSS selector to wait for before capturing (the capture fails after 15 s if it never appears). | |
| full_page | No | Capture the entire page, not just the viewport (default false). | |
| time_zone | No | Time zone, a tz database name such as Europe/Paris. | |
| user_agent | No | User-Agent header to emulate a device. | |
| wait_until | No | When the page counts as loaded: dom_loaded, page_loaded or network_idle (default). | |
| no_tracking | No | Block tracking scripts so the capture does not count as a page view. | |
| scroll_page | No | Scroll the whole page first to trigger lazy-loaded images and animations (default false). | |
| transparent | No | Transparent background; png only, and the page body must be transparent. | |
| extract_html | No | Also extract the page HTML; the reply gets an extracted_html_url link. | |
| extract_text | No | Also extract the page text; the reply gets an extracted_text_url link. | |
| scale_factor | No | Device scale factor: 1 (default) or 2 (retina, larger file). | |
| fail_on_status | No | HTTP status codes of the page (comma list, ranges with -, e.g. 400,404,500-511) that make the call fail instead of capturing an error page. | |
| accept_language | No | Accept-Language header for the page, e.g. fr-FR. | |
| thumbnail_width | No | Also resize to this width in pixels, keeping the aspect ratio (ignored with full_page). | |
| no_cookie_banners | No | Hide cookie banners and popups. | |
| wait_until_timeout | No | Seconds to wait for wait_until before capturing anyway (default 30, max 30). |