BoardGameGeek.com API client
npm install bgg

A modern BoardGameGeek.com API client for Node.js.
Supports the BGG XML API2.
``bash`
npm install bgg
Requires Node.js 18+ (uses native fetch).
`javascript
import createClient from 'bgg';
const bgg = createClient({
timeout: 10000, // 10s timeout (default: 10s)
retries: 2 // retry failed requests (default: 0)
});
// Get user info
const user = await bgg('user', { name: 'monteslu', guilds: 1 });
console.log(user);
// Search for games
const results = await bgg('search', { query: 'catan', type: 'boardgame' });
console.log(results);
// Get game details
const game = await bgg('thing', { id: 13, stats: 1 });
console.log(game);
`
`javascript`
const createClient = require('bgg').default;
const bgg = createClient();
Creates a BGG API client.
Options:
- timeout (number) - Request timeout in ms (default: 10000)retries
- (number) - Number of retry attempts (default: 0)
Makes a request to the BGG XML API2.
Endpoints: thing, family, search, collection, user, plays, guild, forum, thread, hot, etc.
See BGG XML API2 docs for all endpoints and parameters.
- Now requires Node.js 18+ (uses native fetch)
- ES modules by default (use .default for CommonJS)xml2json
- Replaced with fast-xml-parser (no native dependencies)rest
- Removed library dependencyretries: number`)
- Simplified retry config (just
- bgg-sdk - TypeScript SDK with typed responses
MIT