>_
curl

curl to Code

Convert curl commands into JavaScript fetch, Python requests or Go net/http code. Handles headers, JSON bodies, form data, basic auth and multi-line commands copied from API docs or DevTools.

Runs locally — your input never leaves this page.

  

How to use

  1. Paste a curl command, for example from API documentation or from DevTools (right-click a request → Copy as cURL).
  2. Choose the target: JavaScript fetch, Python requests or Go net/http.
  3. JSON bodies are pretty-printed in the target language. -F form uploads, -u basic auth, -G query data and line continuations are all supported.

FAQ

Are environment variables like $API_KEY expanded?

No. They are kept as literal text so you can see where to insert your secret. Replace them with your language’s way of reading environment variables (process.env, os.environ, os.Getenv).

Which curl options are ignored?

Transport options with no direct equivalent, such as --compressed, -s, -v, -o and timeouts, are skipped. -k becomes verify=False in Python.

Report a bug or suggest a feature →