Curl to Fetch

Paste curl, ship code.

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.

POSThttps://api.example.com/v1/orders
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();

Methods & headers

Handles -X, -H, -u, and the long-form equivalents (--request, --header, --user).

JSON-aware bodies

Detects JSON payloads automatically and emits a clean JSON.stringify(...) in JavaScript or json= in Python — no manual escaping.

Two targets

Toggle between JavaScript fetch() and Python requests. Same parser, both outputs.