https://github.com/marcioos/bgg-client
BoardGameGeek XML API 2 client for Java and Android apps
https://github.com/marcioos/bgg-client
android android-apps api-client bgg bgg-client bgg-library board-game boardgamegeek boardgames java library
Last synced: 3 months ago
JSON representation
BoardGameGeek XML API 2 client for Java and Android apps
- Host: GitHub
- URL: https://github.com/marcioos/bgg-client
- Owner: marcioos
- Created: 2013-11-07T17:46:46.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2020-04-18T21:42:24.000Z (about 6 years ago)
- Last Synced: 2023-08-09T13:38:24.541Z (over 2 years ago)
- Topics: android, android-apps, api-client, bgg, bgg-client, bgg-library, board-game, boardgamegeek, boardgames, java, library
- Language: Java
- Homepage:
- Size: 307 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bgg-client
BoardGameGeek API 2 client for Java and Android apps
## Adding the library as a dependency
**Gradle**
```
implementation 'com.github.marcioos:bgg-client:1.0'
```
**Maven**
```
com.github.marcioos
bgg-client
1.0
```
## Javadocs
http://marcioos.github.io/bgg-client/
## Using the library
There's a single class called `BGG` that exposes the 3 main client operations as static methods: `search`, `fetch` and `fetchCollection`.
### Search
Use `BGG.search` for searching items based on a free text search term and an optional list of `ThingType` (var-arg).
```java
SearchOutput searchResult = BGG.search("dominion", ThingType.BOARDGAME);
```
`SearchOutput` contains a list of `SearchItem` along with summary information on the search result. See [SearchOutput](http://marcioos.github.io/bgg-client/com/github/marcioos/bggclient/search/domain/SearchOutput.html) and [SearchItem](http://marcioos.github.io/bgg-client/com/github/marcioos/bggclient/search/domain/SearchItem.html).
### Fetch
Use `BGG.fetch` to retrieve more detailed information about specific items, looking up by their BoardGameGeek database IDs, which can be found with the `BGG.search` method above.
```java
int agricolaXDeckId = 38733;
int dieMacherId = 1;
Collection item = BGG.fetch(Arrays.asList(agricolaXDeckId, dieMacherId));
```
`FetchItem` contains most of the data available on BoardGameGeek related to an item. See [FetchItem](http://marcioos.github.io/bgg-client/com/github/marcioos/bggclient/fetch/domain/FetchItem.html).
### Fetch collection
Use `BGG.fetchCollection` for retrieving an user's collection by their username on BoardGameGeek.
```java
String username = "marcio_os";
UserCollection myCollection = BGG.fetchCollection(username);
```
See [UserCollection](http://marcioos.github.io/bgg-client/com/github/marcioos/bggclient/fetch/domain/UserCollection.html).