ScreenshotNeo

BlogHow-to

How to Install ScreenshotMachine CLI on Windows in India

Screenshot Machine’s reviewed documentation describes an API and Node.js library, not a standalone Windows CLI. Here’s how to use the documented options from Windows.

By the ScreenshotNeo team4 October 20269 min read

Short answer: the Screenshot Machine documentation reviewed for this guide does not describe a standalone ScreenshotMachine command-line tool or a Windows CLI installer. It documents a hosted screenshot API and a Node.js library example. On Windows, you can use the library from a Node.js project or call the API directly with an HTTP GET request. The documented steps do not add an India-specific setup requirement, but they also do not settle India-specific account eligibility, payment, or tax questions.

This guide explains both supported approaches, how to choose screenshot options, and how to diagnose common setup problems. It does not present the npm package as a CLI: installing a library does not necessarily create a command you can run in PowerShell or Command Prompt.

1. What the available documentation supports

Approach What it does Best fit
Node.js package Use the screenshotmachine library inside a Node.js project to build a screenshot request and consume its result. A script or application that already uses Node.js.
Direct HTTP API Send an HTTP GET request with a customer key, page URL, and optional capture parameters; handle the returned image. Any code or command-line HTTP client that can make GET requests.
Standalone CLI No install command or executable is documented in the reviewed vendor materials. Do not assume screenshotmachine will be a shell command after npm install.

The distinction matters on Windows: npm install screenshotmachine --save adds a project dependency. npm creates a command shim only for a package that declares an executable entry point; the reviewed Screenshot Machine materials show library usage, not a documented CLI entry point. See the npm package.json bin documentation.

2. Prepare a Windows Node.js project

  1. Open PowerShell or Windows Terminal and confirm Node.js and npm are available:
    node --version
    npm --version

    The reviewed Screenshot Machine sources do not specify a minimum Node.js version or provide Windows-specific installation instructions. If either command is unavailable, install and configure Node.js/npm using the appropriate official Node.js guidance for your system before continuing.

  2. Create a project directory and initialize it:
    mkdir screenshotmachine-demo
    cd screenshotmachine-demo
    npm init -y
  3. Install the package as a project dependency, following the vendor-maintained example:
    npm install screenshotmachine --save
  4. Create a Screenshot Machine account and retrieve your customer key as directed by its documentation. Keep the key private: do not commit it to source control or publish it in a support request.

The official Screenshot Machine Node.js example demonstrates package usage. Its documented installation command is for a Node.js dependency, not a global CLI installer.

3. Use the Node.js library from application code

The vendor example uses the library to generate a screenshot API URL and then reads or saves the response. The pattern below keeps the credential in an environment variable and writes the returned image to a file. Check the package’s current example and API for the precise library methods supported by the version you install; the reviewed sources do not specify a Node.js runtime version.

// save as capture.js
const fs = require('node:fs');
const screenshotmachine = require('screenshotmachine');

const customerKey = process.env.SCREENSHOTMACHINE_CUSTOMER_KEY;
if (!customerKey) {
  throw new Error('Set SCREENSHOTMACHINE_CUSTOMER_KEY before running this script.');
}

const options = {
  url: 'https://example.com',
  dimension: '1024x768',
  format: 'png',
};

const apiUrl = screenshotmachine.generateScreenshotApiUrl(customerKey, options);
screenshotmachine.readScreenshot(apiUrl, (error, image) => {
  if (error) {
    console.error(error);
    process.exitCode = 1;
    return;
  }
  fs.writeFileSync('screenshot.png', image);
  console.log('Saved screenshot.png');
});

The example illustrates the package-based flow documented by the vendor. If the installed package version exposes different method names or callback behavior, follow that version’s maintained example rather than treating this illustrative script as a guarantee of its exact current API.

Set the key for the current PowerShell session and run the file:

$env:SCREENSHOTMACHINE_CUSTOMER_KEY = "YOUR_CUSTOMER_KEY"
node .\capture.js

For Command Prompt, the corresponding session-scoped setup is:

set SCREENSHOTMACHINE_CUSTOMER_KEY=YOUR_CUSTOMER_KEY
node capture.js

Do not put a real key directly in a script that will be shared or committed. Environment variables avoid storing it in the source file, though they are still accessible to processes and users with access to your session.

4. Call the API directly with cURL

If you need a terminal workflow rather than a Node.js library, call the documented HTTP API. The API uses GET requests, requires a customer key and target page URL, and returns an image. This is still an API request, not a Screenshot Machine CLI.

curl -G "https://api.screenshotmachine.com/" \
  --data-urlencode "key=YOUR_CUSTOMER_KEY" \
  --data-urlencode "url=https://example.com" \
  --data-urlencode "dimension=1024x768" \
  --data-urlencode "format=png" \
  --output screenshot.png

Use curl.exe explicitly in PowerShell if the name curl resolves unexpectedly in your shell:

curl.exe -G "https://api.screenshotmachine.com/" `
  --data-urlencode "key=YOUR_CUSTOMER_KEY" `
  --data-urlencode "url=https://example.com" `
  --data-urlencode "dimension=1024x768" `
  --data-urlencode "format=png" `
  --output screenshot.png

Screenshot Machine’s API documentation says requests start with https://api.screenshotmachine.com/? and use query parameters. Encoding the page URL is important because URLs can contain characters that would otherwise be interpreted as query syntax. cURL’s --data-urlencode handles that encoding.

5. Call the API from Python

Python can make the same GET request. Install the HTTP client in the environment where the script runs, keep the customer key in an environment variable, and write the response bytes to a file.

# python -m pip install requests
# PowerShell: $env:SCREENSHOTMACHINE_CUSTOMER_KEY = "YOUR_CUSTOMER_KEY"

import os
import requests

key = os.environ["SCREENSHOTMACHINE_CUSTOMER_KEY"]
response = requests.get(
    "https://api.screenshotmachine.com/",
    params={
        "key": key,
        "url": "https://example.com",
        "dimension": "1024x768",
        "format": "png",
    },
    timeout=90,
)
response.raise_for_status()
with open("screenshot.png", "wb") as image_file:
    image_file.write(response.content)

Before treating a successful HTTP response as a valid image, a production script can also check the response content type and handle service-specific error responses according to the vendor documentation. Do not log the full request URL if it contains the customer key.

6. Call the API from Node.js without the package

Direct HTTP is useful when you want to avoid a library wrapper. This runnable example uses Node’s built-in fetch and saves the bytes. It assumes a Node.js version that provides global fetch; the reviewed Screenshot Machine materials do not define a supported Node.js version.

// save as capture-http.js
const fs = require('node:fs/promises');

async function main() {
  const key = process.env.SCREENSHOTMACHINE_CUSTOMER_KEY;
  if (!key) throw new Error('Set SCREENSHOTMACHINE_CUSTOMER_KEY first.');

  const query = new URLSearchParams({
    key,
    url: 'https://example.com',
    dimension: '1024x768',
    format: 'png',
  });
  const response = await fetch(`https://api.screenshotmachine.com/?${query}`);
  if (!response.ok) {
    throw new Error(`Screenshot request failed with HTTP ${response.status}`);
  }
  await fs.writeFile('screenshot.png', Buffer.from(await response.arrayBuffer()));
  console.log('Saved screenshot.png');
}

main().catch((error) => {
  console.error(error.message);
  process.exitCode = 1;
});

7. Choose API parameters deliberately

The Screenshot Machine API guide documents a range of screenshot properties. Consult its current parameter table for accepted names, values, defaults, and constraints before relying on a setting:

Setting What it controls When to consider it
dimension Screenshot dimensions. Set the viewport needed for the page layout you want.
format Output image format. Choose a format supported by the API and your downstream workflow.
device Device-oriented capture configuration. Use when a page should be rendered for a documented device preset.
cache / cache age Whether a cached capture may be reused and for how long, as supported by the API. Useful when the page changes infrequently and a recent capture is acceptable.
delay Wait time before capture. Allow client-rendered content time to appear when the default timing is insufficient.
zoom Page zoom for the capture. Adjust the rendered scale where the documented behavior fits your use case.

Use only parameter names and values listed in the Screenshot Machine API documentation. Encode the complete target page URL; avoid manually concatenating unescaped query strings, especially when the page URL itself contains query parameters or an ampersand.

8. India-specific considerations

The reviewed API and Node.js materials do not give a separate installation or request procedure for India. They also do not confirm account eligibility, payment methods, tax treatment, currency, or service availability for every India-based user. If any of those affects your deployment, check Screenshot Machine’s current account and billing terms directly before depending on a particular arrangement. Do not infer eligibility from the fact that the API endpoint is documented.

9. Troubleshooting

Symptom Likely cause What to do
node or npm is not recognized Node.js/npm is missing or not available on the current PATH. Install/configure Node.js and reopen the terminal, then check both version commands again.
npm install cannot find the package Network, registry, proxy, or package-name issue. Confirm the package name is screenshotmachine, check npm registry connectivity and proxy settings, then retry.
screenshotmachine is not recognized as a command The package is being used as a library and may not declare a CLI executable. Run a JavaScript file with node or call the HTTP API. Do not assume npm install -g creates a command.
Authentication error Missing, mistyped, or invalid customer key; wrong parameter name. Retrieve the key from your account profile and pass it using the parameter documented by the API. Avoid exposing it in logs.
Bad request or unexpected result Unencoded page URL, unsupported parameter, or invalid value. Use URL encoding and verify each option against the official API parameter table.
Image is blank or content is missing The target page may render content asynchronously, or the selected capture timing/settings may not fit it. Try a documented delay or other relevant documented setting, and check that the page is publicly reachable by the service.
PowerShell behaves differently from a cURL example curl may resolve differently depending on PowerShell version and environment. Use curl.exe and PowerShell backticks for line continuation, or use a single-line command.
India account or payment question remains unanswered The technical API guide does not specify local billing or availability terms. Confirm current terms with the vendor before purchase or production dependency.

10. Performance, reliability, and cost

  • Performance: the capture is a remote API operation, so the total time includes network round trips and the time needed to render the target page. The reviewed sources provide no benchmark. Keep client timeouts appropriate for remote work and avoid adding a long delay unless the target content requires it.
  • Reliability: handle HTTP failures, network timeouts, and invalid image responses. For recurring jobs, record success/failure metadata without logging credentials, and retry transient failures cautiously rather than retrying every error indefinitely. The reviewed sources do not establish an uptime commitment.
  • Cost: confirm current account pricing and usage terms with Screenshot Machine. The reviewed materials do not provide a price schedule suitable for quoting here. Caching may reduce repeated capture work when its documented behavior fits your freshness requirements.
  • Security: treat the customer key as a secret. Avoid committing it, exposing it in screenshots of terminal output, or placing full credential-bearing URLs in logs.

11. Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Its API takes a URL and returns an image or PDF, so you do not need to install or manage a browser for this capture. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
  • Cookie banners are accepted like a visitor would accept them, and 60+ known consent platforms, newsletter popups, and chat widgets are removed before the shot; each step can be turned off.
  • Bot checks, blank pages, failed loads, timeouts, and cache hits are never billed; response headers report the page verdict and billing status.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
  • 1,000 screenshots per month are free with no card. Paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo and get 1,000 free screenshots a month with no card.

12. FAQ

Does npm install a Windows command named screenshotmachine?

The reviewed vendor instructions show the package as a Node.js dependency, not a documented command-line executable. Use it from application code unless current package metadata says otherwise.

Can I use Screenshot Machine without Node.js?

Yes. The documented service is an HTTP API, so any HTTP client that can send a GET request and save the response can call it.

Is there a special Screenshot Machine installation step for India?

None is given in the reviewed technical materials. Account and billing eligibility for India is not established by those materials.

Where should I verify supported parameter values?

Use Screenshot Machine’s current API documentation and maintained Node.js example.