{"openapi":"3.1.0","info":{"title":"Website Screenshot & PDF API","version":"1.0.0","description":"Capture any web page as PNG, JPEG or WebP (viewport, full page or one element) or print it to PDF with a real Chrome browser. Cookie banners are removed by default; ads can be blocked; mobile, tablet and dark-mode rendering are one parameter away.\n\nAll endpoints accept GET (query string) or POST (JSON body). Errors use one shape: `{\"success\": false, \"error\": {\"code\", \"message\", \"retryable\"}}`. When a numeric `Retry-After` header is present, `error.retryAfterSeconds` is included.","contact":{"name":"TidyTools","url":"https://apify.com/tidytools"}},"servers":[{"url":"https://webcapture-api.yukailin.workers.dev","description":"Origin (reachable only through the marketplace gateway)"}],"tags":[{"name":"Screenshot"}],"paths":{"/api/v1/screenshot":{"get":{"operationId":"screenshotGet","summary":"Screenshot a web page (GET)","description":"Returns the image bytes by default (`response=image`), or JSON with the image as base64 (`response=json`).","tags":["Screenshot"],"parameters":[{"name":"url","schema":{"type":"string"},"description":"Page URL. A bare domain such as `example.com` is accepted (https is assumed). Private, local and cloud-metadata addresses are refused.","required":true,"example":"https://example.com","in":"query"},{"name":"format","schema":{"type":"string","default":"png","enum":["png","jpeg","webp"]},"description":"Image format.","required":false,"in":"query"},{"name":"width","schema":{"type":"integer","default":1280,"minimum":320,"maximum":1920},"description":"Viewport width (CSS px).","required":false,"in":"query"},{"name":"height","schema":{"type":"integer","default":800,"minimum":200,"maximum":1920},"description":"Viewport height (CSS px).","required":false,"in":"query"},{"name":"fullPage","schema":{"type":"boolean","default":false},"description":"Capture the whole scrollable page.","required":false,"in":"query"},{"name":"maxHeight","schema":{"type":"integer","default":8000,"minimum":200,"maximum":10000},"description":"Full-page captures are cut at this height (CSS px); `truncated` tells you when.","required":false,"in":"query"},{"name":"quality","schema":{"type":"integer","default":80,"minimum":1,"maximum":100},"description":"JPEG/WebP quality.","required":false,"in":"query"},{"name":"scale","schema":{"type":"integer","default":1,"minimum":1,"maximum":2},"description":"Device scale factor (2 = retina).","required":false,"in":"query"},{"name":"selector","schema":{"type":"string"},"description":"Capture only the first element matching this CSS selector.","required":false,"in":"query"},{"name":"response","schema":{"type":"string","default":"image","enum":["image","json"]},"description":"`image` returns the bytes; `json` returns metadata plus base64.","required":false,"in":"query"},{"name":"device","schema":{"type":"string","default":"custom","enum":["custom","desktop","laptop","tablet","mobile"]},"description":"Viewport preset. `custom` uses width/height.","required":false,"in":"query"},{"name":"waitUntil","schema":{"type":"string","default":"networkidle2","enum":["load","domcontentloaded","networkidle0","networkidle2"]},"description":"When the page counts as loaded.","required":false,"in":"query"},{"name":"timeoutMs","schema":{"type":"integer","default":20000,"minimum":1000,"maximum":30000},"description":"Page-load timeout in milliseconds.","required":false,"in":"query"},{"name":"delayMs","schema":{"type":"integer","default":0,"minimum":0,"maximum":5000},"description":"Extra wait after load (animations, late content).","required":false,"in":"query"},{"name":"darkMode","schema":{"type":"boolean","default":false},"description":"Emulate prefers-color-scheme: dark.","required":false,"in":"query"},{"name":"hideCookieBanners","schema":{"type":"boolean","default":true},"description":"Remove common cookie/consent banners before capturing.","required":false,"in":"query"},{"name":"blockAds","schema":{"type":"boolean","default":false},"description":"Block common ad, analytics and tracking hosts.","required":false,"in":"query"},{"name":"lazyLoad","schema":{"type":"boolean","default":false},"description":"Scroll through the page first so lazy-loaded images appear.","required":false,"in":"query"},{"name":"waitForSelector","schema":{"type":"string"},"description":"Wait for this CSS selector before capturing (captures anyway on timeout).","required":false,"in":"query"},{"name":"hideSelectors","schema":{"type":"string"},"description":"Comma-separated CSS selectors removed before capturing.","required":false,"in":"query"}],"responses":{"200":{"description":"The image (PNG/JPEG/WebP) when response=image, or JSON when response=json.","content":{"image/png":{"schema":{"type":"string","contentEncoding":"binary"}},"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"url":{"type":"string"},"finalUrl":{"type":"string"},"statusCode":{"type":"integer"},"title":{"type":"string"},"truncated":{"type":"boolean"},"format":{"type":"string"},"fullPage":{"type":"boolean"},"bytes":{"type":"integer"},"contentType":{"type":"string"},"image":{"type":"string"},"durationMs":{"type":"integer"}}},"example":{"success":true,"url":"https://example.com/","finalUrl":"https://example.com/","statusCode":200,"title":"Example Domain","truncated":false,"format":"png","fullPage":false,"bytes":23439,"contentType":"image/png","image":"iVBORw0KGgoAAAANSUhEUgAABQAAAAMgCAIAAADz+lisAAAAAXNSR0IArs4c...(base64 truncated)","durationMs":7223}}},"headers":{"x-final-url":{"schema":{"type":"string"},"description":"URL after redirects."},"x-target-status":{"schema":{"type":"string"},"description":"HTTP status of the target page."}}},"400":{"description":"Invalid parameter (`invalid_request`) or a private/local target (`url_not_allowed`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"url_not_allowed","message":"private, local and reserved hosts are not allowed"}}}}},"413":{"description":"Request body or target document too large (`too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The target site refused (`target_blocked`), could not be reached or its domain does not resolve (`target_unreachable`), the page does not exist (`target_error`, HTTP 404/410), or returned unsupported content.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"target_blocked","message":"The target refused the request: target returned HTTP 403","details":{"targetStatus":403,"finalUrl":"https://www.g2.com/"}}}}}},"502":{"description":"Temporary failure on our side (`upstream_error`); safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"The target did not respond in time (`timeout`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"screenshot","summary":"Screenshot a web page","description":"Returns the image bytes by default (`response=image`), or JSON with the image as base64 (`response=json`).\n\nThe same parameters as the GET form, sent as a JSON body.","tags":["Screenshot"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Page URL. A bare domain such as `example.com` is accepted (https is assumed). Private, local and cloud-metadata addresses are refused."},"format":{"type":"string","default":"png","enum":["png","jpeg","webp"],"description":"Image format."},"width":{"type":"integer","default":1280,"minimum":320,"maximum":1920,"description":"Viewport width (CSS px)."},"height":{"type":"integer","default":800,"minimum":200,"maximum":1920,"description":"Viewport height (CSS px)."},"fullPage":{"type":"boolean","default":false,"description":"Capture the whole scrollable page."},"maxHeight":{"type":"integer","default":8000,"minimum":200,"maximum":10000,"description":"Full-page captures are cut at this height (CSS px); `truncated` tells you when."},"quality":{"type":"integer","default":80,"minimum":1,"maximum":100,"description":"JPEG/WebP quality."},"scale":{"type":"integer","default":1,"minimum":1,"maximum":2,"description":"Device scale factor (2 = retina)."},"selector":{"type":"string","description":"Capture only the first element matching this CSS selector."},"response":{"type":"string","default":"image","enum":["image","json"],"description":"`image` returns the bytes; `json` returns metadata plus base64."},"device":{"type":"string","default":"custom","enum":["custom","desktop","laptop","tablet","mobile"],"description":"Viewport preset. `custom` uses width/height."},"waitUntil":{"type":"string","default":"networkidle2","enum":["load","domcontentloaded","networkidle0","networkidle2"],"description":"When the page counts as loaded."},"timeoutMs":{"type":"integer","default":20000,"minimum":1000,"maximum":30000,"description":"Page-load timeout in milliseconds."},"delayMs":{"type":"integer","default":0,"minimum":0,"maximum":5000,"description":"Extra wait after load (animations, late content)."},"darkMode":{"type":"boolean","default":false,"description":"Emulate prefers-color-scheme: dark."},"hideCookieBanners":{"type":"boolean","default":true,"description":"Remove common cookie/consent banners before capturing."},"blockAds":{"type":"boolean","default":false,"description":"Block common ad, analytics and tracking hosts."},"lazyLoad":{"type":"boolean","default":false,"description":"Scroll through the page first so lazy-loaded images appear."},"waitForSelector":{"type":"string","description":"Wait for this CSS selector before capturing (captures anyway on timeout)."},"hideSelectors":{"type":"string","description":"Comma-separated CSS selectors removed before capturing."}},"required":["url"]}}}},"responses":{"200":{"description":"The image (PNG/JPEG/WebP) when response=image, or JSON when response=json.","content":{"image/png":{"schema":{"type":"string","contentEncoding":"binary"}},"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"url":{"type":"string"},"finalUrl":{"type":"string"},"statusCode":{"type":"integer"},"title":{"type":"string"},"truncated":{"type":"boolean"},"format":{"type":"string"},"fullPage":{"type":"boolean"},"bytes":{"type":"integer"},"contentType":{"type":"string"},"image":{"type":"string"},"durationMs":{"type":"integer"}}},"example":{"success":true,"url":"https://example.com/","finalUrl":"https://example.com/","statusCode":200,"title":"Example Domain","truncated":false,"format":"png","fullPage":false,"bytes":23439,"contentType":"image/png","image":"iVBORw0KGgoAAAANSUhEUgAABQAAAAMgCAIAAADz+lisAAAAAXNSR0IArs4c...(base64 truncated)","durationMs":7223}}},"headers":{"x-final-url":{"schema":{"type":"string"},"description":"URL after redirects."},"x-target-status":{"schema":{"type":"string"},"description":"HTTP status of the target page."}}},"400":{"description":"Invalid parameter (`invalid_request`) or a private/local target (`url_not_allowed`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"url_not_allowed","message":"private, local and reserved hosts are not allowed"}}}}},"413":{"description":"Request body or target document too large (`too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The target site refused (`target_blocked`), could not be reached or its domain does not resolve (`target_unreachable`), the page does not exist (`target_error`, HTTP 404/410), or returned unsupported content.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"target_blocked","message":"The target refused the request: target returned HTTP 403","details":{"targetStatus":403,"finalUrl":"https://www.g2.com/"}}}}}},"502":{"description":"Temporary failure on our side (`upstream_error`); safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"The target did not respond in time (`timeout`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/pdf":{"get":{"operationId":"pdfGet","summary":"Print a web page to PDF (GET)","description":"Returns the PDF bytes by default (`response=pdf`), or JSON with the PDF as base64.","tags":["Screenshot"],"parameters":[{"name":"url","schema":{"type":"string"},"description":"Page URL. A bare domain such as `example.com` is accepted (https is assumed). Private, local and cloud-metadata addresses are refused.","required":true,"example":"https://example.com","in":"query"},{"name":"paper","schema":{"type":"string","default":"A4","enum":["A4","Letter","Legal"]},"description":"Paper size.","required":false,"in":"query"},{"name":"landscape","schema":{"type":"boolean","default":false},"description":"Landscape orientation.","required":false,"in":"query"},{"name":"printBackground","schema":{"type":"boolean","default":true},"description":"Print background colours and images.","required":false,"in":"query"},{"name":"response","schema":{"type":"string","default":"pdf","enum":["pdf","json"]},"description":"`pdf` returns the bytes; `json` returns metadata plus base64.","required":false,"in":"query"},{"name":"device","schema":{"type":"string","default":"custom","enum":["custom","desktop","laptop","tablet","mobile"]},"description":"Viewport preset. `custom` uses width/height.","required":false,"in":"query"},{"name":"waitUntil","schema":{"type":"string","default":"networkidle2","enum":["load","domcontentloaded","networkidle0","networkidle2"]},"description":"When the page counts as loaded.","required":false,"in":"query"},{"name":"timeoutMs","schema":{"type":"integer","default":20000,"minimum":1000,"maximum":30000},"description":"Page-load timeout in milliseconds.","required":false,"in":"query"},{"name":"delayMs","schema":{"type":"integer","default":0,"minimum":0,"maximum":5000},"description":"Extra wait after load (animations, late content).","required":false,"in":"query"},{"name":"darkMode","schema":{"type":"boolean","default":false},"description":"Emulate prefers-color-scheme: dark.","required":false,"in":"query"},{"name":"hideCookieBanners","schema":{"type":"boolean","default":true},"description":"Remove common cookie/consent banners before capturing.","required":false,"in":"query"},{"name":"blockAds","schema":{"type":"boolean","default":false},"description":"Block common ad, analytics and tracking hosts.","required":false,"in":"query"},{"name":"lazyLoad","schema":{"type":"boolean","default":false},"description":"Scroll through the page first so lazy-loaded images appear.","required":false,"in":"query"},{"name":"waitForSelector","schema":{"type":"string"},"description":"Wait for this CSS selector before capturing (captures anyway on timeout).","required":false,"in":"query"},{"name":"hideSelectors","schema":{"type":"string"},"description":"Comma-separated CSS selectors removed before capturing.","required":false,"in":"query"}],"responses":{"200":{"description":"The PDF when response=pdf, or JSON when response=json.","content":{"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}},"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"url":{"type":"string"},"finalUrl":{"type":"string"},"statusCode":{"type":"integer"},"title":{"type":"string"},"bytes":{"type":"integer"},"contentType":{"type":"string"},"pdf":{"type":"string"},"durationMs":{"type":"integer"}}},"example":{"success":true,"url":"https://example.com/","finalUrl":"https://example.com/","statusCode":200,"title":"Example Domain","bytes":39552,"contentType":"application/pdf","pdf":"JVBERi0xLjQKJdPr6eEKMSAwIG9iago8PC9UaXRsZSAoRXhhbXBsZSBEb21h...(base64 truncated)","durationMs":5078}}},"headers":{"x-final-url":{"schema":{"type":"string"},"description":"URL after redirects."},"x-target-status":{"schema":{"type":"string"},"description":"HTTP status of the target page."}}},"400":{"description":"Invalid parameter (`invalid_request`) or a private/local target (`url_not_allowed`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"url_not_allowed","message":"private, local and reserved hosts are not allowed"}}}}},"413":{"description":"Request body or target document too large (`too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The target site refused (`target_blocked`), could not be reached or its domain does not resolve (`target_unreachable`), the page does not exist (`target_error`, HTTP 404/410), or returned unsupported content.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"target_blocked","message":"The target refused the request: target returned HTTP 403","details":{"targetStatus":403,"finalUrl":"https://www.g2.com/"}}}}}},"502":{"description":"Temporary failure on our side (`upstream_error`); safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"The target did not respond in time (`timeout`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"pdf","summary":"Print a web page to PDF","description":"Returns the PDF bytes by default (`response=pdf`), or JSON with the PDF as base64.\n\nThe same parameters as the GET form, sent as a JSON body.","tags":["Screenshot"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Page URL. A bare domain such as `example.com` is accepted (https is assumed). Private, local and cloud-metadata addresses are refused."},"paper":{"type":"string","default":"A4","enum":["A4","Letter","Legal"],"description":"Paper size."},"landscape":{"type":"boolean","default":false,"description":"Landscape orientation."},"printBackground":{"type":"boolean","default":true,"description":"Print background colours and images."},"response":{"type":"string","default":"pdf","enum":["pdf","json"],"description":"`pdf` returns the bytes; `json` returns metadata plus base64."},"device":{"type":"string","default":"custom","enum":["custom","desktop","laptop","tablet","mobile"],"description":"Viewport preset. `custom` uses width/height."},"waitUntil":{"type":"string","default":"networkidle2","enum":["load","domcontentloaded","networkidle0","networkidle2"],"description":"When the page counts as loaded."},"timeoutMs":{"type":"integer","default":20000,"minimum":1000,"maximum":30000,"description":"Page-load timeout in milliseconds."},"delayMs":{"type":"integer","default":0,"minimum":0,"maximum":5000,"description":"Extra wait after load (animations, late content)."},"darkMode":{"type":"boolean","default":false,"description":"Emulate prefers-color-scheme: dark."},"hideCookieBanners":{"type":"boolean","default":true,"description":"Remove common cookie/consent banners before capturing."},"blockAds":{"type":"boolean","default":false,"description":"Block common ad, analytics and tracking hosts."},"lazyLoad":{"type":"boolean","default":false,"description":"Scroll through the page first so lazy-loaded images appear."},"waitForSelector":{"type":"string","description":"Wait for this CSS selector before capturing (captures anyway on timeout)."},"hideSelectors":{"type":"string","description":"Comma-separated CSS selectors removed before capturing."}},"required":["url"]}}}},"responses":{"200":{"description":"The PDF when response=pdf, or JSON when response=json.","content":{"application/pdf":{"schema":{"type":"string","contentEncoding":"binary"}},"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"url":{"type":"string"},"finalUrl":{"type":"string"},"statusCode":{"type":"integer"},"title":{"type":"string"},"bytes":{"type":"integer"},"contentType":{"type":"string"},"pdf":{"type":"string"},"durationMs":{"type":"integer"}}},"example":{"success":true,"url":"https://example.com/","finalUrl":"https://example.com/","statusCode":200,"title":"Example Domain","bytes":39552,"contentType":"application/pdf","pdf":"JVBERi0xLjQKJdPr6eEKMSAwIG9iago8PC9UaXRsZSAoRXhhbXBsZSBEb21h...(base64 truncated)","durationMs":5078}}},"headers":{"x-final-url":{"schema":{"type":"string"},"description":"URL after redirects."},"x-target-status":{"schema":{"type":"string"},"description":"HTTP status of the target page."}}},"400":{"description":"Invalid parameter (`invalid_request`) or a private/local target (`url_not_allowed`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"url_not_allowed","message":"private, local and reserved hosts are not allowed"}}}}},"413":{"description":"Request body or target document too large (`too_large`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The target site refused (`target_blocked`), could not be reached or its domain does not resolve (`target_unreachable`), the page does not exist (`target_error`, HTTP 404/410), or returned unsupported content.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"success":false,"error":{"code":"target_blocked","message":"The target refused the request: target returned HTTP 403","details":{"targetStatus":403,"finalUrl":"https://www.g2.com/"}}}}}},"502":{"description":"Temporary failure on our side (`upstream_error`); safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"The target did not respond in time (`timeout`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["success","error"],"properties":{"success":{"const":false},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["not_configured","unauthorized","not_found","method_not_allowed","invalid_request","rate_limited","url_not_allowed","target_blocked","target_unreachable","target_error","unsupported_content","too_large","timeout","upstream_error","board_not_found","app_not_found"]},"message":{"type":"string"},"retryable":{"type":"boolean","description":"true for rate_limited, timeout, upstream_error and browser_busy; false for other errors."},"retryAfterSeconds":{"type":"integer","description":"Seconds to wait before retrying, when a numeric Retry-After header is present."},"details":{"type":"object","additionalProperties":true}}}}}}}}