How to Take Full-Page Screenshots of Indian Ecommerce Sites with URL2PNG
Use URL2PNG’s v6 API with fullpage=true to request an ecommerce page’s full document canvas. This guide covers signed requests, rendering options, and common problems.
To request a full-page screenshot with URL2PNG, send a signed v6 API request with fullpage=true. URL2PNG says this option will attempt to capture the entire document canvas; the default is a viewport-only image. Full-page capture is an attempt, not a guarantee that every section of every page will render correctly. See the URL2PNG Quickstart Guide.
The “Indian” part of the title describes the target sites, not a documented India-based capture location. URL2PNG documents an accept_languages header override, but that does not establish Indian network geolocation or guarantee region-specific content. Check the resulting image for the exact page and view you need.
1. Prepare a signed v6 request
URL2PNG’s v6 request URL has this form:
https://api.url2png.com/v6/APIKEY/TOKEN/png/?QUERY_STRING
The query string contains the target URL and options. The token is the MD5 hash of the complete query string followed by your secret key. The API key and secret are account credentials. Generate the token on a server you control; do not place the secret in browser JavaScript, a public page, or a client application.
- Choose the exact public product or category page URL you want to capture.
- Choose a viewport width and height that suit the desktop or mobile layout you want to inspect.
- Add
fullpage=trueand any needed language or timing options. - Build the query string, calculate the token from that exact string plus the secret, and request the resulting URL.
- Open the image and check that the page sections, images, and layout are present.
Keep the query string used to compute the token identical to the query string sent in the request. Encoding, parameter order, or value changes can invalidate the signature.
2. Capture a full page with cURL
This Bash example builds the URL-encoded query string and token, then saves the response. Set the credentials as environment variables in your shell or secret manager. The example uses a placeholder target; replace it with the public page you are authorized to capture.
#!/usr/bin/env bash
set -euo pipefail
: "${URL2PNG_API_KEY:?Set URL2PNG_API_KEY}"
: "${URL2PNG_SECRET:?Set URL2PNG_SECRET}"
TARGET_URL='https://example.in/products/item'
QUERY="$(python3 -c 'import urllib.parse,sys; print(urllib.parse.urlencode([("url",sys.argv[1]),("fullpage","true"),("viewport","1280x1024")]))' "$TARGET_URL")"
TOKEN="$(printf '%s' "${QUERY}${URL2PNG_SECRET}" | md5sum | awk '{print $1}')"
curl --fail --show-error --silent \
"https://api.url2png.com/v6/${URL2PNG_API_KEY}/${TOKEN}/png/?${QUERY}" \
--output screenshot.png
The example asks for a 1280×1024 viewport and full-page capture. `fullpage=true` concerns the document canvas; the viewport controls the browser layout width and height. A narrower viewport may trigger a mobile layout, but the right dimensions depend on the site and the view you want.
3. Generate the URL in Python
This runnable Python example signs the full query string, requests the image, checks for an HTTP error, and writes the response to disk. Install the dependency with python -m pip install requests. Store credentials in environment variables.
import hashlib
import os
from urllib.parse import urlencode
import requests
api_key = os.environ["URL2PNG_API_KEY"]
secret = os.environ["URL2PNG_SECRET"]
target_url = "https://example.in/products/item"
params = [
("url", target_url),
("fullpage", "true"),
("viewport", "1280x1024"),
]
query_string = urlencode(params)
token = hashlib.md5((query_string + secret).encode("utf-8")).hexdigest()
request_url = (
f"https://api.url2png.com/v6/{api_key}/{token}/png/?{query_string}"
)
response = requests.get(request_url, timeout=120)
response.raise_for_status()
with open("screenshot.png", "wb") as image_file:
image_file.write(response.content)
print("Saved screenshot.png", len(response.content), "bytes")
Use the URL2PNG documentation’s signing rules and code samples as the authority for request construction. MD5 here is used as the documented token construction, not as a general-purpose password storage method. Never log the secret. Be careful about logging signed URLs if they can be reused to access your account.
4. Generate the URL in Node.js
This Node.js example uses built-in modules, signs the encoded query string, fetches the result, and saves it. It requires a modern Node.js version with global fetch.
import { createHash } from "node:crypto";
import { writeFile } from "node:fs/promises";
const apiKey = process.env.URL2PNG_API_KEY;
const secret = process.env.URL2PNG_SECRET;
if (!apiKey || !secret) {
throw new Error("Set URL2PNG_API_KEY and URL2PNG_SECRET");
}
const params = new URLSearchParams([
["url", "https://example.in/products/item"],
["fullpage", "true"],
["viewport", "1280x1024"],
]);
const queryString = params.toString();
const token = createHash("md5")
.update(queryString + secret, "utf8")
.digest("hex");
const requestUrl =
`https://api.url2png.com/v6/${apiKey}/${token}/png/?${queryString}`;
const response = await fetch(requestUrl);
if (!response.ok) {
throw new Error(`URL2PNG returned HTTP ${response.status}`);
}
await writeFile("screenshot.png", Buffer.from(await response.arrayBuffer()));
console.log("Saved screenshot.png");
Keep this code on a server. A browser-side implementation would expose the secret needed to create valid tokens.
5. Choose viewport, language, freshness, and wait options
Start with the smallest set of options that produces the view you need. URL2PNG’s documentation describes these relevant controls:
| Option | What it controls | When to use it |
|---|---|---|
fullpage=true |
Attempts to capture the entire document canvas. Default is viewport-only. | Use when the image should include content beyond the visible viewport. |
viewport=WIDTHxHEIGHT |
Browser viewport dimensions. The docs list 1480×1037 as the default; another example documents a maximum of 5000×5000. | Set dimensions to reproduce a desktop or mobile layout. Check current docs for applicable limits. |
thumbnail_max_width=PIXELS |
Constrains the output image width. | Use when you need a smaller thumbnail. Review whether scaling makes text too small to inspect. |
accept_languages=VALUE |
Overrides the default Accept-Language header, documented as en-US,en;q=0.8. |
Use when you need to request a language variant. This does not set the capture’s IP location. |
user_agent=VALUE |
Sets a custom user-agent header. | Use to request a particular user-agent presentation when appropriate. It does not guarantee a specific device environment. |
delay=SECONDS |
Waits a fixed time after document readiness and asset loading. | Try for delayed animations or content that appears shortly after initial readiness. |
say_cheese=true |
Waits for the documented #url2png-cheese element to be available. |
Use when the target page can expose that element as a readiness signal. |
unique=VALUE |
Varies the request to force a fresh screenshot rather than use a cached capture. | Change it when the page has changed and you need a new render. A timestamp is one documented approach. |
ttl=SECONDS |
Sets the screenshot cache time to live. The docs list 2,592,000 seconds (30 days) as the default. | Adjust when the default freshness period does not suit your use case. |
custom_css_url=URL |
Loads custom CSS from a URL. | Use only when you control or trust the stylesheet and need to alter the rendered page. |
URL2PNG’s plans page also says cached screenshots are kept for 30 days by default and that cached loads do not count as a fresh render. Consult the current plans page for plan terms. A unique value or TTL choice affects freshness and cache behavior, so choose based on whether you need a repeatable cached image or a new capture.
6. Indian ecommerce pages: practical checks
- Choose the intended market page. Retailers may expose different domains, language paths, or content based on location. Use the exact public URL you want to review.
- Set the layout viewport. Desktop and mobile pages can have different navigation, product grids, and content. Make separate requests when you need both views.
- Language is not location.
accept_languagesrequests a language preference. The reviewed URL2PNG documentation does not establish Indian IP geolocation or guarantee regional pricing, inventory, or promotions. - Expect dynamic content to need inspection. Product imagery, recommendations, and promotional overlays can load at different times. Try a suitable delay or the documented element wait when the page provides the expected marker.
- Check access and permissions. This workflow does not establish that a site permits automated capture or that a public request can view account-only content. Do not assume the API will bypass access controls, bot checks, or login requirements.
- Inspect the complete output. Confirm the lower page is present, images loaded, and no overlay obscures the content. Repeat with a different viewport or wait setting if needed.
7. Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| Request is rejected or does not authenticate | The token was computed from a different query string than the one sent, or credentials are wrong. | Build the query string once, use that exact string both for the token and request, URL-encode values consistently, and verify the API key and secret. |
| Only the first screen appears | fullpage=true is absent, misspelled, or not included in the signed request. |
Include fullpage=true in the exact query string used to calculate the token. The option attempts full-document capture; it is not a guarantee. |
| Screenshot has the wrong layout | The viewport selected a different responsive breakpoint than intended. | Set a width and height that match the desired desktop or mobile layout, then inspect the result. |
| Images or below-the-fold content are missing | Some page content may load after the capture readiness point, or the full-page attempt may not reproduce the page completely. | Try a documented delay or element wait where applicable, recapture, and review the image. The docs do not promise every page will render fully. |
| Language changed, but regional content did not | accept_languages is a language header, not evidence of a capture from an Indian IP address. |
Use the retailer’s intended market URL. Do not infer region-specific rendering from the language header alone. |
| Old content is returned | A cached screenshot may be reused under the TTL. | Use a changing unique value to force a fresh request, or adjust TTL according to the docs. |
| Saved file is not a usable image | The request may have failed or returned an error response that code wrote as if it were an image. | Check HTTP status before saving; with cURL use --fail. Log status and response details safely without exposing credentials. |
| Target page is inaccessible or incomplete | The page may require login, block automation, or depend on site behavior outside the documented controls. | Check the target in a normal browser and confirm you are using a public, permitted URL. The reviewed sources do not establish that URL2PNG can bypass restrictions. |
8. Performance, reliability, and cost
Full-page images can be much taller and larger than viewport captures. Use the smallest viewport and output width that preserve the details you need, and avoid adding waits without a reason. A delay can help with late content but also adds time to the request. If a capture is incomplete, inspect and adjust one setting at a time so you can identify what changed.
URL2PNG documents full-page capture as an attempt, so treat visual review as part of a reliable workflow. For automated jobs, check the HTTP response before storing the image, record which URL and options were requested, and make retries bounded so a failed target does not create an endless request loop. The plans page says cached screenshot loads do not count as fresh renders; current quotas and billing terms should be checked there before estimating costs.
Or skip the browser setup
With ScreenshotNeo, one GET request returns a screenshot. Its documented API accepts URL capture, and the parameter names other screenshot APIs use also work, which can make switching easier. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.in/products/item -o shot.webp
ScreenshotNeo removes cookie banners, popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
FAQ
Does fullpage=true guarantee every product and footer section appears?
No. URL2PNG describes the option as an attempt to capture the entire document canvas. Inspect the returned image.
Does accept_languages make the screenshot come from India?
No such geolocation behavior is established by the reviewed documentation. It overrides the Accept-Language header.
Can I sign the request in frontend JavaScript?
Do not expose the secret in client code. Create the signed URL in a protected server environment.
How can I make sure I am looking at a fresh page version?
Use a changing unique value or adjust the documented TTL, then verify the resulting screenshot.
Sources: URL2PNG Quickstart Guide and URL2PNG Plans.


