How to use it
- Copy a request as curl, for example from your browser's developer tools (Network tab, right-click, Copy as cURL) or from API documentation.
- Paste it into the box. Line continuations with \ are fine.
- Choose JavaScript fetch, Node.js axios, Python requests or PHP cURL.
- Read any notes below the code, then copy or download the result.
How it works
The converter first splits the command into words the way a POSIX shell does: single quotes, double quotes with backslash escapes, $'…' strings and backslash line continuations are understood. Shell variables such as $TOKEN are not expanded; they stay as text.
Supported curl options: the URL (or --url), -X/--request, -H/--header, -d/--data, --data-ascii, --data-raw, --data-binary, --data-urlencode, --json, -F/--form and --form-string (fields and @file uploads with ;type=), -u/--user, -G/--get, -I/--head, -A/--user-agent, -e/--referer, -b/--cookie (cookie strings), -L/--location and --compressed. Short options can be combined, as in -sSL, and values can be attached, as in -XPOST.
The rules follow curl: several -d values are joined with &; data makes the request a POST unless -X or -G says otherwise; -G appends the data to the URL as a query string; --json sets the Content-Type and Accept headers to application/json. When the body is JSON and the Content-Type says so, the code sends a real object (json= in Python, an array with json_encode in PHP) instead of an escaped string. For multipart forms, the Content-Type header is left to the library so the boundary is correct.
-k/--insecure is ignored on purpose and a note explains it. Options that only change curl's own output (-s, -S, -v, -i, -o, --fail and similar) are ignored with a note. Any other option produces a clear error naming it, rather than code that silently does something different. One difference remains: curl follows redirects only with -L, while fetch, axios and requests follow them by default; the PHP code follows them only when -L was given.
The tool only writes code. It never sends the request, so tokens and passwords in the command are not used anywhere.
Examples
Reproducing a browser request in Python
Copy a failing API call from Chrome's Network tab as cURL and convert it to Python requests. The headers, cookies and JSON body come over, so you can reproduce the bug in a script.
Using API documentation in Node.js
An API reference shows “curl -u key: https://api.example.com/v1/charges -d amount=2000 -d currency=eur”. The axios version uses auth: { username: "key", password: "" } and a form-encoded body.
File upload in PHP
“curl -F 'file=@invoice.pdf;type=application/pdf' -F 'note=March' https://x.io/upload” becomes CURLOPT_POSTFIELDS with new CURLFile('invoice.pdf', 'application/pdf') and the note field.
Frequently asked questions
Does this tool send my request?
No. It only parses the command text and writes code. No request is made, so API keys or cookies in the command are not used or stored.
Why is -k/--insecure not converted?
Turning off certificate checks makes the connection open to interception. The generated code keeps checks on; if a server's certificate is not trusted, fix the certificate or trust store instead.
Why do I get “option is not supported”?
The converter only translates options whose meaning it can reproduce exactly. Proxies, client certificates, cookie jars and similar options are rejected so you do not get code that behaves differently from curl.
Does it work with Windows cmd commands?
Commands copied as “cURL (bash)” work best. Windows cmd uses ^ for line continuation and different quoting; ^ at line ends is accepted, but other cmd escapes may not be.
Privacy
The command is parsed only in your browser and no request is sent. Nothing is uploaded, stored or included in analytics.