OmniTools

curl converter

Turn a curl command into fetch, axios, Python, Go or Node.

Nothing you enter is sent anywhere

Understood as

Code

const res = await fetch("https://api.example.com/v1/items", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
  body: "{\"name\":\"test\",\"qty\":2}",
});

const data = await res.json();

Backslash line continuations and both quote styles are handled, which is how curl commands are actually pasted out of documentation. If the command carried a real token, it is in the output too, so check before sharing.