Drop a curl command from any API doc, get clean JavaScript fetch() or Python requests code. Parses methods, headers, JSON bodies, query strings, and basic auth.
const response = await fetch("https://api.example.com/v1/orders", {
method: "POST",
headers: {
"Authorization": "Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc",
"Content-Type": "application/json",
},
body: JSON.stringify({
"customer": "cus_8a91",
"amount": 4900,
"currency": "usd"
}),
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
const data = await response.json();Handles -X, -H, -u, and the long-form equivalents (--request, --header, --user).
Detects JSON payloads automatically and emits a clean JSON.stringify(...) in JavaScript or json= in Python — no manual escaping.
Toggle between JavaScript fetch() and Python requests. Same parser, both outputs.