October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Menlo Park desk7 min

Create WhatsApp Link Preview Thumbnails from Webpages with Node.js Puppeteer

Puppeteer can capture a webpage or element, but Open Graph metadata—not the screenshot itself—connects a public image to a WhatsApp link preview.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer can render a webpage and save its pixels as an image, but a screenshot alone does not create a WhatsApp link preview. To associate an image with a page, publish it at a publicly accessible absolute URL and put that URL in the page’s og:image metadata. Then verify what the page serves and test the actual WhatsApp sending path you use.

How a WhatsApp link preview gets its image

There are two separate jobs: creating an image, and telling a preview consumer which image belongs to a webpage. Puppeteer handles the first job. The webpage’s Open Graph metadata handles the second. WhatsApp-specific guidance calls for og:title, og:description, og:url, and og:image in the HTML head. The Open Graph protocol’s four required basic properties are og:title, og:type, og:image, and og:url (Open Graph protocol).

As an Amazon Associate I earn from qualifying purchases.

Therefore, generate a screenshot only if the page needs a custom image. If it already has an appropriate social image, you may only need to publish that image and set or correct its metadata. Puppeteer’s current Screenshots guide, version 25.12.0, documents both Page.screenshot() for a page and ElementHandle.screenshot() for a particular element (Puppeteer Screenshots guide).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose what the thumbnail should show

Approach Use it when Trade-off to consider
Existing designed social image The page already has a suitable branded image. It preserves deliberate design; keep it in sync with page content.
Full-page Puppeteer screenshot The entire page is useful as the preview image. A long page may become a tall, small-looking thumbnail; the resulting dimensions and file size must still meet the guidance below.
Element screenshot A stable page region, such as a hero or product card, communicates the page best. The element must exist when captured, and its layout should be checked at the chosen viewport.

Capture a webpage image with Node.js Puppeteer

Install Puppeteer in a Node.js project using its documented package and installation instructions (Puppeteer installation guide). The following CommonJS script opens a URL, waits for the page’s load event, and saves a viewport screenshot. Set the target URL and output path for your own site.

#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
const puppeteer = require('puppeteer');

async function main() {
  const url = 'https://example.com/';
  const browser = await puppeteer.launch();

  try {
    const page = await browser.newPage();
    await page.setViewport({ width: 1200, height: 630, deviceScaleFactor: 1 });
    await page.goto(url, { waitUntil: 'load', timeout: 60000 });
    await page.screenshot({ path: 'whatsapp-preview.png', type: 'png' });
  } finally {
    await browser.close();
  }
}

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

This captures the visible viewport, not necessarily the whole document. For a full-page capture, change the screenshot call to await page.screenshot({ path: 'whatsapp-preview.png', type: 'png', fullPage: true });. For an element, wait for a selector and capture its handle:

const card = await page.waitForSelector('.hero-card', { timeout: 15000 });
if (!card) throw new Error('Preview element was not found');
await card.screenshot({ path: 'whatsapp-preview.png', type: 'png' });

Replace .hero-card with a selector that is present on the target page. A viewport capture is often easier to control for a compact card image; a full-page image can be excessively tall. Check the produced file’s actual dimensions and byte size rather than assuming the browser viewport alone guarantees compliance.

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

Wait for the right page state

The example waits for load, which is a starting point rather than a universal readiness guarantee. Pages that fetch or render important content after load may need a site-specific readiness condition, such as await page.waitForSelector('.hero-card'), before capture. Puppeteer’s screenshot example also uses page.goto() with waitUntil: 'networkidle2'; network-idle waiting may not suit pages with continuous network activity. Choose the condition that means the desired content is actually ready.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Publish the image and add Open Graph metadata

Upload the generated image to a location that can be fetched publicly, then use its complete absolute URL. Add nonempty metadata in the document’s <head>, adapting the values to the page and image you published:

Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
<head>
  <title>Example page title</title>
  <meta property="og:title" content="Example page title">
  <meta property="og:description" content="A concise description of this page.">
  <meta property="og:type" content="website">
  <meta property="og:url" content="https://example.com/page">
  <meta property="og:image" content="https://example.com/images/whatsapp-preview.png">
</head>

WhatsApp-specific guidance says the title should represent the content without branding, the description should be nonempty (it says 80 characters will suffice for the displayed description), and the URL should be canonical and undecorated. The general Open Graph protocol treats og:description as optional, so distinguish that protocol rule from the WhatsApp-specific recommendation. The protocol also documents image properties such as width, height, type, secure URL, and alt description; these are useful metadata but do not replace og:image.

Check the image and metadata constraints

The WhatsApp developer guidance, as preserved by ChatArchitect’s mirror (which links to Meta’s documentation), describes these implementation constraints:

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)
  • The metadata head should appear within the first 300 KB of the HTML response. This is a position threshold for the head, not a maximum total page size.
  • The preview image should be under 600 KB and at least 300 pixels wide.
  • The image width-to-height ratio should be no greater than 4:1.
  • The og:image value should be an absolute URL to an image that can be fetched publicly.

The cited mirror displays a 2025 update, but the upstream Meta page’s update date was not independently confirmed there. Treat these as the guidance presented by that source, and recheck Meta’s current documentation if these thresholds are critical to a production workflow.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo can return a webpage screenshot through one GET request; this example follows its API documentation (ScreenshotNeo documentation). The returned image still needs to be hosted publicly and referenced by your page’s og:image tag.

Best Value
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

ScreenshotNeo removes cookie banners, popups, and chat widgets before capture. 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 per month without a card; paid plans start at $5 for 3,000 shots. Learn about ScreenshotNeo, or sign up for 1,000 free screenshots a month with no card.

Verify the page and test the real sending path

  1. Open the exact destination URL and note any redirects. Use the final canonical URL you intend to share for og:url.
  2. Inspect the HTML actually returned to a client, not only the metadata in a browser’s developer tools after JavaScript runs. Confirm the tags are in the head and appear early enough in the response.
  3. Fetch the image URL without being logged in. Confirm it returns the intended image and that the file is below the stated size limit, at least 300 pixels wide, and within the stated aspect-ratio guidance.
  4. Send a test through the WhatsApp client or business integration that will actually send the link. Inspect the received card and record the client, sending tool, time, and result if you need to investigate an integration-specific issue.

A page satisfying metadata guidance is not a guarantee that every message will show a preview. The supported behavior can depend on the exact URL, returned HTML, integration’s preview support, message type, and recipient’s client. A manual paste into a personal chat does not establish that a business integration supports the same behavior.

Troubleshooting: link opens but the preview is missing or wrong

No card appears

  • Check that the exact shared URL resolves and inspect its final redirect destination and canonical metadata.
  • Confirm the returned HTML includes nonempty og:title, og:description, og:url, and og:image in the head.
  • Check that the image URL is absolute and publicly retrievable without a session, access token, or browser-only state.
  • Test with the actual sending integration and message type. A successful personal-chat test does not prove an integration supports previews.

The wrong image or old image appears

  • Verify that og:image points to the intended public file, not a different image or an inaccessible URL.
  • Inspect the exact URL and HTML response used for the message; redirects and canonical URL differences can mean you are testing different page identities.
  • Check the captured image itself for an unintended crop, loading state, or missing dynamic content. Adjust the Puppeteer readiness condition or capture target and regenerate it if needed.

The consulted guidance does not establish a current WhatsApp crawler user agent, cache lifetime, or cache invalidation procedure, so do not assume a particular refresh command or waiting period will resolve a stale card.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently asked questions

Can Puppeteer generate an Open Graph image?

It can generate an image file by rendering a page or element. Open Graph metadata connects that file’s public URL to the webpage; Puppeteer does not control how WhatsApp renders a preview.

Do I need to capture a screenshot if the page already has a social image?

No. If the existing image is suitable and publicly fetchable, use its absolute URL in og:image and validate the metadata and image constraints.

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$35.80
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
Bestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$69.99

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.