Skip to content

API

cURL Builder

Build cURL commands and Fetch API code from structured HTTP requests.

Loading tool…

Find this tool in

About this tool

What is cURL Builder?

Assemble a reproducible HTTP request before sharing a bug report or calling an API from a terminal. Set the method, URL and headers separately so a copied command is easy to inspect. The builder produces a command; generating it does not send the request.

A worked example

Build a read-only request with a query parameter

Example input

GET https://example.com/api?limit=2

Expected result

curl --request GET 'https://example.com/api?limit=2'

Choose GET, enter the URL, leave authentication and body empty, and select single-line cURL output. The quoted URL keeps its query together in a POSIX shell. Running the command is a separate step; the example endpoint is illustrative and does not promise an API response.

Common mistakes and limits

  • Remove tokens and session cookies before sharing a generated command. They can grant access even when the rest of a request looks harmless.
  • Shell quoting depends on the terminal. Review POSIX commands before adapting them for PowerShell or Windows Command Prompt.

Features

What you can do

  • Generate cURL commands for common HTTP methods.
  • Switch between multi-line and single-line cURL output.
  • Generate Fetch API JavaScript from the same request.
  • Add query parameters with automatic URL encoding.
  • Add, duplicate and remove HTTP headers.
  • Generate multiple cookies with cURL's --cookie option.
  • Generate Bearer token and HTTP Basic authentication.
  • Create JSON, raw and URL-encoded request bodies.
  • Automatically add a JSON Content-Type header when needed.
  • Copy generated code with one click.
  • Generate every result locally in your browser.

Frequently asked questions

Questions about cURL Builder

Does cURL Builder send the HTTP request?

No. It only generates cURL or Fetch code and never connects to the target URL.

Are headers, credentials or request bodies uploaded?

No. All request information remains inside your browser.

Can I generate a cURL command on one line?

Yes. Select Single-line under Command format to remove line continuations.

Can I add multiple cookies?

Yes. Multiple cookie entries are combined into one cURL --cookie argument separated by semicolons.

Does it generate Fetch API code?

Yes. Select Fetch API under Generated code to produce JavaScript from the same request settings.

Does it support Bearer and Basic authentication?

Yes. Bearer authentication creates an Authorization header, while Basic authentication uses cURL's --user option or a Basic Authorization value in Fetch code.

Is Content-Type added automatically for JSON?

Yes. When JSON body mode is selected, Content-Type: application/json is added unless an explicit Content-Type header already exists.

Related tools