How to Capture a Full-Page Screenshot with ScreenshotAPI
Capture a full-page screenshot with ScreenshotAPI using full_page=true. Set the output format and dimensions, save the response, and troubleshoot common rendering issues.
To capture a full-page screenshot with ScreenshotAPI, get an API key, send a GET request to its screenshot endpoint with the page URL and full_page=true, then save the image response. Choose an output format and viewport dimensions for your use case. The example below follows ScreenshotAPI’s current full-page tool example; replace the placeholder key and target URL.
curl --fail --show-error --silent \
--get 'https://shot.screenshotapi.net/v3/screenshot' \
--data-urlencode 'token=YOUR_API_KEY' \
--data-urlencode 'url=https://example.com' \
--data-urlencode 'file_type=png' \
--data-urlencode 'full_page=true' \
--data-urlencode 'width=1680' \
--data-urlencode 'height=867' \
--output full-page-screenshot.png
ScreenshotAPI documents full_page=true as the switch that captures the full scrollable page rather than only the currently visible viewport. Its tool page also describes scrolling to trigger lazy-loaded content, but dynamic pages can still behave differently depending on their scripts and content. See ScreenshotAPI’s full-page screenshot example and its getting-started documentation.
1. Get a key and prepare the request
Register or sign in through ScreenshotAPI’s Dashboard to obtain an API key. Keep it private: do not put a live token in source control, a public page, or a client-side application. The endpoint used by the current full-page example is https://shot.screenshotapi.net/v3/screenshot. The request needs a token and target url; add the full-page option and any output settings you need.
Use URL encoding for the target URL, especially when it contains query parameters, ampersands, or non-ASCII characters. The cURL example uses --data-urlencode so the URL is encoded as a query parameter safely.
2. Choose the capture and output settings
| Setting | What it controls | Practical guidance |
|---|---|---|
full_page=true |
Requests the entire scrollable page instead of just the viewport. | Use it for long pages. It does not guarantee that every dynamically inserted item has loaded. |
url |
The page to render. | Provide a complete URL, including https:// where appropriate. |
token |
Your ScreenshotAPI credential. | Use a secret placeholder in examples and store the real key in a secret manager or environment variable. |
file_type |
Output format. The documentation lists PNG, JPEG, WebP, and PDF. | Choose based on whether you need an image or document and your quality and file-size needs. No format is universally best. |
width and height |
Browser dimensions used for rendering. | Set these to approximate the layout you need. A full-page request and the browser viewport dimensions are separate choices. |
fresh=true |
Requests a fresh capture when a previous screenshot has already been returned. | Add it when you need to avoid reusing a prior result, according to the getting-started documentation. |
ScreenshotAPI supports GET and POST according to its getting-started documentation. The examples here use GET because that is the format shown in its full-page tool example. Consult the current documentation and your Dashboard for the supported parameter details before relying on older endpoint patterns.
3. Capture from Python
This example uses only the Python standard library. It URL-encodes the query, checks for an HTTP error, and writes the response bytes to a PNG file.
from urllib.error import HTTPError, URLError
from urllib.parse import urlencode
from urllib.request import urlopen
endpoint = "https://shot.screenshotapi.net/v3/screenshot"
params = {
"token": "YOUR_API_KEY",
"url": "https://example.com",
"file_type": "png",
"full_page": "true",
"width": "1680",
"height": "867",
}
request_url = f"{endpoint}?{urlencode(params)}"
try:
with urlopen(request_url, timeout=120) as response:
image_bytes = response.read()
content_type = response.headers.get("Content-Type", "")
if not content_type.startswith("image/"):
raise RuntimeError(
f"Expected an image response, received {content_type!r}"
)
with open("full-page-screenshot.png", "wb") as output:
output.write(image_bytes)
except HTTPError as exc:
print(f"ScreenshotAPI returned HTTP {exc.code}: {exc.read().decode(errors='replace')}")
raise
except URLError as exc:
print(f"Could not reach ScreenshotAPI: {exc.reason}")
raise
If requesting PDF, change file_type to the documented PDF option and use a matching output filename. Confirm the response type in your integration before treating its bytes as an image.
4. Capture from Node.js
This runnable example uses the built-in fetch API available in modern Node.js releases. It validates the HTTP response and saves the returned bytes.
import { writeFile } from "node:fs/promises";
const params = new URLSearchParams({
token: "YOUR_API_KEY",
url: "https://example.com",
file_type: "png",
full_page: "true",
width: "1680",
height: "867",
});
const response = await fetch(
`https://shot.screenshotapi.net/v3/screenshot?${params}`,
{ signal: AbortSignal.timeout(120_000) }
);
if (!response.ok) {
const detail = await response.text();
throw new Error(`ScreenshotAPI returned HTTP ${response.status}: ${detail}`);
}
const contentType = response.headers.get("content-type") ?? "";
if (!contentType.startsWith("image/")) {
throw new Error(`Expected an image response, received ${contentType}`);
}
await writeFile("full-page-screenshot.png", Buffer.from(await response.arrayBuffer()));
For a PDF response, request PDF output, use a .pdf filename, and adjust the content-type check to accept the response type documented for that output.
5. Validate and use the result
- Check the command or program’s exit status and HTTP status before consuming the file.
- Confirm the response is the expected media type; APIs may return an error document instead of image bytes.
- Open the output and check the top, middle, and bottom of the page. Verify that menus, lazy-loaded sections, and the page footer appear as expected.
- For automated jobs, write to a temporary filename first and move it into place only after a successful response, so a failed capture does not overwrite a valid prior file.
6. Troubleshoot common problems
| Symptom | Likely cause | What to try |
|---|---|---|
| Only the visible viewport appears | The full-page option is missing, misspelled, or not sent as a true value. | Send full_page=true and verify the request query after URL encoding. |
| The request is rejected | The API key is absent, invalid, or placed under the wrong parameter name. | Check the Dashboard key and use the documented token parameter for this ScreenshotAPI endpoint. |
| The URL loads the wrong page or fails | The target URL was malformed or its query string was encoded incorrectly. | Use a complete URL and let your HTTP client encode it. With cURL, use --data-urlencode. |
| The image is blank or incomplete | The page may require scripts, data, or additional time before content appears; the site may also block automated rendering. | Check the target page in a browser, retry with the correct URL, and inspect the returned status and response body. The reviewed documentation does not promise that every dynamic page will render completely. |
| Lazy-loaded sections are missing | Some content may load only after specific scrolling or interaction. | Inspect whether the site needs a particular interaction or wait. ScreenshotAPI describes scrolling to trigger lazy loading, but this is not a guarantee for every implementation. |
| A spreadsheet is cut off | Its layout may depend on browser height as well as full-page mode. | ScreenshotAPI’s help page advises choosing an appropriate browser height in addition to enabling full-page capture. Adjust the height and inspect the resulting layout. |
| The saved file is not a valid image | An error response or other content was saved with an image extension. | Check the HTTP status and response content type before writing or using the bytes. |
| The screenshot shows old content | A prior screenshot may have been returned from cache. | Use fresh=true when a current capture is needed, as described in the getting-started docs. |
7. Performance, reliability, and cost considerations
A full-page capture may involve rendering a much taller document than a viewport-only capture. Large pages can produce large response bodies and longer processing times. Request only the dimensions and format the destination needs, set a client timeout suitable for your workload, and avoid launching unbounded parallel captures from a batch job.
For reliable automation, treat the capture as a network operation: handle non-success responses, distinguish error bodies from image bytes, and retry transient connection failures with a limit and backoff. Avoid retrying credential or request-validation errors unchanged. If freshness matters, account for ScreenshotAPI’s documented fresh=true option. The dossier provides no independently verified timing, reliability, or pricing benchmarks, so measure the behavior and cost against your own pages and usage.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server for developers. One GET request can return a screenshot or PDF. Its full-page option loads lazy images, and its API also supports viewport and device settings, custom waits, and other capture controls. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" \
-d access_key=YOUR_API_KEY \
--data-urlencode url=https://example.com \
-d full_page=true \
-o full-page-screenshot.webp
Cookie banners, popups, and chat widgets are removed before the shot. Bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo and get 1,000 free screenshots a month, with no card.
Frequently asked questions
What is a full-page screenshot?
It captures the document beyond the visible browser viewport, including content farther down the page, in one output.
Does full-page mode guarantee every dynamic section appears?
No. Sites can load content in response to timing, scrolling, or interaction. Inspect the output for the pages that matter to your workflow.
Can I request a PDF instead of an image?
ScreenshotAPI documentation lists PDF as an output choice. Select PDF output and save the response with a PDF filename, checking the response type before using it.
Why might a spreadsheet need a taller browser height?
Some spreadsheet layouts depend on browser height. ScreenshotAPI’s help guidance says to combine an appropriate height with full-page mode, then verify the output.
How do I force a fresh capture?
The getting-started documentation describes adding fresh=true when a previous screenshot has already been returned.


