{"dataStatus":{"requestParameter":"url=https://gugudata.github.io/gugudata-io/guides/webpage-screenshot-capture-api/&responseFormat=url&fullPage=true&width=1920&height=1080&deviceScaleFactor=1&isMobile=false","statusCode":200,"status":"SUCCESS","statusDescription":"successfully","responseDateTime":"2026-11-17 19:58:04+0000","dataTotalCount":1},"data":{"image":"https://storage.gugudata.io/url2snapshot/150547ce-090c-476c-86f1-eb7a0ecc698f.png","content":"<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width\"><meta name=\"generator\" content=\"Astro v7.3.2\"><meta name=\"description\" content=\"Capture webpages as PNG images for reviews, reports, and visual records. Choose full-page or viewport captures and receive Base64 or an image link.\"><meta name=\"theme-color\" content=\"#ffffff\"><link rel=\"canonical\" href=\"https://gugudata.github.io/gugudata-io/guides/webpage-screenshot-capture-api/\"><link rel=\"alternate\" type=\"application/rss+xml\" title=\"GuGuData.io Guides\" href=\"https://gugudata.github.io/gugudata-io/rss.xml\"><meta property=\"og:type\" content=\"article\"><meta property=\"og:title\" content=\"Webpage Screenshot Capture API Guide | GuGuData.io Guides\"><meta property=\"og:description\" content=\"Capture webpages as PNG images for reviews, reports, and visual records. Choose full-page or viewport captures and receive Base64 or an image link.\"><meta property=\"og:url\" content=\"https://gugudata.github.io/gugudata-io/guides/webpage-screenshot-capture-api/\"><meta property=\"og:site_name\" content=\"GuGuData.io Guides\"><meta name=\"twitter:card\" content=\"summary\"><meta property=\"article:published_time\" content=\"2026-04-10T00:00:00.000Z\"><meta property=\"article:modified_time\" content=\"2026-09-08T00:00:00.000Z\"><title>Webpage Screenshot Capture API Guide | GuGuData.io Guides</title><style>.prose img,.prose svg{background:#f7faff;border:1px solid #e7eaf3;border-radius:16px;width:100%;height:auto;margin:28px auto;display:block}.prose img[alt*=data\\ flow i],.prose img[src*=\"/diagrams/\"]{padding:0;box-shadow:0 16px 42px #14245414}.prose figure{margin:32px 0}.prose figure img,.prose figure svg{margin-bottom:10px}.prose figcaption{color:#677788;text-align:center;font-size:14px;line-height:1.5}@media (width<=720px){.prose img,.prose svg{border-radius:12px;margin-block:22px}.prose table{max-width:100%;display:block;overflow-x:auto}}\n</style><link rel=\"stylesheet\" href=\"/gugudata-io/_astro/BaseLayout.BFxEOWY_.css\"></head><body><a class=\"skip-link\" href=\"#main-content\">Skip to content</a><header class=\"site-header\" data-astro-cid-fzpbxy5g=\"\"><div class=\"header-inner\" data-astro-cid-fzpbxy5g=\"\"><a class=\"brand\" href=\"/gugudata-io/\" aria-label=\"GuGuData.io Guides home\" data-astro-cid-fzpbxy5g=\"\"><span data-astro-cid-fzpbxy5g=\"\">GuGuData.io</span> Guides</a><nav aria-label=\"Primary navigation\" data-astro-cid-fzpbxy5g=\"\"><a class=\"active\" href=\"/gugudata-io/\" data-astro-cid-fzpbxy5g=\"\">Guides</a><a href=\"https://gugudata.io/list/\" data-astro-cid-fzpbxy5g=\"\">API Marketplace</a><a href=\"https://developers.gugudata.io/\" data-astro-cid-fzpbxy5g=\"\">Developer Docs</a><a href=\"https://github.com/GuGuData/gugudata-io\" data-astro-cid-fzpbxy5g=\"\">GitHub</a></nav></div></header><main id=\"main-content\"><script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"TechArticle\",\"headline\":\"Webpage Screenshot Capture API Guide\",\"description\":\"Capture webpages as PNG images for reviews, reports, and visual records. Choose full-page or viewport captures and receive Base64 or an image link.\",\"datePublished\":\"2026-04-10T00:00:00.000Z\",\"dateModified\":\"2026-09-08T00:00:00.000Z\",\"inLanguage\":\"en\",\"author\":{\"@type\":\"Organization\",\"name\":\"GuGuData.io\"},\"publisher\":{\"@type\":\"Organization\",\"name\":\"GuGuData.io\"},\"mainEntityOfPage\":\"https://gugudata.github.io/gugudata-io/guides/webpage-screenshot-capture-api/\"}</script><div class=\"article-shell container\"><article class=\"article\"><nav class=\"breadcrumb\" aria-label=\"Breadcrumb\"><a href=\"/gugudata-io/\">Guides</a><span aria-hidden=\"true\">/</span><span>Website Tools</span></nav><header class=\"article-header\"><h1>Webpage Screenshot Capture API Guide</h1><p class=\"standfirst\">Capture webpages as PNG images for reviews, reports, and visual records. Choose full-page or viewport captures and receive Base64 or an image link.</p><div class=\"article-meta\"><time datetime=\"2026-09-08T00:00:00.000Z\">Updated September 8, 2026</time><span aria-hidden=\"true\">·</span><span>3 min read</span></div><div class=\"article-actions\"><a class=\"button primary\" href=\"https://api.gugudata.io/v1/websitetools/url2snapshot/demo\">Try the live demo</a><a class=\"button text\" href=\"https://gugudata.io/details/url2snapshot\">View API details →</a></div></header><div class=\"prose\"><h1 id=\"webpage-screenshot-capture-api\">Webpage Screenshot Capture API</h1>\n<p>Capture public webpages as PNG images for content reviews, reporting, and visual records.\nChoose a full-page image or a fixed viewport, then receive Base64 text or a public download link.\nThe response also includes rendered page HTML when available.</p>\n<p><a href=\"https://gugudata.io/details/url2snapshot\">View API details</a> or\n<a href=\"https://api.gugudata.io/v1/websitetools/url2snapshot/demo\">try the Demo</a>.</p>\n<h2 id=\"capture-a-page\">Capture a page</h2>\n<p>Send <code>POST https://api.gugudata.io/v1/websitetools/url2snapshot</code> with JSON.\nPlace <code>appkey</code> in the query string, not in the JSON body. Keep your key on your server.</p>\n<pre class=\"astro-code github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;\" tabindex=\"0\" data-language=\"bash\"><code><span class=\"line\"><span style=\"color:#FFA657\">curl</span><span style=\"color:#A5D6FF\"> 'https://api.gugudata.io/v1/websitetools/url2snapshot?appkey=YOUR_APPKEY'</span><span style=\"color:#FF7B72\"> \\</span></span>\n<span class=\"line\"><span style=\"color:#79C0FF\">  -H</span><span style=\"color:#A5D6FF\"> 'Content-Type: application/json'</span><span style=\"color:#FF7B72\"> \\</span></span>\n<span class=\"line\"><span style=\"color:#79C0FF\">  --data</span><span style=\"color:#A5D6FF\"> '{\"url\":\"https://gugudata.io/\",\"responseFormat\":\"url\",\"fullPage\":false,\"width\":1280,\"height\":720}'</span></span></code></pre>\n<table>\n<thead>\n<tr>\n<th>JSON field</th>\n<th>Default</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>url</code></td>\n<td>Required</td>\n<td>Complete public HTTP/HTTPS URL, at most 2048 characters; no credentials, literal IP addresses, or non-standard ports.</td>\n</tr>\n<tr>\n<td><code>responseFormat</code></td>\n<td><code>base64</code></td>\n<td>Use <code>url</code> for a public image link or <code>base64</code> for PNG Base64 text. Other values retain the legacy Base64 behavior.</td>\n</tr>\n<tr>\n<td><code>fullPage</code></td>\n<td><code>true</code></td>\n<td>Capture the page height rather than only the viewport.</td>\n</tr>\n<tr>\n<td><code>width</code></td>\n<td><code>1920</code></td>\n<td>Viewport width in CSS pixels, 1–8192.</td>\n</tr>\n<tr>\n<td><code>height</code></td>\n<td><code>1080</code></td>\n<td>Viewport height in CSS pixels, 1–8192.</td>\n</tr>\n<tr>\n<td><code>deviceScaleFactor</code></td>\n<td><code>1</code></td>\n<td>Integer scale, 1–3.</td>\n</tr>\n<tr>\n<td><code>userAgent</code></td>\n<td>Default desktop agent</td>\n<td>Optional string up to 1024 characters, without control characters.</td>\n</tr>\n<tr>\n<td><code>isMobile</code></td>\n<td><code>false</code></td>\n<td>Enable mobile viewport emulation.</td>\n</tr>\n</tbody>\n</table>\n<p>The scaled viewport area (<code>width × height × deviceScaleFactor²</code>) must not exceed\n64,000,000 pixels. A full-page image can be taller than <code>height</code> and is still subject\nto image size limits. PNG output is limited to 32 MiB and 64 million pixels;\nan oversized or invalid image fails instead of being returned as a successful capture.</p>\n<h2 id=\"read-the-result\">Read the result</h2>\n<p>Successful responses use the existing <code>dataStatus</code> and <code>data</code> envelope.\nCheck both HTTP status and <code>dataStatus.statusCode</code> before using the result.</p>\n<table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>data.image</code></td>\n<td>string</td>\n<td>PNG Base64 text, or a public image link when <code>responseFormat</code> is <code>url</code>.</td>\n</tr>\n<tr>\n<td><code>data.content</code></td>\n<td>string</td>\n<td>Rendered HTML, or an empty string when no HTML is returned.</td>\n</tr>\n<tr>\n<td><code>dataStatus.requestParameter</code></td>\n<td>string</td>\n<td>Source host/path and capture options; source query values and credentials are omitted.</td>\n</tr>\n</tbody>\n</table>\n<p>This illustrative <code>data</code> fragment shows URL mode; the address is a placeholder, not a saved capture:</p>\n<pre class=\"astro-code github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;\" tabindex=\"0\" data-language=\"json\"><code><span class=\"line\"><span style=\"color:#E6EDF3\">{</span></span>\n<span class=\"line\"><span style=\"color:#7EE787\">  \"image\"</span><span style=\"color:#E6EDF3\">: </span><span style=\"color:#A5D6FF\">\"https://assets.example/snapshot.png\"</span><span style=\"color:#E6EDF3\">,</span></span>\n<span class=\"line\"><span style=\"color:#7EE787\">  \"content\"</span><span style=\"color:#E6EDF3\">: </span><span style=\"color:#A5D6FF\">\"&lt;!doctype html&gt;&lt;html&gt;&lt;body&gt;&lt;h1&gt;Example page&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;\"</span></span>\n<span class=\"line\"><span style=\"color:#E6EDF3\">}</span></span></code></pre>\n<p>For Base64 mode, decode <code>data.image</code> into PNG bytes before saving or displaying it.\nFor URL mode, download and save the image if you need to retain it. The URL is public;\ndo not assume permanent hosting or treat it as private storage.</p>\n<p>Treat <code>data.content</code> as untrusted HTML. It is not sanitized content and should not be\ninserted directly into your application. Page animations, late-loading content, consent\ndialogs, and site access restrictions can affect captures; identical output is not guaranteed.</p>\n<h2 id=\"demo-behavior\">Demo behavior</h2>\n<p>The Demo captures this <a href=\"https://gugudata.github.io/gugudata-io/guides/webpage-screenshot-capture-api/\">public guide page</a>\nwith a 1920 × 1080 viewport, full-page capture, scale 1, and URL output.\nIts request metadata includes the public input link.</p>\n<p>A successful result is cached for 15 minutes. <code>X-GuGuData-Demo-Mode</code> reports <code>live</code>\nor <code>cached</code>, and <code>X-GuGuData-Generated-At</code> identifies when that cached result was generated.\nFailed captures are not cached. Use your authenticated request for your own pages.</p>\n<h2 id=\"handle-failures\">Handle failures</h2>\n<ul>\n<li><code>400</code>: correct the URL, JSON, viewport, scale, or user-agent value.</li>\n<li><code>401</code> / <code>403</code>: check the application key and product access.</li>\n<li><code>429</code>: reduce request frequency and follow any retry guidance in the response.</li>\n<li><code>500</code> / <code>503</code>: capture or storage could not complete. Handle the failure explicitly;\ndo not display a missing image as a successful capture or retry indefinitely.</li>\n</ul>\n<p>Avoid logging full source URLs, keys, HTML, or Base64 output. Record safe request context\nand response status instead.</p>\n<h2 id=\"related-apis\">Related APIs</h2>\n<ul>\n<li><a href=\"https://gugudata.io/details/readability\">Readable content extraction</a></li>\n<li><a href=\"https://gugudata.io/details/url2markdown\">Webpage Markdown</a></li>\n<li><a href=\"https://gugudata.io/details/url2links\">Webpage links</a></li>\n</ul>\n<p>See the <a href=\"https://gugudata.io/assets/openapi/gugudata.openapi.3.1.json\">OpenAPI specification</a>\nfor the full response schema.</p>\n</div></article><aside class=\"toc\" aria-label=\"On this page\"><strong>On this page</strong><nav><a href=\"#capture-a-page\">Capture a page</a><a href=\"#read-the-result\">Read the result</a><a href=\"#demo-behavior\">Demo behavior</a><a href=\"#handle-failures\">Handle failures</a><a href=\"#related-apis\">Related APIs</a></nav></aside></div></main><footer class=\"site-footer\"><div class=\"footer-inner\"><p>© 2026 GuGuData.io</p><nav aria-label=\"Footer navigation\"><a href=\"https://gugudata.io/\">GuGuData.io</a><a href=\"https://gugudata.io/assets/openapi/gugudata.openapi.3.1.json\">OpenAPI</a><a href=\"https://www.postman.com/gugudata\">Postman</a><a href=\"/gugudata-io/rss.xml\">RSS</a></nav></div></footer></body></html>"}}