Processed online by Toolvito
API Request & Specification Converter
Paste a curl command to get the same request as Python (requests), PHP (cURL), PowerShell (Invoke-WebRequest), JavaScript (fetch) or a raw HTTP request. You can also turn a browser HAR file, an OpenAPI/Swagger description or a Postman collection into curl commands, and convert between OpenAPI and Postman. Nothing is sent to any API.
How to convert a curl command
- Choose cURL to code.
- Paste the command, for example from your browser’s “Copy as cURL”.
- Choose a language, or All.
- Press Convert and copy the code.
What is understood
- Methods (-X), headers (-H), data (-d, --data-raw, --data-binary, --data-urlencode, --json), forms (-F), user and password (-u), cookies (-b), user agent (-A), referer (-e), redirects (-L), HEAD (-I) and GET with data (-G). Output, progress, proxy and timeout flags are left out.
- Quoting follows the shell rules, so single and double quotes and line breaks with \ work.
- --insecure (-k) is not carried over: the code always checks certificates.
HAR files, OpenAPI and Postman
- HAR to cURL: save the Network panel as HAR in your browser, choose the file, and get one curl command per request. Cookies and Authorization headers are left out unless you keep them.
- OpenAPI or Postman: choose an OpenAPI 3 or Swagger 2 file (JSON or YAML) to get a curl command for every operation, with example values from the file or made from its schemas, a Markdown request list and a Postman collection to import.
- Choose a Postman collection (v2.0 or v2.1, exported as JSON) to get its requests as curl commands and an OpenAPI 3 file. Tokens, passwords and API keys in the collection are replaced by placeholders.
Limits
The converter does not run commands or call APIs; to send a request, use the API Request Tester. It does not generate client libraries (for example TypeScript or Java SDKs) or Swagger UI pages, and $ref links to other files are not followed. An OpenAPI file made from a Postman collection guesses types from the example values, so check it.