
Guzzle
A PHP library for sending HTTP requests to web services, both synchronously and asynchronously.
- Stars
- 23.4k
- Forks
- 2.4k
- Licence
- MIT
- Language
- PHP
- Last update
- 11 days ago
- Type
- Library
What it is
Guzzle is a PHP library that lets a PHP program send HTTP requests, such as fetching data from or posting data to a web API. It handles things like query strings, JSON bodies, cookies, and large uploads or downloads through one interface. Developers use it so they don't have to write low-level request code themselves.
- Fetch a JSON record from a third-party API and read the status code and body
- Upload large files as streams without loading them fully into memory
- Send several HTTP requests asynchronously using the same interface
- Add custom middleware to log, retry, or modify requests and responses
Great for
- PHP developers who need to call external REST or web service APIs
- Projects that want synchronous and asynchronous requests through the same interface
- Teams that want code not tied to a specific transport like cURL or PHP streams
- Developers who want to extend request behavior with middleware
Not ideal for
- Non-PHP projects, since it only runs in PHP (it requires PHP 7.4 or later for version 8.3)
- People who only need a browser-based tool or a command-line HTTP client with no coding
- Projects on very old PHP versions, because support depends on the version table in the README
How to get it
- 1
Install with a package manager
You'll need: PHP 7.4 or later (for version 8.3) · Composer
Install with Composer
composer require guzzlehttp/guzzle - 2
Run it
- Install Guzzle with Composer using the command above
- Create a client with $client = new \GuzzleHttp\Client();
- Send a request with $client->request('GET', url)
- Read the status code and body from the returned response
- 3
Get the most out of it
- Read the Request Options doc to control headers, timeouts and other request settings
- Use the Middleware doc to add custom behavior to every request
- Use the Testing Guzzle Clients doc to test code that makes HTTP calls
- Check the Uploading Data and Cookies docs for those specific features
Downloads
Strengths
- Supports both synchronous and asynchronous requests with one interface
- Uses PSR-7 and PSR-18 standards, so it works with other compatible libraries
- Has a documented middleware system for extending behavior
Trade-offs
- Requires PHP and Composer, so it is not useful for non-PHP projects
- The README is truncated here, so detailed API behavior must be checked in the linked docs
- Version support differs by release, so older PHP projects may need an older Guzzle line
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| guzzle (this) | 23.4k | Library | intermediate | 11 days ago | PHP developers who need to call external REST or web service APIs |
| Slim | 12.3k | Framework | intermediate | 5 days ago | PHP developers who want a lightweight alternative to a full-stack framework |
| monolog | 21.4k | Library | intermediate | 5 days ago | PHP developers who need structured logs from an application |
| got | 15k | Library | beginner | 7 days ago | Node.js developers who call web APIs from server-side code |
| flysystem | 13.6k | Library | intermediate | 1 months ago | PHP developers who need to store files in more than one place |
| uuid | 12.6k | Library | beginner | 2 months ago | PHP developers who need unique IDs for database records or API objects |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.