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

If you already have a Puppeteer HTTPRequest, call request.response(). It returns the matching HTTPResponse if one has arrived, or null if the response has not arrived yet. If an action will trigger the response, register page.waitForResponse() before performing the action, then await the returned promise.

Choose the Puppeteer API for what you need

Get a response from an existing request

Call response() on the request object. Because it is an accessor, not a waiter, check for null before reading status or body.

const response = request.response();

if (response === null) {
  console.log('The response has not arrived yet');
} else {
  console.log('Status:', response.status());
  const body = await response.json();
  console.log(body);
}

The official API describes the result as a matching HTTPResponse or null if the response has not been received yet. HTTPRequest.response() reference

Wait for a response triggered by an action

Start waiting before the click, navigation, or other action that initiates the request. This ensures Puppeteer is listening before the response can arrive.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const responsePromise = page.waitForResponse(response =>
  response.url().includes('/api/data') &&
  response.request().method() === 'GET'
);

await page.click('button#load-data');
const response = await responsePromise;

console.log('Status:', response.status());
const data = await response.json();
console.log(data);

The URL fragment and selector are illustrative; replace them with the endpoint and control used by your page. The predicate can match on response URL, status, or details of its request. The API also accepts a URL string or an asynchronous predicate. Page.waitForResponse() reference

Match the response you intend to inspect

When a page makes multiple requests, use a predicate specific enough to select the target response. For example, match the exact URL and expected status:

const responsePromise = page.waitForResponse(response =>
  response.url() === 'https://example.com/api' &&
  response.status() === 200
);

await page.click('#submit');
const response = await responsePromise;

This pattern is adapted from Puppeteer’s documented URL-and-status example. Page.waitForResponse() reference

Distinguish a request from its response

Puppeteer’s network events represent different points in a request’s lifecycle. A request event means a request was issued; a response event means a response arrived; requestfinished means the response body finished downloading and the request completed. A request-level failure emits requestfailed instead of requestfinished, and may happen without a response event. PageEvent reference

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
page.on('request', request => {
  console.log('Issued:', request.url());
});

page.on('response', response => {
  console.log('Received:', response.url(), response.status());
});

A 404 or 503 is still an HTTP response: Puppeteer documents that these statuses complete through requestfinished, not requestfailed. Check response.status() or response.ok() to judge the HTTP result separately from whether the request failed at the transport/request level. PageEvent reference HTTPResponse reference

Redirects can change the URL you observe

A redirect response completes the original request and causes a new request to the redirected URL. If matching by URL, account for that sequence and inspect the request URLs and redirect chain rather than assuming the original URL will be the final response URL. HTTPRequest reference HTTPResponse reference

Set and diagnose the response wait timeout

In Puppeteer’s Page.waitForResponse() reference version 25.12.0, the documented default timeout is 30 seconds. You can change the page’s default timeout with Page.setDefaultTimeout(), pass a timeout in the wait options, or use timeout: 0 to disable the timeout. The options also include a signal. Page.waitForResponse() reference, version 25.12.0

If the wait times out, the predicate was not satisfied during the configured window. Check these likely causes:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • The wait was created after the triggering action, so the response may have arrived before the listener was active.
  • The URL, method, or status condition does not match the actual response.
  • The action did not initiate the request you expected.
  • The request failed before an HTTP response arrived; inspect the request lifecycle and failure event.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

For a screenshot rather than a Puppeteer network-response workflow, ScreenshotNeo can return a website screenshot or PDF from one GET request. Its clean-shot steps accept the cookie or consent banner and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. It also provides an MCP server for AI agents, with screenshot, page-info, and PDF tools. ScreenshotNeo

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 documentation for request options. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.

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.