To generate an image from an APITemplate.io template in Node.js, send a JSON POST request to https://rest.apitemplate.io/v2/create-image?template_id=YOUR_TEMPLATE_ID. Put your API key in the X-API-KEY header and pass template-element overrides in the request body. A successful response includes a download_url, according to the vendor quickstart. This endpoint renders a saved template; the reviewed documentation does not establish it as a way to capture an arbitrary webpage URL as an image.
What this API does—and what “screenshot” means here
APITemplate.io’s documented image endpoint creates an image by rendering one of your saved templates with supplied values for named elements. It is not documented as a browser-based webpage screenshot endpoint: the image quickstart describes template rendering, while the separate URL-to-PDF documentation covers a different operation. See the image API quickstart and URL-to-PDF documentation.
As an Amazon Associate I earn from qualifying purchases.
If you have a page URL and need a raster image of how that page renders in a browser, do not assume the template image endpoint will capture it. For APITemplate.io’s template-driven image generation, the current documented REST route is the v2 endpoint below.
What you need before calling the endpoint
- An APITemplate.io image template that has been created and saved.
- The template ID.
- An API key, sent as the
X-API-KEYrequest header. - The names of template elements you intend to override, such as
headline. - A Node.js version with built-in
fetchavailable, or another HTTP client if your runtime does not provide it.
The REST integration guide documents the API-key header, and the image quickstart shows template IDs and named overrides: APITemplate.io REST and image API documentation.
#1 Best Overall
Call the v2 image endpoint with Node.js
Set the template ID and API key in the process environment, then send a JSON POST. The example uses Node’s built-in fetch and checks the HTTP status before reading the JSON response.
const endpoint = new URL('https://rest.apitemplate.io/v2/create-image');
endpoint.searchParams.set('template_id', process.env.APITEMPLATE_TEMPLATE_ID);
const response = await fetch(endpoint, {
method: 'POST',
headers: {
'X-API-KEY': process.env.APITEMPLATE_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
overrides: [
{ name: 'headline', text: 'Hello from Node.js' },
],
}),
});
if (!response.ok) {
const detail = await response.text();
throw new Error(`APITemplate.io returned HTTP ${response.status}: ${detail}`);
}
const result = await response.json();
console.log(result.download_url);
For example, in a shell you can set the variables before starting your Node.js process:
Rank #2
export APITEMPLATE_API_KEY='your-api-key'
export APITEMPLATE_TEMPLATE_ID='your-template-id'
node app.mjs
Save the snippet as app.mjs to use top-level await in an ES module. The request shape follows the documented v2 image endpoint, header, JSON overrides, and download_url response field; consult the current API reference for the full response and error contract before building production-specific handling. APITemplate.io also lists a JavaScript client library in its REST documentation if you prefer a vendor client to direct HTTP.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Keep the key out of browser code
The API key is a secret credential. Keep it in a server-side environment variable or secret store and make the request from a trusted backend. Do not place the key in a browser bundle or expose it in a public URL.
Rank #3
Use the element names from your template
Each entry in overrides targets a template element by its name. The example assumes the saved template contains an element named headline. Replace that name and its property values with the names and properties supported by your actual template; the quickstart illustrates this named-element override model.
Choose between REST and Direct URL
For a Node.js backend that needs to construct a request and send an API key in a header, the authenticated REST call above is the direct option. APITemplate.io also documents a Direct URL mode that places a template ID, auth code, and element properties in a URL. It can be useful when an image needs to be embedded as a URL; the documentation says generated images are cached and a new image is generated when query parameters or the template change. See Direct URL documentation.
Rank #4
Use Direct URL only where its URL-based authentication and embedding model suit your application. For a server-side integration with explicit request construction, prefer the REST POST.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Troubleshooting the Node.js request
- HTTP error response: The example includes the response body in the thrown error to help identify the cause. Check the API key, template ID, endpoint, and JSON body against the current reference; the reviewed documentation does not establish a complete status-by-status error map.
- Missing or unexpected image content: Confirm that the template ID identifies a saved image template and that each override’s
namematches a template element. The quickstart documents the returneddownload_url; inspect the actual JSON response rather than assuming undocumented fields. fetchis unavailable: Use a Node.js runtime that provides built-infetch, or call the same endpoint with an HTTP client such as the official JavaScript client listed by APITemplate.io.- Trying to capture a web page: This image route is documented for rendering templates, not arbitrary webpage screenshots. APITemplate.io separately documents URL-to-PDF generation, which is not the same as a webpage screenshot image.
- Following an old v1 example: Avoid legacy
/v1/createinstructions. The legacy reference labels v1 unsupported and recommends v2: APITemplate.io v1 reference.
Or skip the browser setup
If your goal is a screenshot of a webpage rather than an image rendered from a template, ScreenshotNeo is a website screenshot API and MCP server. A single GET request returns an image or PDF, and its clean-shot options accept cookie banners and remove known consent platforms, newsletter popups, and chat widgets before capture. Each can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed; response headers report the page verdict and billing status. AI agents can use its MCP tools, including take_screenshot, get_page_info, and capture_pdf.
Example cURL request:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo.
Frequently Asked Questions
Does the APITemplate.io image endpoint capture any webpage URL?
No such capability is established by the reviewed image API documentation; it describes rendering a saved template with overrides.
What does the APITemplate.io image response provide?
The official quickstart says the generated image response includes a `download_url`.
Recommended Free Tools
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




