Skip to content

Extract a cURL request from Chrome DevTools

When a page interaction triggers a network call, Chrome DevTools can hand you a ready-to-run cURL version of that exact call.

OUTPUT FORMATSHTMLJSONMarkdown

This guide shows how to capture the right request, copy it, and replay or test it outside the browser.

Why copy a request as cURL?

A browser action such as a click, form submission or page load causes Chrome to issue an HTTP request. Copying that request as cURL gives you a terminal-ready replica you can run again, compare, or adjust. The walkthrough below uses govtech.com as its example, but the same DevTools steps apply to any site.

Capture the request in five steps

  1. Open the target URL in Chrome.
  2. Right-click the page, choose Inspect, and switch to the Network tab in DevTools.
  3. Clear the existing log with Ctrl + L, then perform the action that should generate traffic — scrolling, clicking, or navigating.
  4. Find the entry you need. Doc, JS, CSS and other filters help narrow a busy list. If a candidate looks plausible, double-click it to inspect the response in a separate page and confirm it matches what you expected.
  5. Right-click the confirmed request and choose Copy as cURL.

Checklist before you copy: the log was cleared first, the action was repeated after clearing, the filter matches the resource type, and the response was verified.

What the copied command contains

Expect a lengthy command rather than a short hand-written one. Chrome includes the headers, cookies and other details that were actually sent, which is what makes the replay faithful. The protected example module code0001 shows the shape of such a command, including its URL, header lines, cookie data and browser client hints.

Replay, test, or convert it

Run the command in a terminal to replay the request, or paste it into an API client such as Postman or Insomnia to try variations and debug outside the browser. If your next step is in a different language, a cURL converter can translate the command for you — confirm the converter destination via the owner input recorded for this page.

Capture checklist
StageWhat to doHow to confirm success
Open DevToolsInspect, then Network tabNetwork panel is recording requests
Generate trafficClear log, then trigger the actionOnly the new action's requests appear
Identify the requestFilter by type and double-click to check the responseResponse matches the expected page or resource
CopyRight-click the request and choose Copy as cURLA full command with headers and cookies is on the clipboard

Checklist derived from the source steps; not a regenerated schema.

Frequently asked questions

What is the shortest sequence to get a cURL command from Chrome?

Open the target page, open DevTools to the Network tab, clear the log, trigger the action you care about, select the matching request, then use Copy as cURL from its context menu.

Why is a copied cURL command so much longer than one written by hand?

The copied command is long because Chrome preserves the headers, cookies and other details sent with the original request, not just the URL.

How can I check I picked the right request?

Use the Doc, JS, CSS or other filters to narrow the list, then double-click a candidate to check the response in a separate page before copying it.

What can I do with the copied command?

Paste it into a terminal to replay it, or into a tool such as Postman or Insomnia to test or debug the request outside the browser. A converter can translate it for another programming language.