🍱 Lunchbox Hands

cURL → Code

Convert curl commands to JavaScript fetch, Python requests, Node, or Go

From API docs to working code

Every API documents itself in curl, but nobody ships curl. Paste the documented command above and get the same request as idiomatic code in the language you are actually writing — JavaScript or Node fetch, Python requests, or Go net/http. Everything runs locally in your browser; commands containing API keys never leave your machine.

The converter applies curl’s real semantics, not a string substitution: implicit POST for -d and -F, -G promoting data into the query string, first-colon header splitting, ANSI-C quoted strings, and multi-line commands from Chrome DevTools. JSON bodies become native object or dict literals so the generated code reads like a person wrote it.

Want to fire the request instead of writing code? Use the HTTP request builder to send it from your browser. To shape the payload first, the JSON formatter validates and pretty-prints, and JSON → TypeScript types the response you get back.

Frequently asked questions

Which curl flags are supported?

The ones that shape the request: -X/--request, -H/--header, -d/--data/--data-raw/--data-binary/--data-urlencode, -F/--form, -u/--user, -b/--cookie, -A/--user-agent, -e/--referer, -G/--get, -k/--insecure, -L/--location, --url, and --compressed. Anything else (like -s, -o, or -v) is listed as an ignored-flag note under the output — unknown flags never break the conversion.

Is my curl command sent anywhere?

No. Parsing and code generation run entirely in your browser — the command, including any tokens or passwords inside it, never leaves your device. That said, treat generated code containing credentials with the same care as the original command.

Why did my request become a POST when I never wrote -X POST?

The converter applies curl’s own implicit rules: sending data with -d or a form with -F makes the request a POST unless you set an explicit -X method. And -G flips it back to GET, moving your -d parameters into the URL query string — exactly what curl itself does on the wire.

How is basic auth (-u user:password) translated?

Each language gets its idiomatic form: JavaScript fetch builds an Authorization header with btoa(), Node 18+ base64-encodes the credentials with Buffer.from(...).toString("base64"), Python requests gets an auth=(user, password) tuple, and Go calls req.SetBasicAuth(user, password).

Can I paste a multi-line command copied from Chrome DevTools?

Yes — that is the main use case. The tokenizer understands backslash line continuations, single and double quoting, backslash escapes, and $’...’ ANSI-C strings, all of which appear in DevTools’ "Copy as cURL" output. JSON bodies are detected and emitted as native object/dict literals where possible.

What happens with -k (--insecure)?

It depends on the target: Python gets verify=False and the others get an explanatory comment, because fetch cannot disable TLS verification and Go needs a custom http.Transport. The comment tells you exactly what to do if you genuinely need it — but reaching for -k usually means a certificate problem worth fixing instead.

Get weekly dev tools and tips