# cURL to Python, Node, Go & PHP Converter

> Paste a curl command and get working Python, Node, Go or PHP code. Headers, JSON bodies, auth and cookies carried over. Converts in your browser.

[Home](https://quanticdata.io/)/[Free tools](https://quanticdata.io/tools/)/cURL converter

# 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.

curl command curl https://api.quanticdata.io/v1/scrape \ -H "Authorization: Bearer $QD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com", "format": "markdown"}'

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 &rarr; 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

| Flag | Becomes |
| --- | --- |
| `-X`, `--request` | The HTTP method |
| `-H`, `--header` | An entry in the headers map |
| `-d`, `--data`, `--data-raw`, `--json` | The request body; valid JSON is detected and passed as a native object |
| `-u`, `--user` | Basic authentication |
| `-b`, `--cookie` | The Cookie header |
| `-A`, `-e` | User-Agent and Referer headers |
| `-x`, `--proxy` | Proxy configuration, where the client supports it |
| `-L`, `-k` | Redirect 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](https://quanticdata.io/web-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 &rarr; 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.

## Related

[What is my user agent The header the converter carries over](https://quanticdata.io/tools/user-agent/) [Web scraping API When the converted request gets blocked](https://quanticdata.io/web-scraping-api/) [API documentation Every endpoint, one JSON envelope](https://quanticdata.io/docs/) [MCP server The same API as an agent tool](https://quanticdata.io/mcp-server/)

## 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](https://app.quanticdata.io/register)

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

---

Source: https://quanticdata.io/tools/curl-converter/ · Site index for AI: https://quanticdata.io/llms.txt
