Overview
Translates a curl command into JavaScript fetch, Axios, or Python requests code — method, URL, headers, and body — so a snippet from API documentation becomes code that fits your project without manual transcription.
How It Works
Paste the curl command; conversion is live on every keystroke. The parser reads the -X method (GET when absent), the URL, every -H header, and a quoted -d body. Switch between the three targets with the segmented buttons and copy the result.
Step-by-Step Usage Guide
- Paste the curl command, including its line-continuation backslashes.
- Pick the target: JS Fetch, Axios, or Python.
- Check the generated method, headers, and body.
- Copy the code into your project and replace placeholder tokens.
Technical Specifications & Standards
The fetch output wraps the body in JSON.stringify(...) and ends with a response.json() read, which matches how most JSON APIs are called. The Axios variant inserts the body raw and lowercases the method into axios.post() style calls, while the Python variant always uses the requests library's json= parameter. Quoted arguments are respected, and the trailing backslash of a multi-line curl command is tolerated.
Targeted Use Cases
- Converting the curl examples in API documentation into fetch calls for a frontend.
- Producing Python requests snippets from curl-based test scripts.
- Translating between Axios and fetch when migrating a codebase's HTTP layer.
- Turning a working terminal request into a reproducible snippet for a README.
Notes & Gotchas
- Only -X, -H, and -d are parsed. Flags like --data, --data-raw, -F/--form (multipart uploads), -u (basic auth), -b (cookies), -I, -L, and --compressed are ignored — review the output before shipping.
- The -d body must be quoted or it is dropped. In fetch output the body arrives JSON.stringify-wrapped, so pass an object rather than pre-serialized JSON or you will double-encode.
- Header values that themselves contain quotes are skipped by the header parser — check the generated headers object for anything missing.
- Unrecognised input does not error loudly: it degrades to a GET with an empty URL. If the output looks odd, confirm the paste actually starts with curl.
Frequently Asked Questions
Which output formats are supported?
Three: browser fetch(), Axios, and Python requests. Switch with the segmented buttons.
Why is my body wrapped in JSON.stringify?
That is the fetch convention for JSON payloads and matches the tool's JSON-first default. Pass an object, or unwrap it if your body is already a string.
Does it handle multipart form uploads?
No. -F/--form and file uploads are not parsed; write FormData by hand for those requests.
Is anything sent to a server?
No. Parsing happens in the browser, so commands containing internal hostnames or tokens stay local.
Related tools
- cURL to Python / Go / Rust / Fetch Code - Convert cURL commands into JavaScript fetch/axios, Python requests, Go net/http, and Rust reqwest code.
- cURL → fetch / SDK Converter - Convert cURL commands into fetch code and typed OpenAI/Anthropic SDK calls - entirely in your browser.
- WebAssembly IDE - Run Python, JS, and more natively in the browser via WASM. No installs — execute code instantly.
- HTTP Status Code Reference - Searchable reference for every HTTP status code — 1xx to 5xx — with descriptions and use cases.
- Code Minifier (CSS/JS/HTML) - Minify CSS, JavaScript, or HTML in your browser — strips comments and collapses whitespace safely, showing the size saved.
- Docker Run ↔ Docker Compose Converter - Convert docker run CLI commands to docker-compose.yml files and vice versa with environment, volume, port, and network parsing.