Skip to content
Convertto

API Request Builder — Generate curl, fetch, axios and More

Build an HTTP request visually and get it as curl, fetch, axios, Python, Go or PHP code.

An API request builder turns a method, URL, headers and body into working code — curl, fetch, axios, Python requests, Go or PHP. This one deliberately does not send the request: firing it would mean proxying through a server, and any Authorization header you pasted would then have been seen by that server. Generating code keeps credentials on your machine.

Runs in your browser
Network
No request is ever sent — code is generated, not executed
Languages
curl, HTTPie, fetch, axios, Python, Go and PHP
Privacy
Runs entirely in your browser — nothing is uploaded
Cost
Free, unlimited, no sign-up

Frequently asked questions

Why does this not just send the request?

Browsers cannot call most APIs directly because of CORS, so any "online API client" is routing your request through its own server — headers, tokens and body included. That is a genuine credential disclosure, not a theoretical one. Generating code and running it yourself avoids it entirely.

Is it safe to paste a real token here?

Nothing is transmitted, so it does not leave your machine. But generated code has a habit of ending up in chat messages and commits, so using a variable name like $API_TOKEN and setting it in your environment is the better habit regardless of this page.

Why does the fetch example check response.ok?

Because fetch does not reject on HTTP error status. A 404 or a 500 resolves normally and only a network-level failure rejects, which is the single most common source of silent bugs in code that uses it. The generated snippet includes the check for that reason.

How to use the api request builder

  1. 1Choose the method.
  2. 2Enter or paste your url.
  3. 3Choose the authentication.
  4. 4Enter or paste your credential.
  5. 5Enter or paste your headers.
  6. 6Enter or paste your request body.
  7. 7Choose the generate for.
  8. 8Turn "Format the body as JSON" on or off as needed.
  9. 9The result appears immediately — copy or download it.

Embed this tool

Put the working api request builder on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.

Share this tool

Last updated

More developer tools