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.
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
- Choose the method and URL.
- Add headers, body and authentication.
- 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.
Related tools
- HTTP Request BuilderBuild an HTTP request with headers, auth and a body, then copy it as cURL, fetch, Python requests or HTTPie…
- OpenAPI ValidatorValidate OpenAPI/Swagger specification documents.
- Swagger JSON to YAMLConvert Swagger/OpenAPI JSON to YAML format.
- YAML to Swagger JSONConvert Swagger/OpenAPI YAML to JSON format.
- Markdown PreviewPreview Markdown content rendered as HTML in real-time.
- JWT DecoderDecode JWT headers and claims, check expiry, and verify HS256, HS384 or HS512 signatures in your browser.
- HTTP Status CodesIn Reference