The cURL to Code Converter turns a cURL command into code you can use in your project. Paste the command from API documentation or your browser, choose Python, JavaScript fetch, Node axios or PHP, and copy the result. Headers, JSON bodies and basic auth are handled.
How to use the cURL to Code Converter
- Paste your cURL command.
- Choose a language.
- Check the generated code.
- Copy it into your project.
Features
- Python requests, JavaScript fetch, Node axios and PHP
- Headers, JSON and form bodies
- Basic auth and insecure flag
- Handles line breaks and quotes
- Runs in your browser
Frequently asked questions
Is it safe to paste API keys?
The conversion happens in your browser and nothing is sent to a server, but it is still best to use placeholder keys when sharing code.
Which cURL options are supported?
Method, headers, data, JSON, form fields, user, user agent, cookie and insecure options are supported.
Can I copy a request from Chrome?
Yes. In the browser network panel, right-click a request and choose Copy as cURL, then paste it here.