Developer Tools

curl to fetch, Python and axios.

Paste a curl command, for example one copied from your browser's dev tools or an API doc, and get equivalent JavaScript or Python code. Headers, JSON bodies, basic auth and form fields are carried over. The command is never sent anywhere.

Input

Line continuations with a backslash, single quotes, double quotes and $'...' strings are understood.

Code

Paste a curl command to convert it.

About this curl converter

API documentation and browser dev tools ("Copy as cURL") give requests as curl commands. This tool turns one into code you can paste into a script: JavaScript fetch, axios, or Python requests.

What is carried over

What is not converted

Options with no direct equivalent, such as proxies, timeouts, cookie jars, client certificates and output files, are listed as warnings instead of being silently dropped. Output is meant as a starting point: review it before running it, especially anything involving credentials.

Privacy

curl commands often contain API keys and tokens. Conversion happens in your browser, and this page loads no advertising or analytics scripts and allows no outside network requests.

FAQ

How do I convert a curl command to Python?

Paste the command, choose Python (requests) and copy the code. JSON bodies use the json= argument so requests sets the right encoding.

How do I get a curl command from my browser?

Open dev tools, go to the Network tab, right-click a request and choose Copy as cURL. Paste it here. Remove cookies and tokens before sharing the result.

Is my curl command sent to a server?

No. It is parsed in your browser and this page blocks outside network connections.

Source