Convert cURL commands to code
cURL is the lingua franca of API docs and browser DevTools, but you rarely want to shell out to it from an application. Paste a command above and pick a language to get the equivalent request — method, URL, headers and body carried over — ready to drop into your code.
Supported outputs
- JavaScript Fetch — built into browsers and Node.js 18+.
- Axios — popular HTTP client for browsers and Node.
- Python Requests — JSON bodies are sent with
json=. - Go net/http — standard library only.
- Laravel HTTP client —
Http::withHeaders()with a fluent method call.
Review generated code before committing it: move tokens into environment variables, and add error handling and timeouts suited to your application.
Frequently asked questions
Is it safe to paste a cURL command with an API key?
The conversion runs in your browser and nothing is sent to a server, so the key never leaves your machine. Still rotate any key you paste into shared documents or screenshots afterwards.
Where do I get a cURL command from?
In Chrome, Edge or Firefox, open DevTools → Network, right-click a request and choose Copy → Copy as cURL. Most API documentation also shows cURL examples.
Which cURL options are supported?
The method (-X/--request), URL, headers (-H/--header) and body (-d, --data, --data-raw, --data-binary). Options such as file uploads, cookies files and client certificates are not converted.
Built and maintained by Pradeep Bhandari, Senior Engineering Manager & Full-Stack Architect. Last reviewed .