How to Capture a Full-Page Website Screenshot with APITemplate.io
APITemplate.io’s surfaced API docs describe template rendering, not arbitrary-URL website screenshots. Here’s what they establish and how to capture a whole page.
Short answer: The APITemplate.io documentation surfaced for this guide does not establish an API that captures an arbitrary live website URL from top to bottom. It describes generating images and PDFs from templates using JSON data. If your goal is a screenshot of a live page, use a URL-based screenshot tool or capture the page with a browser automation library such as Playwright.
APITemplate’s reference also marks its v1 REST API as no longer supported and recommends v2. The material reviewed here does not establish whether v2 adds URL-based screenshot capture, so check the current APITemplate API documentation before building around that capability. Do not treat the older v1 template request as a current screenshot recipe.
What APITemplate.io documents
The documented workflow is template rendering: prepare a template, send JSON data through the API, and receive a generated image or PDF. That is useful for producing designed, repeatable assets from structured data. It is different from loading an arbitrary live URL in a browser and recording the rendered page.
| Need | Documented template workflow | URL-based website capture |
|---|---|---|
| Input | Template identifier and structured JSON data | A live page URL and capture settings |
| Purpose | Generate a designed visual or document | Record what a browser renders on a website |
| Whole-page capture | Not established by the surfaced docs | Depends on the screenshot tool’s full-page support |
| Dynamic page behavior | Template data populates a design | Browser rendering may need waits, cookies, or interaction |
The older v1 overview describes a POST request with a template ID and an X-API-KEY header, returning a download URL for the generated file. That is evidence of the template-generation flow, not a live website screenshot endpoint. Since v1 is marked unsupported, this article does not present that request as a working current recipe.
First, verify whether your APITemplate use case is template rendering
- Open APITemplate’s current v2 documentation and find the endpoint that matches your intended output.
- Check the required input. A template ID and JSON data indicate template rendering; an arbitrary URL parameter and browser capture options would be needed for URL-based capture.
- Confirm the response format and lifecycle: generated file, download URL, retention period, and any asynchronous status flow.
- Check that the API version is currently supported before integrating it into production.
The dossier used for this guide does not verify an APITemplate v2 URL-capture endpoint. If the current reference does not document one, use a browser or screenshot API for the live-page task instead of adapting a template request.
Capture a full-page screenshot yourself with Playwright
For a live website, a browser automation tool can navigate to the URL and save the full document. The following examples use Playwright. Install its browser binaries before running them, and choose a page you are authorized to access.
Node.js
npm install playwright
npx playwright install chromium
// screenshot.mjs
import { chromium } from 'playwright';
const url = process.argv[2] ?? 'https://example.com';
const browser = await chromium.launch({ headless: true });
try {
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
const response = await page.goto(url, { waitUntil: 'networkidle', timeout: 45000 });
if (!response || !response.ok()) {
throw new Error(`Navigation failed: ${response?.status() ?? 'no response'}`);
}
await page.screenshot({ path: 'full-page.png', fullPage: true });
console.log('Saved full-page.png');
} finally {
await browser.close();
}
node screenshot.mjs https://example.com
fullPage: true captures beyond the viewport. A page with lazy-loaded images or infinite scrolling may need extra preparation; see the edge cases below. networkidle is a useful default for many sites, but analytics and persistent connections can prevent it from being reached.
Python
python -m pip install playwright
python -m playwright install chromium
# screenshot.py
import asyncio
import sys
from playwright.async_api import async_playwright
async def main():
url = sys.argv[1] if len(sys.argv) > 1 else "https://example.com"
async with async_playwright() as p:
browser = await p.chromium.launch(headless=True)
try:
page = await browser.new_page(viewport={"width": 1440, "height": 900})
response = await page.goto(url, wait_until="networkidle", timeout=45_000)
if response is None or not response.ok:
status = response.status if response else "no response"
raise RuntimeError(f"Navigation failed: {status}")
await page.screenshot(path="full-page.png", full_page=True)
print("Saved full-page.png")
finally:
await browser.close()
asyncio.run(main())
python screenshot.py https://example.com
cURL and APITemplate.io
cURL can call an HTTP API, but the surfaced APITemplate documentation here does not establish a URL-to-full-page screenshot endpoint. There is therefore no verified APITemplate cURL command to capture an arbitrary website. Do not send a live page URL to the template-generation endpoint unless current v2 documentation explicitly documents that input and behavior.
Handle page behavior that affects full-page captures
- Lazy-loaded images: They may only load when brought near the viewport. Scroll through the page in increments, wait for image loading, then capture. Pages that use infinite scrolling need a defined stopping condition; otherwise “the whole page” has no stable endpoint.
- Animations and rotating content: Disable animation through page styles where appropriate or wait for a stable state. A screenshot records one moment, so carousels and live data can vary between runs.
- Cookie banners and overlays: Handle consent according to the site’s expected visitor flow. A banner can cover content or change the page after acceptance.
- Authentication: Use a dedicated test account and the site’s intended login flow. Avoid placing credentials in source code or logging cookies and tokens.
- Very long pages: Large full-page images consume more time and memory. Consider a smaller viewport scale, a PDF, or multiple section captures if the output becomes unwieldy.
- Cross-origin and protected content: A browser may display an access denial, bot check, or incomplete page. Automation does not guarantee access; respect the site’s terms and access controls.
Common failures and fixes
| Symptom | Likely cause | What to try |
|---|---|---|
| Navigation timeout | The page keeps connections open or loads slowly | Use domcontentloaded or load and then wait for a specific selector. Increase timeout only when the page genuinely needs more time. |
| Blank or partial image | Capture started before the main content rendered | Wait for a content selector or a short, bounded delay after navigation. |
| Images missing below the fold | Lazy loading did not trigger | Scroll down in steps before capture and wait for image requests to settle. |
| Cookie dialog covers the page | Consent UI remains visible | Use the page’s consent controls when authorized, or hide the specific overlay in a controlled capture environment. |
| Browser executable missing | Playwright package installed without its browser binary | Run the matching playwright install chromium command for your language environment. |
| APITemplate request does not accept a URL | The documented template workflow expects template data, not an arbitrary page URL | Check current v2 docs for an explicit URL-capture endpoint; otherwise use browser automation or a URL screenshot API. |
Reliability, speed, and cost considerations
Self-hosted browser capture gives control over browser version, viewport, waits, and authentication, but you operate the browser process and its dependencies. Reuse a browser for batches of captures where practical, create a fresh page or context per job, set navigation and job timeouts, and close contexts even when a capture fails. Retry transient navigation errors with a small limit and backoff; repeated retries will not fix a blocked page or invalid URL.
Full-page captures can be slower and larger than viewport shots, particularly on image-heavy pages. Set output dimensions and a maximum execution time that fit your workload. For repeat captures, cache by URL plus relevant settings and invalidate when content changes. Your infrastructure cost depends on browser runtime, memory, storage, and concurrency; the surfaced APITemplate material does not establish a cost for URL-based capture.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. One GET request can capture a URL as an image or PDF; full-page capture supports lazy images. Cookie banners, popups, and chat widgets are removed before the shot, and each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with the result identified in response headers.
Use the documented ScreenshotNeo API options to set full-page capture and other options:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
The API also supports element capture, device presets, custom waits, request blocking, custom headers and cookies, caching, async jobs, bulk capture, and more. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up free for 1,000 screenshots a month, with no card required.
FAQ
Does APITemplate.io take screenshots of any website URL?
The API documentation surfaced for this article does not establish that capability. It documents image and PDF generation from templates. Check current v2 documentation for any newer URL-capture feature.
Can I use APITemplate v1 for this?
The surfaced API reference says v1 is no longer supported and recommends v2. Its described template request is not a website screenshot recipe.
What is the difference between a full-page screenshot and a PDF?
A screenshot is a raster image of the rendered page; a PDF is a paginated document format. Which is more useful depends on whether you need a visual snapshot or a document for printing and sharing.
Can Playwright capture an infinite-scroll page completely?
Not as a single naturally bounded document if more content appears indefinitely. Define a stopping rule, such as a maximum scroll depth or item count, and capture once that limit is reached.


