Toolvito

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.

Choose what to do

Task
cURL to code

More options

Toolvito converts the command, HAR file, API description or collection you submit. Conversion does not contact the API in that input. HAR files and collections can contain cookies, tokens and passwords. The converter removes them from its result unless you select the HAR option to keep them. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.

How to convert a curl command

  1. Choose cURL to code.
  2. Paste the command, for example from your browser’s “Copy as cURL”.
  3. Choose a language, or All.
  4. 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.

Related tools