cURL to Code Converter
Convert cURL commands to code in 8 programming languages.
How it works
- 1
Paste your cURL
Paste a cURL command from your terminal, browser DevTools, or API docs.
- 2
Choose a language
Select the target programming language from the dropdown.
- 3
Copy the code
Copy the generated code snippet to use in your project.
Common use cases
Simple GET request
curl https://api.example.com/users
POST with JSON body
curl -X POST -H "Content-Type: application/json" -d '{"name":"test"}' https://api.example.com
About This Tool
Paste any cURL command and instantly get equivalent code in JavaScript (fetch or axios), Python, Go, PHP, Ruby, Rust, or Java. Handles headers, request bodies, authentication, cookies, and multi-line commands. Copy the generated code or send the parsed request directly to the API Request Builder for further testing.
More examples
Examples
Simple GET request
Input
curl https://api.example.com/users
Output
const response = await fetch('https://api.example.com/users');POST with JSON body
Input
curl -X POST -H "Content-Type: application/json" -d '{"name":"test"}' https://api.example.comOutput
requests.post('https://api.example.com', json={"name":"test"})Frequently Asked Questions
- What cURL flags are supported?
- The parser supports -X (method), -H (headers), -d (data), -u (auth), -b (cookies), -k (insecure), -L (follow redirects), and -F (form data), along with their long-form equivalents.
- Does it handle multi-line cURL commands?
- Yes. Commands with backslash line continuations (\) are automatically joined and parsed correctly.
- What languages can I convert to?
- JavaScript (fetch and axios), Python (requests), Go (net/http), PHP (cURL), Ruby (net/http), Rust (reqwest), and Java (HttpClient).