ScreenshotNeo

BlogHow-to

How to Capture URL2PNG Screenshots of Websites Hosted in India

Capture an India-hosted site with URL2PNG using signed requests, and learn why the render may not come from an Indian IP.

By the ScreenshotNeo team4 October 202610 min read

Direct answer: URL2PNG can capture a website hosted in India if its hosted browser can reach the page. Send a signed API request containing the complete target URL and capture options, then save the returned image. The reviewed URL2PNG documentation does not establish that its browser renders from an Indian IP address or offers an India capture region. If the site requires an Indian IP or serves location-specific content, confirm render geography with URL2PNG before relying on it.

A website being hosted in India does not mean a screenshot service captures it from India. The request can be sent from anywhere; the screenshot is rendered by the service’s browser. Those are separate locations.

1. Check the India-specific requirement

First decide what “hosted in India” means for your use case:

  • Publicly reachable site on an Indian host: try an ordinary URL2PNG capture. The hosting location alone does not prevent capture, provided the renderer can reach the site.
  • Content personalized by language: set the accepted language header as needed. This changes the request’s language preference, not the renderer’s country.
  • Content restricted to Indian visitors or IP addresses: confirm with URL2PNG that the renderer has the required geographic egress. The reviewed docs do not document an India region, regional proxy, or country-selection option.
  • Content behind a local network, regional cookie, or login: verify that the service can access it and that the necessary authentication or state can be supplied. Do not assume that an Indian server’s public address makes its content accessible to URL2PNG.

If India-origin rendering is a hard requirement, ask URL2PNG for confirmation or choose a capture route with explicitly documented India-based rendering. Do not infer the capture IP from the target URL, the site’s hosting provider, or the location from which you call the API.

2. Get access and prepare the request

  1. Obtain a URL2PNG API key and secret from an account. The current signup page says signup is restricted and directs prospective users to request a signup code from support, so confirm that you can get access before building a production dependency.
  2. Choose a complete target URL, including its scheme, such as https://example.in/.
  3. Choose capture settings: viewport dimensions, viewport-only or full-page capture, cache behavior, language, user agent, and any readiness delay or signal.
  4. Build the signed v6 request using URL2PNG’s official sample for your language. The signature depends on the exact query-string representation; do not substitute a hand-built encoding or copy a signature generated for different parameters.
  5. Send the request over HTTPS and save the response as an image. Keep the secret on a server or in a protected environment variable, never in browser code or a public repository.

URL2PNG’s official documentation provides the v6 request format and language-specific examples. Use its current sample as the source of truth for token construction and request parameter ordering.

3. Choose capture settings

Setting Behavior and use
viewport Sets browser viewport dimensions. The documented default is 1480×1037, with a documented maximum of 5000×5000. Match the viewport to the layout you need to inspect.
fullpage Defaults to false, which captures the viewport. Set it to true to attempt a full-document canvas capture. Very long pages can produce large images.
unique Varies the request to force a fresh screenshot instead of reusing a cached result. A timestamp is one documented way to make it unique.
ttl Controls cache lifetime. The quickstart documents a default of 2,592,000 seconds (30 days). Set a suitable TTL where supported, and use a unique value when you specifically need a fresh capture.
accept_languages Overrides the language request header; the documented default is en-US,en;q=0.8. This may affect language negotiation, but it does not provide an Indian IP address.
user_agent Overrides the browser user-agent header. Use only when you need to reproduce a particular browser or site behavior.
delay Waits a specified number of seconds after document readiness and asset loading. Use for content that appears shortly after load; large fixed delays add latency to every capture.
say_cheese Waits for the page to expose the documented <div id='url2png-cheese'></div> readiness element. This is useful when you control the target app and can signal when the content is ready.
custom_css_url Loads custom CSS into the target page. Use it to adjust the page for a capture when needed; ensure the stylesheet is publicly reachable by the renderer.

Parameters that alter the signed query must be included in the signature exactly as required by the official request sample. If changing a setting breaks authentication, rebuild the signature from the final query rather than reusing an old token.

4. Make a signed capture request

The examples below show the request flow, but deliberately do not invent URL2PNG signing code: its signature is sensitive to the exact encoded query string. Generate the signed URL with the official sample for your language, then use one of these patterns to fetch and save the image.

cURL

# Replace this with the complete signed URL generated from URL2PNG's official sample.
SIGNED_URL='https://api.url2png.com/v6/KEY/TOKEN/IMAGE_OPTIONS/TARGET_URL'
curl --fail --location --silent --show-error "$SIGNED_URL" --output screenshot.png

Use the exact URL and endpoint shape produced by the official v6 example for your account and options. The placeholder above is not a usable signature.

Python

import os
import requests

# Generate this URL with URL2PNG's official v6 signing sample.
signed_url = os.environ["URL2PNG_SIGNED_URL"]

response = requests.get(signed_url, timeout=90)
response.raise_for_status()
with open("screenshot.png", "wb") as image_file:
    image_file.write(response.content)

Set URL2PNG_SIGNED_URL in your server environment to the fully signed URL. Generate it server-side from the current target and options; protect the secret used to create it.

Node.js

import { writeFile } from "node:fs/promises";

// Generate this URL with URL2PNG's official v6 signing sample.
const signedUrl = process.env.URL2PNG_SIGNED_URL;
if (!signedUrl) throw new Error("Set URL2PNG_SIGNED_URL");

const response = await fetch(signedUrl, { signal: AbortSignal.timeout(90_000) });
if (!response.ok) {
  throw new Error(`URL2PNG request failed: HTTP ${response.status}`);
}
await writeFile("screenshot.png", Buffer.from(await response.arrayBuffer()));

For all three examples, verify the actual response content and status according to URL2PNG’s current API behavior. Avoid logging full signed URLs if they contain credentials or reusable signatures.

5. Handle language, rendering readiness, and freshness

For language-specific pages, set accept_languages to the desired language preference and inspect the result. A language header may influence which translation the site serves, but does not simulate a visitor’s Indian network location, regional cookies, or geolocation.

For content loaded after the initial document:

  • Prefer the say_cheese readiness signal when you control the app. Add the expected element only when the content needed in the image is ready.
  • Use delay for third-party widgets or pages that cannot signal readiness. Start with a short delay and increase it only when captures show content missing.
  • Use unique when you need a new render and do not want a cached screenshot. Otherwise, allow cache reuse for stable pages.

With client-side rendering, a screenshot can be technically successful while still missing late content. Inspect representative captures and tune readiness settings against the page’s actual loading behavior.

6. Validate the result for an India-hosted target

  1. Open the saved image and confirm that the expected page, language, and viewport appear.
  2. Check for redirects, access-denied pages, blank content, or region notices. A returned image alone does not prove it represents an Indian visitor’s view.
  3. Repeat with a fresh request when testing a change, using unique to avoid confusing a cached result with the new rendering.
  4. If the result must match an India-based user, compare it with a capture whose India-based render origin is independently verified.
  5. Record the target URL, options, and capture time alongside the image so later comparisons can distinguish page changes from capture-setting changes.

7. Troubleshooting

Symptom Likely cause What to do
Signature or authentication error The token was generated from a different query string, parameter order, or encoding than the request sent. Rebuild the token from the final request using the official language sample. Keep the secret private and verify the exact endpoint and key.
Image shows an old page A cached result was reused. Use a unique request value such as a timestamp to request a fresh screenshot; review the TTL setting.
Page is blank or missing dynamic sections The capture happened before client-side rendering or deferred content completed. Use the readiness element if you control the page, or add an appropriate delay. Check that the renderer can load the page’s scripts and assets.
Wrong language The site chose a default or inferred language independently of the expected locale. Set accept_languages and check whether the site also relies on cookies or account preferences. This does not change capture geography.
Indian-only content is unavailable The renderer may not use an Indian IP, or the site requires a regional network, cookie, or other visitor state. Ask URL2PNG to confirm the render location and supported access method. The reviewed docs do not document an India capture region.
Capture cuts off below the fold Full-page mode was not enabled or the site uses unusual scrolling behavior. Set fullpage=true and inspect the resulting image. The documentation describes full-page capture as an attempt to capture the entire document canvas.
Image is too large or request is slow A large viewport or long full-page document creates a large render and response. Use the smallest viewport that answers the task, use viewport-only capture when sufficient, and avoid unnecessary fixed waits.
Signup cannot be completed The current signup page says access is restricted and a signup code must be requested from support. Confirm account availability and plan terms before depending on URL2PNG for a new workflow.

8. Performance, reliability, and cost

Keep capture dimensions and wait time as small as the use case permits. Full-page images, large viewports, and long delays increase the work and time needed for each capture. A page readiness signal can avoid both premature captures and blanket waits when you can control the page.

URL2PNG’s plans FAQ says each fresh screenshot counts as one render, cached requests do not count against the plan, and screenshots are cached for 30 days by default with an adjustable TTL. The plans page currently says there is no free account and lists paid quotas and overage rates; these commercial terms can change, so check the live URL2PNG pricing page before estimating costs. A cached capture is useful for repeated views of unchanged pages, while a fresh render is appropriate when validating recent changes.

For reliability, handle HTTP errors, set a client timeout, retry only transient failures with a bounded backoff, and avoid retrying authentication or invalid-request errors unchanged. Store the target and capture settings with each result so a failed or surprising render can be reproduced. If geographic origin determines correctness, treat vendor confirmation as a prerequisite rather than a best-effort tuning setting.

9. Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. It does not make an India-rendering claim here; confirm geographic requirements with the provider if the result must reflect an Indian IP. For ordinary captures, one GET request returns an image or PDF. See the ScreenshotNeo API documentation for request options.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.in/ -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.in/"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.in/' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`ScreenshotNeo request failed: HTTP ${res.status}`);
await import('node:fs/promises').then(({ writeFile }) => writeFile('shot.webp', Buffer.from(await res.arrayBuffer())));

ScreenshotNeo removes cookie and consent banners before capture and also handles newsletter popups and chat widgets; those steps can be turned off. Bot checks, blank pages, and failed loads are never billed. Its response reports the page verdict and billing result in headers. AI agents can use its MCP server and the take_screenshot, get_page_info, and capture_pdf tools. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots. Every feature is on every plan.

Sign up for ScreenshotNeo free: 1,000 screenshots a month, no card required.

10. Frequently asked questions

Can I call URL2PNG from an Indian server?

You can send a request from a client in India, but the request’s origin does not determine where URL2PNG renders the page. Confirm the screenshot browser’s geography if it matters.

Does setting accept_languages make the capture appear to come from India?

No. It sets a language preference header. It does not select an Indian IP or regional network route.

Will a site hosted in India always be reachable?

No. Reachability depends on the renderer’s network access and the site’s access controls. Hosting country alone is not enough to guarantee capture.

Can I use URL2PNG without an account?

The reviewed signup page says account signup is restricted and directs prospective users to request a code from support. Check the current signup and pricing pages for availability.

Sources