Search and jump to any tool. Type to filter; use arrow keys to move and Enter to select.
Paste a curl command copied from API documentation, browser dev tools or shell history and get equivalent JavaScript.
Paste a curl command copied from API documentation, browser dev tools or shell history and get equivalent JavaScript. You choose between fetch and axios output, and a parsed summary shows the method, URL, headers, basic-auth user and body that were extracted. Anything the converter cannot translate is listed as a warning instead of being dropped silently.
curl -X POST https://api.example.com/users -H 'Content-Type: application/json' -u admin:secret -d '{"name":"Ada"}'const response = await fetch("https://api.example.com/users", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Basic " + btoa("admin:secret"),
},
body: JSON.stringify({
"name": "Ada"
}),
})
(followed by a response.ok check and a response.json() call)Good to know. The command is only parsed as text; it is never run and no request is made from this page. Cookies passed with -b become a Cookie header, which browsers refuse to set from fetch, so use that output in Node or another server environment.
https://api.example.com/v1/users?verbose=trueHeaders
Basic auth
demo:••••••
Body
{"name":"Ada Lovelace","role":"admin","tags":["math","code"]}