cURL to PHP Guzzle

Convert cURL commands into PHP Guzzle client code — json, form_params, multipart and auth options included.

This tool runs 100% in your browser. Your data is never uploaded, stored, or logged.

PHP Guzzle code

  

About this tool

Guzzle is PHP's standard HTTP client, but translating cURL flags to its options array takes documentation-diving. This tool parses the command and writes the full Guzzle request: JSON bodies become 'json' =>, URL-encoded data becomes 'form_params', uploads become 'multipart', and -u becomes 'auth'.

Boilerplate (require + use statements) is optional so you can paste into existing code.

How to use it

  1. Paste the cURL command.
  2. Toggle boilerplate if you need a standalone script.
  3. Copy the generated PHP.
  4. Run it in any project with guzzlehttp/guzzle installed.

Useful ways to apply it

  • Implementing a third-party API from its cURL-only documentation.
  • Migrating shell-based integrations into a Laravel/Symfony app.
  • Generating consistent Guzzle snippets across a team.
  • Learning how cURL concepts map to Guzzle options.

Frequently asked questions

Which body types are recognized?
JSON bodies map to 'json', application/x-www-form-urlencoded to 'form_params', and -F fields to 'multipart' with fopen() placeholders for @file references.
Is -k / --insecure handled?
Yes, it becomes 'verify' => false — with the reminder that you should only disable TLS verification in development.
Which Guzzle version is targeted?
The generated code uses the request() method compatible with Guzzle 6 and 7.

Privacy

This tool runs 100% in your browser. Your data is never uploaded, stored, or logged.