https://github.com/joeymckenzie/openbrewerydb-php-client
🍺 An Open Brewery DB API client for PHP.
https://github.com/joeymckenzie/openbrewerydb-php-client
beer openbrewerydb php
Last synced: 2 months ago
JSON representation
🍺 An Open Brewery DB API client for PHP.
- Host: GitHub
- URL: https://github.com/joeymckenzie/openbrewerydb-php-client
- Owner: JoeyMckenzie
- License: mit
- Created: 2024-01-23T05:16:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-25T17:30:34.000Z (over 1 year ago)
- Last Synced: 2025-07-29T19:40:43.751Z (3 months ago)
- Topics: beer, openbrewerydb, php
- Language: PHP
- Homepage: https://openbrewerydb.org/
- Size: 30.7 MB
- Stars: 19
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README

![]()
![]()
(Un)official PHP bindings for the [Open Brewery DB API](https://openbrewerydb.org/). Open Brewery DB provides a public
dataset for breweries around the world, as well as offering an API to retrieve data in various forms. This library aims to
provide straight and easy-to-use PHP bindings for querying the API. The library is inspired by the [Open AI client for PHP](https://github.com/openai-php/client) - please give it star as well!To get started, first install the package with composer:
```shell
$ composer require joeymckenzie/openbrewerydb-php-client
```Next, spin up a new client within your code and fire away!
```php
breweries()->list([
'by_city' => 'Sacramento',
]);
var_dump($breweries);// Retrieve various metadata about breweries from the API
$metadata = $client->breweries()->metadata();
var_dump($metadata);// Get a random brewery with a specified page size
$randomBrewery = $client->breweries()->random(5);
var_dump($randomBrewery);
```The library relies on autodiscovery and will use whichever package that implements PSR-17 within your composer
dependencies. You are free to use the HTTP client of you choice, though a popular package
is [Guzzle](https://docs.guzzlephp.org/en/stable/).Though I am not affiliated with organization itself, check out the entire set of APIs offered by Open Brewery DB, check
out the docs on their [website](https://openbrewerydb.org/documentation).