Skip to content

e-amzallag/bricksetapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Brickset API

Maven Central

Java API for Brickset webservices API v3.

See https://brickset.com/article/52666/brickset-web-services for more information about the official Brickset API

Support all methods (version 1.04, 04 Feb 2021):

  • General
  • Sets
  • Set collection management
  • Minifig collection management

Basic cases

Create an instance:

IBricksetService service = new BricksetServiceImpl("myApiKey");

Retrieve the userhash if not already known and if needed:

try {
	String userhash = service.login("mylogin", "mypwd");
	// You may check the userhash
	service.checkUserHash(userhash);
	.
	.
	.
} catch (BricksetException e) {
	System.err.println(e.getCodeMessage() + ": " + e.getMessage());
}

Looking for a particular set:

SetParameters params = new SetParameters();
// Look for set number 60132
params.addSetNumber("60132-1");
List<Set> sets = service.getSets(params);
if (!sets.isEmpty()) {
	Set set = sets.get(0);
} 

Using different criterias to query:

SetParameters params = new SetParameters();
// Look for all the sets in themes Architecture and Classic, year 2020, ordered by number of pieces desc.
params.addTheme("Architecture").addTheme("Classic").addYear("2020").setOrderBy(OrderByEnum.PiecesDESC);
List<Set> sets = service.getSets(params);

Check IBricksetService to see the full list of methods, including collection management.

Unit tests

To run the tests, you need to create a parameters.properties in test resources with the following properties :

apikey=
userhash=
login=
password=

Caution, CollectionManagement tests may alter your Brickset collection. Check what you are doing before!

About

Java API for Brickset webservices API v3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages