Documentation Blog Free tools [email protected]Log in

cURL to code converter

Paste a curl command — the one you copied from DevTools or from an API’s documentation — and get equivalent code in Python, Node, Go or PHP. Headers, JSON bodies, basic auth and cookies are carried over. The parsing happens in your browser, so nothing you paste is sent anywhere.

Generated code

        

Where the curl command comes from

The fastest way to reproduce a request you can see in a browser is to let the browser write it for you. Open DevTools, go to the Network tab, right-click the request and choose Copy → Copy as cURL. You get the full request with every header and cookie the browser sent. Paste it above and you have the same request as code.

That workflow is also the honest way to find an API. A page that renders its content from JSON is usually easier and far cheaper to read through its own endpoint than by parsing the rendered HTML.

Which flags are carried over

FlagBecomes
-X, --requestThe HTTP method
-H, --headerAn entry in the headers map
-d, --data, --data-raw, --jsonThe request body; valid JSON is detected and passed as a native object
-u, --userBasic authentication
-b, --cookieThe Cookie header
-A, -eUser-Agent and Referer headers
-x, --proxyProxy configuration, where the client supports it
-L, -kRedirect following and TLS verification

Flags that only affect curl’s own output — -s, -v, -i, --compressed — are recognised and dropped, because they have no equivalent in the generated code.

Why the generated code often fails on real sites

A converted request reproduces the headers, not the client. Many sites decide what to serve based on things a converter cannot copy: the TLS fingerprint, the exact order of your HTTP/2 headers, and whether your IP looks like a data centre. That is why a curl command that works from your laptop can return a challenge page from a server, with identical headers.

If that is the wall you have hit, it is the problem our scraping API exists to solve: a real browser fingerprint, residential exits and a retry path, with the page coming back as Markdown or JSON.

Questions about converting curl

How do I convert a curl command to Python requests?

Paste the command above and pick the Python requests tab. Headers become a dict, a JSON body is passed with json= so requests sets the content type itself, and form data is passed with data=.

How do I get a curl command from my browser?

Open DevTools, go to the Network tab, right-click the request you want and choose Copy → Copy as cURL. That gives you the exact request the browser made, headers and cookies included.

Does the converter send my command to a server?

No. The parser and the code generators are JavaScript running on this page, so commands containing API keys or session cookies never leave your browser.

Why does the converted code get blocked when curl worked?

Because headers are only part of your identity. Sites also read your TLS handshake, header ordering and IP reputation. A Python client sending Chrome’s headers still does not look like Chrome at the transport layer.

Which languages are supported?

Python (requests and httpx), Node (fetch and axios), Go with net/http, and PHP with curl. All six are generated from the same parsed request, so switching tabs never changes the meaning.

Can it handle multipart file uploads?

Form fields passed with -F are parsed, but file uploads need a real file on disk, so the generated code marks where to attach it rather than pretending to inline the content.

The request works. Now make it work at scale.

One envelope for every endpoint, clean Markdown out, and you are billed only when a call returns a usable result.

Get my free API key

Free key, $2 of usage credit every month, no credit card.

Get my free API key