Use BrowserCat’s managed browser with Playwright to open a webpage, set a capture viewport, wait for the content you need, and save a screenshot. The example below uses 1200 × 630 pixels as an illustrative canvas—not as a BrowserCat recommendation or a guaranteed requirement for any social network. Check the current image guidance for the platform where you plan to use the image.
What you need
- A BrowserCat API key. BrowserCat’s quick start connects to its remote browser at
wss://api.browsercat.com/connectand authenticates with anApi-Keyrequest header. See the BrowserCat quick start. - Node.js and the Playwright package. BrowserCat recommends Playwright as a starting point; its documentation also describes support for Puppeteer and CDP-based clients. Those are BrowserCat’s stated compatibility claims, not independent compatibility tests. See BrowserCat.
- A publicly reachable page URL and a place to save the resulting PNG.
Keep the API key in an environment variable or another secret store. Do not put it in client-side JavaScript, commit it to source control, or print it in logs.
As an Amazon Associate I earn from qualifying purchases.
Connect with Playwright and save a preview image
Install Playwright in your project with npm install playwright. Save the following as preview.mjs:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteimport { chromium } from 'playwright';
const targetUrl = process.argv[2];
const apiKey = process.env.BROWSERCAT_API_KEY;
if (!targetUrl || !apiKey) {
console.error('Usage: BROWSERCAT_API_KEY=... node preview.mjs https://example.com');
process.exit(1);
}
const browser = await chromium.connect('wss://api.browsercat.com/connect', {
headers: { 'Api-Key': apiKey },
});
try {
const page = await browser.newPage();
// Illustrative canvas only. Check the target platform's current requirements.
await page.setViewportSize({ width: 1200, height: 630 });
await page.goto(targetUrl, { waitUntil: 'load' });
await page.screenshot({ path: 'preview.png' });
console.log('Saved preview.png');
} finally {
await browser.close();
}
Run it with your own page URL:
BROWSERCAT_API_KEY=your_key_here node preview.mjs https://example.com
The connection, navigation and screenshot flow follows BrowserCat’s quick start. The viewport and screenshot path are documented in its Playwright cheatsheet. The example waits for the page’s load event; that does not guarantee that every client-rendered element, animation or late-loading image is ready.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Choose what to capture and when
Use a viewport for a fixed card composition
A social preview is usually a deliberate crop, so begin with a viewport screenshot and set its width and height before capture. The example uses 1200 × 630 only to demonstrate the mechanics. Confirm the actual aspect ratio, dimensions and file constraints with the destination platform’s current official guidance; those requirements can change, and BrowserCat’s screenshot documentation does not define them.
Wait for the content that matters
If the title, hero image or other essential content appears after the initial document load, wait for the specific element or state your page requires before calling screenshot(). For example, after navigation you can wait for a title element with Playwright:
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
await page.goto(targetUrl, { waitUntil: 'load' });
await page.locator('h1').waitFor({ state: 'visible' });
await page.screenshot({ path: 'preview.png' });
Replace h1 with a selector that identifies the content you need. A visible title alone does not prove that every image or font has finished loading, so inspect the output when those assets are important.
Recommended Free Tools
Pick the screenshot type that matches the intended image
- Viewport: captures the current browser view and is usually the appropriate starting point for a fixed preview composition.
- Full page: Playwright supports
fullPage: true. Use it when you genuinely want the entire page; a tall capture may not suit a social card. - Element: use a locator’s screenshot method when a particular hero or pre-composed card should be isolated, for example
await page.locator('.hero').screenshot({ path: 'hero.png' });. The selector must match the page you are capturing. - Format: PNG is the default used here. Playwright also documents JPEG output and a quality setting for JPEG. Choose based on the image’s appearance and the destination’s current accepted formats.
- Framing and appearance: the cheatsheet documents clipping, masks and custom screenshot styling. These can change the captured region or presentation; a mask is not a substitute for keeping sensitive information out of the rendered page, and injected styles alter the capture rather than the page’s social metadata.
See BrowserCat’s Playwright cheatsheet for the documented screenshot options and syntax.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Configure the remote browser only when needed
The basic connection is sufficient for a straightforward capture. BrowserCat’s configuration overview says options can be supplied as query parameters or through the BrowserCat-Opts header, with header keys taking precedence when both are set. Its examples cover browser choice and proxy configuration. Add configuration only when your workflow requires it, and check the BrowserCat configuration overview for the current interface.
Troubleshoot common capture problems
- Authentication or connection fails: confirm that
BROWSERCAT_API_KEYis set in the process environment and that the request sends it as theApi-Keyheader. Keep the key secret; do not paste it into a browser-delivered script. - The file is blank or misses page content: check the URL and inspect the page at the chosen viewport. If the needed content is rendered after navigation, wait for a selector or application state that represents readiness rather than relying only on the load event.
- A hero image is missing: confirm that the image is present at the target URL and wait for the relevant image or page state before capturing. A completed navigation event alone is not a guarantee that late assets have rendered.
- The image has the wrong composition: adjust the viewport or capture a specific element. Avoid
fullPage: trueunless the desired output is a full, tall page rather than a fixed preview. - The output does not meet a platform’s requirements: verify that platform’s current official image specifications and preview-testing workflow. A successful screenshot only confirms that an image was produced; it does not certify platform acceptance or display behavior.
- The remote browser does not accept an option: check the current BrowserCat configuration and Playwright documentation. Browser choice and connection configuration are separate from the basic screenshot flow.
Performance, reliability and cost considerations
Capture time depends on the page, its resources and the readiness condition you choose. Waiting for an element can avoid capturing an incomplete composition, but a selector that never appears can keep a job from reaching the screenshot step; use a selector that is present in the intended page state and handle failures in your application. The BrowserCat documentation cited here does not establish a speed, concurrency, uptime or pricing figure, so those should not be assumed from this example.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
For repeated captures, inspect the saved image and record failures in your own job workflow. If you need browser choice or proxy settings, consult BrowserCat’s configuration documentation before adding them.
Or skip the browser setup
ScreenshotNeo can return a website screenshot or PDF from one GET request. For example, this cURL request saves a WebP screenshot of the target page:
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo API documentation for the request options. ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.
Frequently Asked Questions
Does a BrowserCat screenshot set a page’s social preview metadata?
No. It captures the page as rendered in a browser; it does not by itself change the page’s social metadata.
Can I use Puppeteer or a CDP client instead of Playwright?
BrowserCat describes support for Puppeteer and CDP-based clients, while its quick start recommends Playwright as the starting point. Check BrowserCat’s current documentation for the connection details for your chosen client.
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.

