FREE TOOL

curl Converter

Convert curl commands into Python, JavaScript, Node.js, PHP, Go, Java, Ruby, or C# code. Paste a command — headers, cookies, auth, and body included — and copy working code. Runs in your browser, no signup.

Conversion runs entirely in your browser — the command (and any tokens or cookies in it) is never sent to a server. Tip: DevTools Network tab → right-click a request → Copy as cURL.

Scraping a real site? Skip the blocks

Hand-copied curl headers go stale, and sites still block datacenter IPs. The same request through the WebScraping.AI API gets rotating proxies, headless Chrome rendering, and unblocking in one call — your custom headers and cookies are forwarded via the headers parameter:

2,000 free API credits · No credit card required

Supported curl options

The converter understands the options that appear in real scraping and API work — including everything Chrome DevTools emits with "Copy as cURL". Unrecognized flags are listed as warnings instead of silently dropped. For what each option does on the command line, see the curl commands guide.

OptionMeaning
-X, --requestHTTP method (also the attached form, -XPOST)
-H, --headerRequest headers; a Cookie: header is treated as cookies
-d, --data, --data-raw, --data-binaryRequest body; repeated values are joined with &
--data-urlencodeBody value with URL encoding applied
--jsonJSON body with Content-Type/Accept set (curl 7.82+)
-F, --formmultipart/form-data fields, including @file uploads
-u, --userBasic auth credentials
-b, --cookieCookies as name=value pairs
-A, --user-agent / -e, --refererShorthands converted to their headers
-x, --proxyProxy server
-L, -k, -I, -G, -mRedirects, TLS verification, HEAD, data-as-query, timeout
--compressed, -s, -v, -o, …Transfer/output flags most HTTP libraries handle automatically

From DevTools to working scraper code

The fastest way to reproduce a browser request in code: open DevTools → Network, right-click the request, and pick Copy as cURL. Paste it here and you get the same request as idiomatic code — quoting handled, headers preserved, the body parsed into the shape your HTTP library expects (a JSON object, form params, or a raw string).

One honest caveat from the scraping trenches: copied curl commands carry session cookies and browser-fingerprint headers that expire or get flagged, so a request that works today often returns 403 next week. That isn't a code problem — it's an IP-reputation and fingerprinting problem, which is what the WebScraping.AI API solves with rotating proxies and real headless Chrome.

Frequently asked questions

How do I convert a curl command to code?

Paste the command into the converter and pick a language — Python, JavaScript, Node.js, PHP, Go, Java, Ruby, or C#. The code updates as you type. Headers, cookies, basic auth, JSON or form bodies, file uploads, proxies, and timeouts are all translated.

Is it safe to paste curl commands with cookies or API keys?

Yes — parsing and code generation run entirely in your browser with JavaScript. The command is never transmitted or logged. You can verify in the DevTools Network tab: typing in the converter produces no network requests.

How do I copy a request as curl from Chrome DevTools?

Open DevTools, go to the Network tab, reload the page, right-click the request you want, then Copy → Copy as cURL. Paste the result here. Use the bash variant on Windows if offered — the cmd variant's caret escaping is only partially supported.

Why does the converted request get a 403 when the browser doesn't?

The site is blocking on more than headers: TLS fingerprint, IP reputation, JavaScript challenges, or expired session cookies. Copying more headers rarely fixes it for long. Routing the request through a scraping API with rotating proxies and headless Chrome — like WebScraping.AI — solves it at the infrastructure level.

Which curl options does the converter support?

The common request options: -X, -H, -d and the --data variants, --json, -F file uploads, -u basic auth, -b cookies, -A, -e, -x proxies, -L, -k, -I, -G, and -m. Unsupported flags are reported as warnings rather than silently ignored.

Is this curl converter free?

Yes — free, no signup, no usage limits. It's a static, client-side tool.

Related

Request converted? Make it unblockable.

Run the same request with rotating proxies, headless Chrome, and JS rendering — one API call.

Icon