Free tools

curl converter: curl to fetch, axios and Python

Paste a curl command from any API’s docs and get the same request as code for your project. Secret keys are spotted for you and moved to .env. Everything runs in your browser.

Free from Darnly. Spot a bug in the app you're building? Darnly hands it to Claude Code, Codex or Cursor in one key.Add to Chrome

POST

More free tools

See all 89 tools

How it works

  1. Paste a curl command from an API’s docs, or from Chrome DevTools (right-click a request in the Network tab, then Copy › Copy as cURL). An OpenAI example is already filled in.
  2. Check the request card: method, address, headers, body and login. Anything that looks like a secret key is marked in pink.
  3. Pick fetch, axios, Node.js, Python or a Next.js route and copy the code. Keep Move keys to .env on, and paste the .env.local lines it gives you into your project.

Questions

Is my curl command sent anywhere?

No. The command is read and turned into code in your browser. Nothing is uploaded, so it’s safe to paste commands with real keys in them. Still, if a key ends up somewhere public, change it at the provider.

Why does it warn me about my API key?

Code that runs in the browser can be read by anyone who opens your site, keys included. Call the API from a server route instead (the Next.js route tab writes one for you) and keep the key in .env.local. To check a live site for leaked keys, use the API key leak checker.

Which curl options does it understand?

-X, -H, -d, --data-raw, --data-binary, --data-urlencode, --json, -F, -u, -b, -A, -G, -I, -k and --oauth2-bearer, with single, double and $'…' quotes and lines that end in \ or ^. Options that only change how curl prints or saves things, like -s or -o, are left out and listed under What changed.

Why did it add a Content-Type header?

When the body is JSON but the command has no Content-Type, curl actually sends it as a form, and most APIs then reply with an error. The tool adds Content-Type: application/json so the code does what the docs meant.

fetch or axios: which should I use?

Use fetch unless your project already uses axios. fetch is built into browsers, Node.js 18+, Next.js and Cloudflare Workers, so there’s nothing to install. axios is a package that does the same with slightly shorter code.

Does it work with Copy as cURL from Chrome on Windows?

Yes, both the bash and cmd versions work. The PowerShell version isn’t curl, so pick Copy as cURL (bash) instead.