cURL Converter
Convert a cURL command to code — Python, JavaScript, Java, PHP, Go, Ruby and C#
Right-click a request in DevTools, pick "Copy as cURL", paste it here — and get the same request as working code in Java, JavaScript, Python, PHP, Go, Ruby or C#. The URL, method, headers, cookies and body carry over as they are, so a scraper starts from exactly what the browser sent. Parsing and code generation run in your browser: a command holding a session cookie or a bearer token never leaves the machine.
How to use
- 1Copy the request as cURL — In Chrome or Firefox DevTools open Network, right-click the request → Copy → Copy as cURL. Windows Chrome offers two flavours, bash and cmd — both are understood, including the cmd one with its caret (^) escaping.
- 2Paste the command — One line or many, with or without backslash line breaks. Postman, Insomnia and most API docs export the same format.
- 3Pick a language and client — Java, JavaScript, Python, PHP, Go, Ruby or C#. Where a language has more than one common client, the Client list holds them: java.net.http, OkHttp or Apache HttpClient for Java; fetch or axios for JavaScript.
- 4Copy the code — Imports, the header map and the request body are already filled in — the snippet runs as it stands, with no placeholders to replace.
- 5Check it still works — A copied request carries the cookies it had at that moment. If the code answers 403 where cURL answered 200, send the same request through Request Tester and see what the server actually replies.
Examples
curl -X POST … -d '{"q":1}' → requests.post(url, headers=headers, data=data)const options = { method: "POST", headers: {…}, body: "…" } → fetch(url, options)HttpRequest.newBuilder().uri(URI.create(url)).method("GET", …).build()-H 'Authorization: Bearer eyJ…' → .header("Authorization", "Bearer eyJ…")-b 'sid=8f2c…; lang=en' → "Cookie": "sid=8f2c…; lang=en"-u admin:secret → "Authorization": "Basic YWRtaW46c2VjcmV0"curl ^"https://example.com^" -H ^"Accept: */*^"When to use for web scraping
You have a request that already works — from DevTools, Postman or an API doc — and you need it as code. Retyping the URL, the method, fifteen headers and a JSON body by hand is slow and gets a character wrong sooner or later. Pasting the command does not. In scraping this is usually the first step. Find the request that returns the data in the Network tab, copy it as cURL, convert it to Python or Node, and the script starts from the exact headers and cookies the server expects — not from a guess about what it might want. When the response comes back wrong, Request Tester sends the same request through a proxy and shows the raw answer, and Proxy Checker tells you whether the proxy itself is the problem. Everything is computed locally. That matters more here than on most tools: a copied request usually contains a live session cookie or an access token, and those stay in the browser tab.