ScreenshotNeo

BlogHow-to

Get the Chrome Browser Version with Puppeteer

Use Puppeteer’s asynchronous `browser.version()` method to identify the browser instance you launched, with examples for bundled Chrome, a custom executable, and puppeteer-core.

By the ScreenshotNeo team4 October 20267 min read

After launching or connecting to a browser with Puppeteer, call and await browser.version(). It returns a string identifying that browser instance, including its browser name and version.

const browser = await puppeteer.launch();
try {
  console.log(await browser.version());
} finally {
  await browser.close();
}

The returned value may look like Chrome/61.0.3153.0 or HeadlessChrome/61.0.3153.0. Those are documentation examples, not recommended versions. The precise format can change, so treat the result as a descriptive string rather than a stable, parseable version format. See the Puppeteer Browser.version() API.

1. Install Puppeteer and read the browser version

For most projects, install puppeteer. It downloads a compatible Chrome for Testing browser as part of its normal installation flow. Create a file named version.mjs:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const version = await browser.version();
  console.log(version);
} finally {
  await browser.close();
}

Run it with Node.js:

node version.mjs

The method is asynchronous and returns a promise. Await it after launch() succeeds. Keep browser cleanup in a finally block so the process does not leave a browser running if reading or printing the version fails.

Use the Puppeteer API documentation for the method details and the supported browsers page to check which browser build corresponds to your installed Puppeteer version.

2. Choose which Chrome installation Puppeteer launches

browser.version() reports the browser represented by that Browser object. It does not search the computer for every installed Chrome and pick one. By default, puppeteer launches the browser it manages. To inspect a different installation, select it when launching.

Use a specific executable path

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
  executablePath: '/path/to/chrome',
});
try {
  console.log(await browser.version());
} finally {
  await browser.close();
}

Replace /path/to/chrome with the executable path for the target host and operating system. The path must point to an executable browser that the process can run. Puppeteer documents executablePath as an override, and cautions that its compatibility guarantee applies to its bundled browser, not arbitrary executables. See LaunchOptions.

Select a supported Chrome channel

When you want a regular Chrome installation found through a known channel, specify channel instead of an arbitrary path:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
  channel: 'chrome',
});
try {
  console.log(await browser.version());
} finally {
  await browser.close();
}

Use a channel supported by your Puppeteer version and environment. A channel depends on the corresponding browser being installed where Puppeteer expects to find it. Consult the current launch options documentation for accepted values and behavior.

Use puppeteer-core with an explicit browser

puppeteer-core does not download a browser. Supply an executable path or a supported channel when launching:

import puppeteer from 'puppeteer-core';

const browser = await puppeteer.launch({
  executablePath: '/path/to/chrome',
});
try {
  console.log(await browser.version());
} finally {
  await browser.close();
}

The same browser.version() call works once the browser launches. The Puppeteer installation guide describes the distinction between the packages and their browser setup.

3. Connect to an already running browser

If your application obtains a Puppeteer Browser by connecting to a running browser instead of launching one, call version() on that connected object. The key is to inspect the object you actually use; a separate launch may report a different installation.

import puppeteer from 'puppeteer';

const browser = await puppeteer.connect({
  browserWSEndpoint: process.env.BROWSER_WS_ENDPOINT,
});
try {
  console.log(await browser.version());
} finally {
  await browser.disconnect();
}

Set BROWSER_WS_ENDPOINT to the WebSocket endpoint supplied by your browser service. Use disconnect() when your code attached to a browser it does not own; closing a remotely managed browser may disrupt other work. See Puppeteer’s connect API.

4. Interpret and use the returned string safely

  • It identifies one browser instance. Confirm your launch or connection configuration if the value differs from the Chrome you expected.
  • It includes a product name and version in documented examples. The API warns that the string format may change.
  • Do not assume a fixed prefix or parse it with a brittle split. If automation needs a structured version, isolate parsing behind a tested adapter, handle unknown formats, and fail clearly rather than silently selecting the wrong version.
  • Do not confuse version reporting with compatibility validation. A custom executable can launch successfully while still being outside Puppeteer’s compatibility guarantee.

For environment diagnostics, log the full string alongside the Puppeteer package version and the launch configuration source (bundled browser, channel, or custom path). Avoid logging secrets or sensitive connection URLs.

5. cURL, Python, and Node.js alternatives for a screenshot

Puppeteer is a Node.js browser automation library, so its browser.version() method has no direct cURL or Python equivalent. These examples are useful when your goal is to capture a page rather than inspect the version of a local Puppeteer browser.

cURL

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

Python

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)

Node.js

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

These API examples capture a URL; they do not return the Chrome version used internally. For the screenshot API options and response details, see the ScreenshotNeo documentation.

6. Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Make one request with a URL to receive a screenshot or PDF, without installing and managing Puppeteer in your application:

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

Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers identifying the page verdict and billing status. Its MCP server gives AI agents screenshot, page-info, and PDF tools. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

See the API documentation and sign up for 1,000 free screenshots a month, with no card.

7. Troubleshooting

Symptom Likely cause Fix
browser.version is not a function The value is not a Puppeteer Browser instance, or another object replaced it. Check the result of launch() or connect(), and call version() on that browser object.
The call is not awaited or the log shows a Promise version() returns Promise<string>. Use await browser.version() inside an async function or at the top level of an ES module.
The reported version is unexpected Puppeteer launched its managed browser, a different channel, or a different executable than intended. Inspect executablePath and channel; print the resolved configuration source. Verify that the intended executable is the one configured.
puppeteer-core cannot find or launch a browser No browser was downloaded by that package, or launch options omit a browser selection. Provide an installed executable path or supported channel, and verify that the file is executable and available in the runtime.
Custom Chrome launches but automation behaves unexpectedly The executable may not match the Puppeteer version’s supported browser. Check the supported browser mapping; use Puppeteer’s bundled browser when compatibility is important.
Launch fails in a container or CI job The browser may be missing, inaccessible, or blocked by the runtime’s browser and sandbox configuration. Check the installation output, executable permissions, required runtime dependencies, and the deployment environment’s supported launch configuration. Avoid copying launch flags without understanding the environment’s security requirements.
Version string parsing breaks after an upgrade The format is explicitly not guaranteed to remain stable. Keep the raw value, tolerate unrecognized formats, and update parsing logic when upgrading Puppeteer or Chrome.
Connected browser disappears after inspection The code may have closed a browser owned by another process. Use disconnect() for a connection you do not own; use close() for a browser your process launched and owns.

8. Performance, reliability, and cost

Reading the version is a small asynchronous browser protocol call, but launching Chrome can dominate the work. If you need the version repeatedly within one job, read it once after launch and reuse the string. If you need it across runs, cache it only when the browser selection and deployment image are controlled; otherwise a changed executable could make the cached value misleading.

For reliable diagnostics, record the Puppeteer package version, the browser version string, and whether the browser came from the bundled download, a channel, or a custom path. Keep the browser lifecycle explicit, and distinguish a launch failure from a version-read failure. Puppeteer provides no guarantee for every custom browser build, so check its supported-browser mapping during upgrades.

The Puppeteer method itself has no per-call service charge. Operational cost comes from running the browser environment and maintaining its dependencies. If all you need is a rendered screenshot rather than the browser version or direct browser control, the ScreenshotNeo call above avoids browser installation and offers a free monthly allowance.

9. FAQ

Does browser.version() return only a number?

No. It returns a string; documented examples include the browser name as well as the version. The format may change.

Does headless mode change the value?

Puppeteer’s documentation gives both Chrome/... and HeadlessChrome/... as examples. Treat those as examples of possible strings, not a permanent format contract.

Can I use this method with puppeteer-core?

Yes, once you launch or connect to a browser and have a Browser object. With puppeteer-core, specify an executable path or supported channel for launch.

How do I check which Chrome version works with my Puppeteer release?

Consult Puppeteer’s current supported browsers page for the mapping associated with your package version.