Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🍺 An Open Brewery DB API client for PHP.

License

NotificationsYou must be signed in to change notification settings

JoeyMckenzie/openbrewerydb-php-client

Repository files navigation

Logo

(Un)official PHP bindings for theOpen Brewery DB API. Open Brewery DB provides a publicdataset for breweries around the world, as well as offering an API to retrieve data in various forms. This library aims toprovide straight and easy-to-use PHP bindings for querying the API. The library is inspired by theOpen AI client for PHP - please give it star as well!

To get started, first install the package with composer:

$ composer require joeymckenzie/openbrewerydb-php-client

Next, spin up a new client within your code and fire away!

<?phpdeclare(strict_types=1);require_once__DIR__.'/../vendor/autoload.php';useOpenBreweryDb\OpenBreweryDb;$client = OpenBreweryDb::client();// Get a list of breweries, based on all types of different search criteria$breweries =$client->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 composerdependencies. You are free to use the HTTP client of you choice, though a popular packageisGuzzle.

Though I am not affiliated with organization itself, check out the entire set of APIs offered by Open Brewery DB, checkout the docs on theirwebsite.

About

🍺 An Open Brewery DB API client for PHP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp