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.