jan-wennrich/bgg-api

BoardGameGeek.com API Client Library

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 12

pkg:composer/jan-wennrich/bgg-api

dev-master 2025-12-31 00:18 UTC

This package is auto-updated.

Last update: 2025-12-31 00:23:02 UTC


README

PHP API Client Library for the BoardGameGeek.com API.

(Only the BGG XML API2 is currently supported)

Installation

composer require jan-wennrich/bgg-api

Usage

// initialize client
$client = new \JanWennrich\BoardGameGeekApi\Client();

// download information about "Dixit"
// https://boardgamegeek.com/boardgame/39856/dixit
$thing = $client->getThing(39856, true);

var_dump($thing->getName());
var_dump($thing->getYearPublished());
var_dump($thing->getBoardgameCategories());
var_dump($thing->getRatingAverage());
// ...

// download information about user
// https://boardgamegeek.com/user/Nataniel
$user = $client->getUser('nataniel');

var_dump($user->getAvatar());
var_dump($user->getCountry());

// search for a game
$results = $client->search('Domek');
echo count($results);

$things = [];
foreach ($result as $item) {
    var_dump($item->getName());
    $things[] = $client->getThing($item->getId());
}

Credits

This is a fork of castro732/bggxmlapi2 which is a fork of nataniel/bggxmlapi2.