cURL Command Generator

Generate cURL commands for API requests.

Generate cURL commands without remembering the flags. Choose GET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS, enter the URL, add headers, a body and authentication, and copy a correctly quoted curl command. The same request is also available as JavaScript fetch, Python requests, HTTPie and PowerShell code. The request isn't sent from this page.

Headers

The cURL output uses single quotes, which work in bash, zsh and macOS Terminal. In Windows PowerShell, call curl.exe and use double quotes instead.

Common use cases

  • Test an API from the terminal
  • Write curl examples for API documentation
  • Reproduce a request from an app for debugging

How to use

  1. Choose the method and URL.
  2. Add headers, body and authentication.
  3. Copy the curl command.

FAQ

Why are quotes different on Windows?

Command Prompt uses double quotes and escapes differently from Mac and Linux shells. PowerShell has its own syntax, so use the PowerShell output there.

How do I send JSON with curl?

Use -X POST, a Content-Type: application/json header and -d with the JSON in single quotes, which the generator does for you.