ScreenshotMachine API Examples for Capturing Hindi-Language Web Pages
Use ScreenshotMachine’s Accept-Language parameter to request a Hindi page capture, with runnable cURL, Python, and Node.js examples and practical capture settings.
To ask ScreenshotMachine to capture a page using Hindi language preferences, pass accept-language=hi with the request. ScreenshotMachine documents this parameter as setting the Accept-Language header sent to the target page; its documentation example uses en-US, so hi is an adaptation of the documented behavior, not a Hindi-specific vendor example or a guarantee that a site will serve Hindi.
Use the target site’s Hindi URL or locale route when it has one. The site decides whether it honors the request header, and it may choose language using its own routing, cookies, or other signals. [ScreenshotMachine’s API guide](https://www.screenshotmachine.com/website-screenshot-api.php) documents the request parameters and examples.
Basic request: Hindi language preference
The API accepts HTTP GET requests at https://api.screenshotmachine.com/. The essential parameters are your API key (key) and the page URL (url). Add accept-language=hi, then choose image dimensions and format as needed.
https://api.screenshotmachine.com/?key=YOUR_KEY&url=https%3A%2F%2Fexample.com%2Fhi&dimension=1366x768&device=desktop&format=png&accept-language=hi
Replace YOUR_KEY and the example URL. The URL above is encoded for illustration. When constructing requests in code, use a query-parameter encoder instead of concatenating a potentially complex URL by hand. Keep the API key private; do not commit it to a public repository or expose it in client-side code.
Runnable examples
cURL
--data-urlencode safely encodes the URL and other query values. This command writes the response body to hindi-page.png.
curl -G "https://api.screenshotmachine.com/" \
--data-urlencode "key=YOUR_KEY" \
--data-urlencode "url=https://example.com/hi" \
--data-urlencode "accept-language=hi" \
--data-urlencode "dimension=1366x768" \
--data-urlencode "device=desktop" \
--data-urlencode "format=png" \
-o hindi-page.png
For a fresh capture, add --data-urlencode "cacheLimit=0". For a full-page capture, change the dimension to 1366xfull and consider adding a delay, as shown below.
Python
This example uses the third-party requests package. Install it with python -m pip install requests if needed. The parameter dictionary handles URL encoding.
import requests
params = {
"key": "YOUR_KEY",
"url": "https://example.com/hi",
"accept-language": "hi",
"dimension": "1366x768",
"device": "desktop",
"format": "png",
}
response = requests.get(
"https://api.screenshotmachine.com/",
params=params,
timeout=90,
)
response.raise_for_status()
with open("hindi-page.png", "wb") as image_file:
image_file.write(response.content)
The API can return an error image for invalid or incomplete requests. A successful HTTP response alone may therefore not mean the capture succeeded; inspect the response header described in the troubleshooting section.
Node.js
This example uses Node.js’s built-in fetch and URLSearchParams. Save it as an ES module or use a Node.js version that supports global fetch.
import { writeFile } from "node:fs/promises";
const params = new URLSearchParams({
key: "YOUR_KEY",
url: "https://example.com/hi",
"accept-language": "hi",
dimension: "1366x768",
device: "desktop",
format: "png",
});
const response = await fetch(
`https://api.screenshotmachine.com/?${params.toString()}`
);
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
const responseBody = Buffer.from(await response.arrayBuffer());
await writeFile("hindi-page.png", responseBody);
As in Python, check X-Screenshotmachine-Response when you need to distinguish a valid capture from an API error image.
Choose the right language and capture settings
| Goal | Parameter or approach | What to keep in mind |
|---|---|---|
| Request Hindi content | accept-language=hi |
This asks the target server for Hindi. A site may ignore it or use other locale signals. ScreenshotMachine’s documented example is en-US, not Hindi. |
| Use a site’s Hindi version | Set url to its Hindi route |
A locale-specific URL is often necessary when a site selects language through routing rather than the request header. |
| Capture a desktop viewport | device=desktop, for example dimension=1366x768 |
Choose dimensions that match the layout you need to inspect. |
| Capture a phone or tablet layout | device=phone or device=tablet |
The guide gives example dimensions of 480x800 for phone and 800x1280 for tablet. |
| Capture the full page | Use a dimension such as 1366xfull |
Long pages can need extra render time for images and animations. |
| Allow more rendering time | delay, in milliseconds |
The documented range is 0–10,000 ms and the default is 200 ms. For long pages with images or animations, the guide suggests considering 2,000 ms or more. A delay does not guarantee every dynamic element has loaded. |
| Choose an output format | format=png, jpg, or gif |
Pick a format supported by your downstream workflow. The API guide lists these formats. |
| Adjust screenshot scale | zoom, from 10 to 400 |
The documented default is 100. Zoom may be ignored below typical device dimensions. |
| Control freshness | cacheLimit, from 0 to 14 days |
The documented default is 14 days; use 0 to request a fresh screenshot. |
| Capture one element | selector with a CSS selector |
Useful for an individual component; it is optional and unrelated to language negotiation. |
| Trigger or remove page elements | click or hide |
click can activate a CSS selector before capture; hide can remove selected elements. |
| Capture a viewport region | crop |
Use when only a specified region is relevant. |
Parameter values can include reserved characters. Encode the complete target URL as a query parameter: a literal & in the target URL must not be mistaken for the start of another API parameter, and a # fragment should also be encoded. Prefer curl --data-urlencode, Python’s params, or JavaScript’s URLSearchParams.
Full-page example with extra render time
For a long Hindi page with lazy images or animation, use full height and allow additional time. This example requests a 2-second delay; adjust it to the page’s behavior rather than assuming it guarantees complete loading.
curl -G "https://api.screenshotmachine.com/" \
--data-urlencode "key=YOUR_KEY" \
--data-urlencode "url=https://example.com/hi/article" \
--data-urlencode "accept-language=hi" \
--data-urlencode "dimension=1366xfull" \
--data-urlencode "device=desktop" \
--data-urlencode "format=png" \
--data-urlencode "delay=2000" \
-o hindi-full-page.png
Why a page may not appear in Hindi
- Start with the actual Hindi route. If the site provides a Hindi path, subdomain, or locale URL, pass that URL. A request header does not rewrite a page or translate its content.
- Send the language preference. Add
accept-language=hito ask the target site for Hindi content. This applies the API guide’s generic header behavior; it is not a documented Hindi-specific guarantee. - Check the site’s own language selection. The site may rely on cookies, a saved preference, a language selector, or routing rules instead of the request header.
- Allow the page to render. If language content or fonts load after the initial page response, a longer
delaymay help. It cannot ensure a particular font or glyph fallback works. - Inspect the result and API response header. If the screenshot is an error image, diagnose the API request before investigating the page’s language behavior.
The available documentation does not establish how a particular website negotiates Hindi, whether its Hindi text will render with suitable fonts, or whether the page has Hindi content. It also does not report a Hindi-specific test or success rate.
Troubleshooting
| Symptom or response | Likely cause | What to do |
|---|---|---|
| Screenshot shows the default language | The site ignored the header, uses another language signal, or does not provide a Hindi version. | Try the site’s Hindi locale URL. Check its language selector and any required locale behavior. Do not assume the header translates the page. |
| API returns an error image | The request may be missing or have an invalid key or URL, or the account may have no credits. | Read X-Screenshotmachine-Response. The guide lists values including invalid_url, invalid_key, missing_key, missing_url, and no_credits; correct the indicated input or account issue. |
| URL with query parameters captures the wrong page | Reserved characters were not encoded and were parsed as API parameters. | Pass the URL through a query encoder. Use --data-urlencode in cURL, a params dictionary in Python, or URLSearchParams in Node.js. |
| Full-page screenshot misses late images or animation | Capture began before those elements finished loading. | Try a longer delay, within the documented 0–10,000 ms range. Treat it as extra rendering time, not a complete-load guarantee. |
| Text looks clipped or layout differs from expectations | The viewport or device setting differs from the target layout. | Set an explicit device and dimension appropriate to the desktop, phone, or tablet layout you want. |
| Zoom change has no visible effect | The guide says zoom may be ignored below typical device dimensions. | Set suitable device dimensions and re-evaluate whether zoom is needed. |
| Client reports a successful HTTP status but saved file is an error image | The API can signal invalid or incomplete requests with an error image and a custom response header. | Check X-Screenshotmachine-Response and validate the key, URL, and available credits instead of relying only on the HTTP status. |
Performance, reliability, and cost considerations
- Rendering time: A fixed viewport is generally a smaller capture task than a long full-page request. Extra delay can accommodate late images or animations but adds waiting time and does not prove that all dynamic content is ready.
- Cache freshness: The documented
cacheLimitdefault is 14 days, with values from 0 to 14. Set it to 0 when you need a fresh capture; allowing cached results can avoid repeatedly requesting a new rendering of unchanged content. - Reliability checks: Validate the response header as well as the saved image. Keep credentials server-side and handle API error responses explicitly.
- Cost: Screenshot Machine’s pricing page listed 100 fresh screenshots per month on its free tier when reviewed on 2026-10-03, with paid tiers also listed. Pricing and quotas can change; check the [current pricing page](https://www.screenshotmachine.com/pricing.php) before planning usage.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server for developers. One GET request returns an image or PDF, with controls for full-page capture, devices, viewport, waits, and other capture options. It accepts parameter names used by other screenshot APIs to make switching easier. Its clean capture flow accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; each step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs.
Use this cURL call to capture a page:
curl -G "https://api.screenshotneo.com/v1/shot" \
-d access_key=YOUR_API_KEY \
--data-urlencode url=https://example.com/hi \
-o shot.webp
Python:
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://example.com/hi"},
timeout=90,
)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://example.com/hi'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
See the ScreenshotNeo API documentation for request options. 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; and 1,000 screenshots a month are free with no card, with paid plans starting at $5 for 3,000. Sign up for free and get 1,000 screenshots a month with no card.
FAQ
Does accept-language=hi translate a webpage?
No. It requests a language preference from the target site. The site must already serve Hindi content and honor that preference.
Should I send hi or use a regional Hindi value?
The API guide documents the parameter behavior and gives en-US as its example, but does not specify a Hindi value. hi is a reasonable value to try for Hindi; use the target site’s own locale route if the header does not select the desired page.
Can the API guarantee Hindi glyphs or font rendering?
No Hindi-specific font or glyph guarantee is established by the reviewed documentation. Rendering depends on the page and its available fonts.
Which settings are required to request Hindi?
Use the key, target URL, and accept-language parameter. Device, dimensions, format, delay, caching, and element controls are optional capture choices.
Where can I confirm ScreenshotMachine’s current quota?
Check its [pricing page](https://www.screenshotmachine.com/pricing.php), since the displayed plans and quotas may change.


