Get the curl command and the fetch code

API developers and support teams use it to reproduce a call before testing an endpoint, diagnosing a fault or writing an example.

Get the curl command and the fetch code. Everything runs in your browser and delivers a clean result without registration.

How to use

  1. Write the HTTP method on the first line, such as GET or POST.
  2. Then enter the URL of the API or service you want to call.
  3. Add one header per line as Name: value, then separate the body with a line containing two dashes.
  4. Run the compose action to generate the matching curl command and fetch code.
  5. Copy the output and test it in your terminal or project.

Example

A developer is writing an API documentation example. They enter a POST method, a test address, a Content-Type header and a small JSON body. The tool shows the curl command and fetch code, making it easy to confirm that the request contains the same elements before publishing it.

Input

POST
https://example.com/api/items
Content-Type: application/json
--
{"name":"test"}

Limits and formats

Where processing happens

Everything is computed in your browser. The method, URL, headers and body stay on your device and are not sent to any remote service.

Frequently asked questions

Can I use the URL of my internal API?

Yes, because the text remains in your browser and the tool does not call it. You can prepare a request to a local or private address, then run it yourself from an authorized environment.

Why does the body need a line of dashes as a separator?

That line tells the tool where the header list ends and the body begins. Without it, the content may be read as another header, and the generated request will be incorrect.

Are the curl command and the fetch code equivalent?

They describe the same call with different syntax. curl is used in a terminal, while fetch fits into JavaScript. Check the headers and body in both outputs before reusing them.

Tools in the same category