cURL converter
Paste a cURL command, such as one copied from your browser's network tab, and get the same request in Python, JavaScript, Go, PHP, Ruby or Rust.
cURL command
What the command sends
Converted
When to use it
A request works in your browser and you want the same request in your code. Copy it as cURL, paste it here and pick a language.
Getting the command
Every browser can give you a request as cURL. Open the developer tools and go to the network tab. Right-click the request and choose Copy as cURL. You get the exact headers and cookies the browser sent. It's the fastest way to start copying a request in code.
How it's read
The command is split into words the way a shell would split it. Single quotes, double quotes, $'…' strings and line continuations all work, including the ^ continuations Windows writes. Then the flags that shape the request are applied: method, headers, cookies, body, form fields, basic auth, proxy, redirects, TLS checks and timeout. Flags that only change what curl prints, such as -s or -o, are listed and left out.
What to check in the output
- curl doesn't follow redirects unless you pass
-L. The generated code does the same, so a 302 comes back as a 302. - A body sent as JSON is written as a native structure. Key order is kept but whitespace isn't, so the bytes sent can differ from the original.
- Files named with
@are referenced by path. Nothing is read from your disk.
When the same request still gets blocked
Copying headers and cookies copies what the browser said, not how it said it. Anti-bot systems also look at the TLS handshake, the HTTP/2 settings and the order of the headers. A cURL command records none of those. They also tie cookies to the session that earned them. If your code gets a 403 or 429 where the browser got a 200, paste the response into the anti-bot detector to see which bot protection you're facing.
Questions people ask
How do I copy a request from my browser as cURL?
Open the developer tools, go to the Network tab, right-click the request and choose Copy, then Copy as cURL. Paste that here and pick a language.
How do I convert a cURL command to Python requests?
Paste the command and choose Python. The URL, method, headers, cookies and body are carried over, and a JSON body becomes a json= argument so requests encodes it for you.
The converted code gets blocked but the browser request worked. Why?
The code sends the same headers, but not the same TLS and HTTP/2 fingerprint, and it cannot run the page's JavaScript. If the site sits behind an anti-bot vendor, the cookies and passes in your copied command will also expire quickly.
Does my command get uploaded?
No. The conversion happens in your browser, so cookies and authorization headers in the command stay on your machine.
Related tools
All tools →Get started
Blocked by bot protection? $5 is 5,000 solves.
No subscriptionCredit never expiresFailed solves are free