How to Use ScreenshotOne to Capture Hindi Webpages as Screenshots
Capture a site’s existing Hindi version or translate visible page text before screenshotting, with practical ScreenshotOne requests and troubleshooting.
To screenshot a webpage that already has a Hindi version, request that page from ScreenshotOne’s /take endpoint and send an Accept-Language: hi-IN header. Set full_page=true if you need the entire page. This language preference may lead a site to serve Hindi, but it does not translate a page whose content is only available in another language.
If the page needs translation, inject a script with ScreenshotOne’s scripts option that translates eligible text through a translation provider, then wait for that script to finish before capture. That workflow needs deliberate handling for API credentials, text batching, quotas, dynamic content, and translation errors.
1. Choose the right workflow
| Your goal | Use this approach | What it does not do |
|---|---|---|
| Capture a Hindi page the site already publishes | Use its Hindi URL if available; send an Accept-Language header such as hi-IN. |
It cannot force a site to provide a Hindi version that does not exist. |
| Capture a page whose text is in another language, translated into Hindi | Run a page script that sends selected text to a translation service and replaces it before capture. | It is not full site localization by itself: text in images, inaccessible content, unselected nodes, and later-inserted content may remain untranslated. |
Keep these workflows separate when diagnosing results. A language header is a request preference that the website may honor; translation is a content-changing operation that needs an external translation provider.
2. Capture a Hindi version the site already serves
ScreenshotOne’s endpoint accepts GET and POST requests. Use HTTPS and keep the access key private. For a full-page capture, full_page=true also enables scrolling by default, which helps trigger lazy-loaded images.
cURL
curl -G 'https://api.screenshotone.com/take' \
--data-urlencode 'access_key=YOUR_SCREENSHOTONE_ACCESS_KEY' \
--data-urlencode 'url=https://example.com/hi/' \
--data-urlencode 'headers=Accept-Language:hi-IN' \
--data-urlencode 'full_page=true' \
-o hindi-page.png
Replace the example URL with the site’s Hindi page. If you want the site to choose a language based on negotiation, use its regular URL and retain the language header. Header option syntax and other request options are documented in ScreenshotOne’s options reference.
Python
import requests
response = requests.get(
"https://api.screenshotone.com/take",
params={
"access_key": "YOUR_SCREENSHOTONE_ACCESS_KEY",
"url": "https://example.com/hi/",
"headers": ["Accept-Language:hi-IN"],
"full_page": "true",
},
timeout=90,
)
response.raise_for_status()
with open("hindi-page.png", "wb") as image:
image.write(response.content)
Node.js
const params = new URLSearchParams({
access_key: process.env.SCREENSHOTONE_ACCESS_KEY,
url: 'https://example.com/hi/',
'headers[]': 'Accept-Language:hi-IN',
full_page: 'true',
});
const response = await fetch(`https://api.screenshotone.com/take?${params}`);
if (!response.ok) {
throw new Error(`ScreenshotOne returned ${response.status}: ${await response.text()}`);
}
const image = Buffer.from(await response.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('hindi-page.png', image));
For multiple header values or a large set of options, use ScreenshotOne’s documented POST format with a JSON body. Confirm the expected representation for repeated headers in the current API docs.
3. Translate page text before the capture
ScreenshotOne supports a scripts option that runs JavaScript in the rendered page. Its translation guide demonstrates calling Google Translate API from the injected script, replacing selected visible text nodes, URL-encoding the script, and adding a delay. The target language code for Hindi is hi. The sample below is intentionally a minimal illustration of the request pattern; production translation should batch text, handle errors and retries, and protect provider credentials.
Credential caution: embedding a translation API key in page JavaScript or a URL can expose it to the rendered page and request logs. Use a restricted key with quotas and budgets, and follow the translation provider’s credential guidance. For sensitive production use, design a secure translation flow rather than placing a broadly privileged secret in injected browser code.
Translation script example
This compact example translates visible text nodes in batches and skips code and script elements. A real site may require additional exclusions for navigation, editable controls, framework-managed content, and elements inserted after the scan.
const apiKey = 'RESTRICTED_TRANSLATION_KEY'; // Do not use a broadly privileged key.
const targetLang = 'hi';
const visible = (el) => el && el.offsetWidth > 0 && el.offsetHeight > 0;
const excluded = (node) => node.parentElement?.closest(
'script,style,code,pre,noscript,textarea,input,[contenteditable="true"]'
);
const nodes = [];
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
while (walker.nextNode()) {
const node = walker.currentNode;
if (node.nodeValue.trim() && visible(node.parentElement) && !excluded(node)) {
nodes.push(node);
}
}
async function translateBatch(texts) {
const response = await fetch(
`https://translation.googleapis.com/language/translate/v2?key=${encodeURIComponent(apiKey)}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ q: texts, target: targetLang }),
}
);
if (!response.ok) throw new Error(`Translation HTTP ${response.status}`);
const data = await response.json();
return data.data.translations.map(item => item.translatedText);
}
(async () => {
const batchSize = 50;
for (let i = 0; i < nodes.length; i += batchSize) {
const batch = nodes.slice(i, i + batchSize);
const translated = await translateBatch(batch.map(node => node.nodeValue));
batch.forEach((node, index) => { node.nodeValue = translated[index]; });
}
document.documentElement.dataset.translationComplete = 'true';
})().catch(error => {
document.documentElement.dataset.translationError = String(error);
console.error('Translation failed', error);
});
The example uses the Hindi target code and batches strings, but it is not a complete localization system. It does not translate text rendered inside images or canvas, and a one-time DOM scan can miss content added later. It also requires adapting request size, response checks, retries, and provider-specific limits to the translation service.
Submit the script and wait
Send the script in scripts, with a capture delay long enough for translation to finish. ScreenshotOne’s guide demonstrates a delay; a fixed delay is only a timing estimate. When possible, wait for an explicit completion condition using the API’s supported waiting options. A selector wait confirms DOM presence, not necessarily visibility or completed translation.
curl -G 'https://api.screenshotone.com/take' \
--data-urlencode 'access_key=YOUR_SCREENSHOTONE_ACCESS_KEY' \
--data-urlencode 'url=https://example.com/' \
--data-urlencode 'full_page=true' \
--data-urlencode 'scripts=YOUR_URL_ENCODED_TRANSLATION_SCRIPT' \
--data-urlencode 'delay=10' \
-o translated-hindi.png
URL-encode the entire script. For substantial scripts and larger option sets, use POST if supported by your integration. See ScreenshotOne’s translation guide for its documented script workflow and example. Its guide recommends adapting the example for production and accounting for batching, quotas, retries, and other error handling.
4. Tune language, waits, and full-page capture
Language and locale
Accept-Language:hi-INasks for Hindi with an India locale preference. The site controls whether it serves localized content.- Use the site’s explicit Hindi path or locale selector when available; it is often the clearest way to identify the intended version.
- Locale can affect formatting and regional content as well as language. Set the browser time zone where dates and times matter, using the documented
time_zoneoption. - Check redirects, cookies, and locale selectors if the site returns another language. Some sites persist a language choice in cookies or use a separate localized URL.
Wait for the content you need
Choose a wait condition based on the page. Load-related events can be adequate for static pages; a delay can help when rendering continues afterward. A selector wait can confirm a key element exists, but DOM presence alone does not prove that it is visible or finished updating. For injected translation, coordinate capture with script completion rather than assuming the page-load event includes it.
Full-page and lazy-loaded content
Start with full_page=true. ScreenshotOne enables full-page scrolling by default with it, which helps request lazy images. If sections or images are still absent, adjust scroll pacing and wait duration. For animated or complex pages, try full_page_algorithm=by_sections, which captures sections while scrolling and combines them. More scrolling, waits, and section processing can increase rendering time. ScreenshotOne notes that some pages remain difficult to capture reliably.
Viewport and motion
Viewport dimensions can change responsive layout and therefore what appears in a full-page capture. Use dimensions representative of the intended output. If animation causes inconsistent section captures, reduce motion or wait for a stable point before capture where the available options and the page allow it.
5. Check Hindi and Devanagari rendering
If letters appear as boxes, missing marks, or poorly shaped glyphs, separate a content problem from a font problem:
- Open the same URL in a browser with the same locale preference and check whether the page itself contains correct Hindi text.
- Confirm the page’s Hindi web fonts and stylesheets have loaded before capture; a font request failure can leave the browser using a fallback.
- Use ScreenshotOne’s font-detection option, which returns font metadata, to inspect the font and fallback information.
- Wait longer and recapture if the page or font loads asynchronously.
- Compare a viewport capture with a full-page capture. Lazy loading or section capture may expose timing differences.
Font metadata is diagnostic information; it does not repair a missing font or guarantee Devanagari output. The reviewed documentation does not establish a universal Devanagari font guarantee or a Hindi-specific font override. Check the actual returned image for the target page.
6. Troubleshooting
| Symptom | Likely cause | What to try |
|---|---|---|
| The screenshot is still in English | The site does not negotiate language from the header, or it requires a localized URL, cookie, or in-page language setting. | Use the site’s Hindi URL or locale selector; inspect redirect and cookie behavior. Do not expect the header to translate content. |
| Only some text is Hindi | The script selected only certain visible text nodes; menus, image text, canvas, shadow content, or dynamically inserted nodes may be outside its scope. | Extend the selection and exclusions carefully, rerun after dynamic content appears, and verify the specific areas required. |
| The output shows the original page, not translated text | The injected script failed, its parameter was malformed, or capture happened before the async translation completed. | Check URL encoding and provider errors; coordinate capture with script completion and increase the delay as a diagnostic. |
| Some sections are blank or missing | Lazy-loaded content did not load, the wait was too short, or the page’s layout/animation complicates full-page capture. | Keep full-page scrolling enabled, adjust scroll pacing and wait, and test by_sections for complex pages. |
| Hindi glyphs appear as squares or malformed marks | The font may not have loaded, the page may lack suitable font coverage, or the capture happened too early. | Inspect font metadata, verify the source page and font requests, wait, and recapture. No universal font fix is documented. |
| Translation calls fail or stop partway through | Provider key, quota, request-size, network, or response errors; the minimal script may not retry. | Restrict and validate the key, set quotas and budget notifications, batch within provider limits, inspect errors, and add bounded retries. |
| The request fails or exposes a secret | Invalid access key, non-HTTPS use, or a sensitive key embedded in a URL/script that can be logged or exposed. | Use HTTPS, verify credentials, keep keys server-side where possible, restrict provider keys, and rotate a key if it has been exposed. |
7. Performance, reliability, and cost
A normal viewport capture generally has less work than a full-page capture. Full-page scrolling, section-by-section rendering, added waits, and translation API calls each add work and can increase total latency. Translation also adds a separate provider dependency and may incur provider usage charges; ScreenshotOne capture pricing and translation-provider pricing are separate concerns. The supplied documentation does not establish a universal Hindi-specific latency, reliability rate, or translation cost.
For repeatable results, use a stable URL and viewport, explicit language selection, a content-aware wait, bounded translation batches, and a clear failure path. Record whether translation completed before treating the image as a translated result. Test representative pages with long content, lazy images, dynamic navigation, and Devanagari font loading.
8. Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. Its one-call capture can return a clean screenshot, and its API uses familiar screenshot parameters to make switching straightforward. 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/hi/ \
-o hindi-page.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; paid plans start at $5 for 3,000 screenshots.
Sign up free for 1,000 screenshots a month, with no card required.
9. FAQ
Does Accept-Language: hi-IN translate a page?
No. It can influence which version a site serves when that site supports language negotiation. Translation requires changing page content or using a translation service.
Should I use hi or hi-IN?
Use hi-IN as a language header when you want Hindi with an India locale preference. Use hi as the translation target code in the example workflow. The site or translation provider determines its supported behavior.
Does the translation script translate every visible word?
Not necessarily. A text-node script can miss image text, canvas, content outside its scan, and content added later. Validate the actual regions in the screenshot.
Can font detection fix Devanagari rendering?
No. It can help identify fonts and fallback information. It does not load a missing font or guarantee correct glyph rendering.


