API version 3 documentation

The API provides a robust means of interfacing with Brickset and now provides responses in JSON making it much easier to use and integrate into your application.


Accessing the API

The API endpoint ishttps://brickset.com/api/v3.asmx. Methods are invoked using the formathttps://brickset.com/api/v3.asmx/{method}, e.g.https://brickset.com/api/v3.asmx/getSets.

Parameters can be specified on the URL (e.g. GET) or POSTed but in some cases they'll need to be POSTed due to restrictions on URL length and allowed characters in them.

Methods beginning withget are used to retrieve data. Those beginning withset are used to make changes to a user's collection information.

All methods require a valid API key to be passed, which can be obtainedhere.


Methods

You can click on a method name to test it.

General methods

MethodParametersOutput

checkKey

Check if an API key is valid.

apiKey
API key
Valid
{" & "status":"success" & "}
Invalid
{"status":"error", "message":"Invalid API key"}

login

Log in as a user and retrieve a token that can be used in subsequent API calls.

apiKey
API key
username
A Brickset username
password
A Brickset password
Valid
{"status":"success" , "hash":"<whatever>"}
Invalid
{"status":"error", "message": "Invalid username or password"}
Invalid API key
{"status":"error", "message":"Invalid API key"}

checkUserHash

Check if a userHash key is valid.

apiKey
API key
userHash
User hash retreived by the login method
Valid
{" & "status":"success" & "}
Invalid
{"status":"error", "message":"Invalid user hash"}
Invalid API key
{"status":"error", "message":"Invalid API key"}

getKeyUsageStats

Get key usage stats for the last 30 days. Note that only calls to the getSets method count against key usage.

apiKey
API key
Success
{"status":"success","matches":<n>,"apiKeyUsage":[<data>]}
Invalid API key
{"status":"error", "message":"Invalid API key"}

Sets

MethodParametersOutput

getSets

Retrieve a list of sets, or more information about a particular one.

apiKey
API key
userHash
Optional. Used only in conjunction with owned/wanted.
params
JSON string of search parameters and options. See below.
Success
{"status":"success","matches":<n>,"sets":[<data>]}
Invalid userHash
{"status":"error", "message":"Invalid user hash"}
Invalid API key
{"status":"error", "message":"Invalid API key"}
Parameter error
{"status":"error", "message":"Parameter error"}
No valid parameters
{"status":"error", "message":"No valid parameters"}
Daily API limit exceeded
{"status":"error", "message":"API limit exceeded"}

getAdditionalImages

Get a list of URLs of additional set images for the specified set.

apiKey
API key
setID
Set ID
Success
{"status":"success","matches":<n>,"additionalImages":[<data>]}
Invalid API key
{"status":"error", "message":"Invalid API key"}

getInstructions

Get a list of instructions for the specified set.

apiKey
API key
setID
Set ID
Success
{"status":"success","matches":<n>,"instructions":[<data>]}
Invalid API key
{"status":"error", "message":"Invalid API key"}

getInstructions2

Get a list of instructions for the specified set without the need to look up the set ID first.

apiKey
API key
setNumber
Set number
Success
{"status":"success","matches":<n>,"instructions":[<data>]}
Invalid API key
{"status":"error", "message":"Invalid API key"}

getReviews

Get user reviews for the specified set.

apiKey
API key
setID
Set ID
Success
{"status":"success","matches":<n>,"reviews":[<data>]}
Invalid API key
{"status":"error", "message":"Invalid API key"}

getThemes

Get a list of themes, with the total number of sets in each.

apiKey
API key
Success
{"status":"success","matches":<n>,"themes":[<data>]}
Invalid API key
{"status":"error", "message":"Invalid API key"}

getSubthemes

Get a list of subthemes for a given theme, with the total number of sets in each.

apiKey
API key
Theme
Theme
Success
{"status":"success","matches":<n>,"subthemes":[<data>]}
Invalid API key
{"status":"error", "message":"Invalid API key"}

getYears

Get a list of years for a given theme, with the total number of sets in each.

apiKey
API key
Theme
Theme. Leave blank to get totals for all sets.
Success
{"status":"success","matches":<n>,"years":[<data>]}
Invalid API key
{"status":"error", "message":"Invalid API key"}

Set collection management

MethodParametersOutput

setCollection

Set a user's collection details.

apiKey
API key
userHash
userHash token
setID
Set ID
params
JSON string of parameters and options. See below.
Success
{" & "status":"success" & "}
Invalid userHash
{"status":"error", "message":"Invalid user hash"}
Invalid API key
{"status":"error", "message":"Invalid API key"}
Invalid/missing parameters
{"status":"error", "message":"Parameter error"}

getUserNotes

Get all of a user's set notes.

apiKey
API key
userHash
userHash token
Success
{"status":"success","matches":<n>,"userNotes":[<data>]}
Invalid API key
{"status":"error", "message":"Invalid API key"}

Minifig collection management

MethodParametersOutput

getMinifigCollection

Get a list of minifigs owned/wanted by a user.

apiKey
API key
userHash
userHash token
params
JSON string of parameters and options. See below.
Success
{"status":"success","matches":<n>,"minifigs":[<data>]}
Invalid userHash
{"status":"error", "message":"Invalid user hash"}
Invalid API key
{"status":"error", "message":"Invalid API key"}
Invalid/missing parameters
{"status":"error", "message":"Parameter error"}

setMinifigCollection

Add/change a user's 'loose' minifig collection.

Note: due to the way this method works pass either own/want/qtyowned OR notes

apiKey
API key
userHash
userHash token
minifigNumber
BrickLink minifig number
params
JSON string of parameters and options. See below.
Success
{" & "status":"success" & "}
Invalid userHash
{"status":"error", "message":"Invalid user hash"}
Invalid API key
{"status":"error", "message":"Invalid API key"}
Invalid/missing parameters
{"status":"error", "message":"Parameter error"}

getUserMinifigNotes

Get all of a user's minifigure notes.

apiKey
API key
userHash
userHash token
Success
{"status":"success","matches":<n>,"userMinifigNotes":[<data>]}
Invalid API key
{"status":"error", "message":"Invalid API key"}


JSON parameters

Parameters to influence results or to specify database updates are passed as a JSON string in the format {'parameter':'value',...}.

All are optional but at least one must be used to retrieve results or make updates.

For example, for the getSets method:

  • {'theme':'space','year':'1978,1979'}
  • {'theme':'Pirates','owned':1}
  • {'year':'2020','orderBy':'Pieces','pageSize':100}
  • {'tag':'crane','theme':'Technic','extendedData':1}

getSets

Note: Parameters marked with a * will accept a Decimal value or a comma delimited list.
ParameterNotes
setIDInternal SetID
querySearch term: searches set number, name, theme and subtheme
theme*
subtheme*
setNumber* Full set number, in the format {number}-{variant}, e.g. 6876-1
year*
tag
ownedSet to 1 to retrieve a user's owned sets
wantedSet to 1 to retrieve a user's wanted sets
updatedSinceyyyy-mm-dd format
orderBySort order
Valid values are Number, YearFrom, Pieces, Minifigs, Rating, [UK|US|CA|DERetailPrice], [UK|US|CA|DEPricePerPiece], Theme, Subtheme, Name, Random, QtyOwned, OwnCount, WantCount, UserRating, CollectionID (order record added to a user's collection), Rank (search ranking)

Add 'DESC' to the end of numerical field names to sort descending, e.g. PiecesDESC. Default: Number. Values are case-insensitive.
pageSizeSpecify how many records to retrieve (default: 20, max: 500)
pageNumberSpecify which page of records to retrieve, use in conjunction with pageSize (default: 1)
extendedDataSet to 1 to retrieve the full data set, including tags, description and notes.

setCollection

ParameterNotes
own1 or 0. If 0 then qtyOwned is automatically set to 0
want1 or 0
qtyOwned0-999. If > 0 then own is automatically set to 1
notesUser notes, max 1000 characters
ratingUser rating 1-5

getMinifigCollection

ParameterNotes
ownedSet to 1 to retrieve minifigs owned
wantedSet to 1 to retrieve minifigs wanted
queryThis can be a minifig number or name. Wildcards are added before and after. If omitted, all minifigs owned are returned.

setMinifigCollection

ParameterNotes
own1 or 0. If 0 then qtyOwned is automatically set to 0
want1 or 0
qtyOwned0-999. If > 0 then own is automatically set to 1
notesUser notes, max 1000 characters


Class definitions

Sets

Class sets    Public setID As Integer    Public number As String    Public numberVariant As Integer    Public name As String    Public year As Integer    Public theme As String    Public themeGroup As String    Public subtheme As String    Public category As String    Public released As Boolean    Public pieces As Integer?    Public minifigs As Integer?    Public image As New image    Public bricksetURL As String    Public collection As New collection    Public collections As New collections    Public LEGOCom As New LEGOCom    Public rating As Single    Public reviewCount As integer    Public launchDate as DateTime?    Public exitDate as DateTime?    Public packagingType As String    Public availability As String    Public instructionsCount As Integer    Public additionalImageCount As Integer    Public ageRange As New ageRange    Public dimensions As New dimensions    Public modelDimensions As New modelDimensions    Public barcode As New barcodes    Public itemNumber As New itemNumbers    Public extendedData As New extendedData    Public lastUpdated As DateTimeEnd ClassClass LEGOCom    Public US As New LEGOComDetails    Public UK As New LEGOComDetails    Public CA As New LEGOComDetails    Public DE As New LEGOComDetailsEnd ClassClass LEGOComDetails    Public retailPrice As Decimal?    Public dateFirstAvailable As DateTime?    Public dateLastAvailable As DateTime?End ClassClass dimensions    Public height As Single?    Public width As Single?    Public depth As Single?    Public weight As Single?End ClassClass modelDimensions    Public dimension1 As Single?    Public dimension2 As Single?    Public dimension3 As Single?End ClassClass extendedData    Public notes As String    Public tags() As String    Public description As StringEnd ClassClass collection    Public owned As Boolean?    Public wanted As Boolean?    Public qtyOwned As Integer?    Public rating As Integer?    Public notes As StringEnd ClassClass collections    Public ownedBy As Integer?    Public wantedBy As Integer?End ClassClass barcodes    Public EAN As String    Public UPC As StringEnd ClassClass itemNumbers     Public NA As String     Public EU As StringEnd ClassClass ageRange    Public min As Integer?    Public max As Integer?End ClassClass image    Public thumbnailURL As String    Public imageURL As StringEnd Class

Other classes

Class rating    Public overall As Integer    Public parts As Integer    Public buildingExperience As Integer    Public playability As Integer    Public valueForMoney As IntegerEnd ClassClass reviews    Public author As String    Public datePosted As Date    Public rating As rating    Public title As String    Public review As String    Public HTML As BooleanEnd ClassClass minifigCollection    Public minifigNumber As String    Public name as String    Public category as String    Public ownedInSets As Integer    Public ownedLoose As Integer    Public ownedTotal As Integer    Public wanted As BooleanEnd ClassClass themes    Public theme As String    Public setCount As Integer    Public subthemeCount As Integer    Public yearFrom As Integer    Public yearTo As IntegerEnd ClassClass subthemes    Public theme As String    Public subtheme As String    Public setCount As Integer    Public yearFrom As Integer    Public yearTo As IntegerEnd ClassClass years    Public theme As String    Public year As String    Public setCount As IntegerEnd ClassClass instructions    Public URL As String    Public description As StringEnd ClassClass userNotes    Public setID As Integer    Public notes As StringEnd ClassClass userMinifigNotes     Public minifigNumber As String    Public notes As StringEnd ClassClass apiKeyUsage    Public dateStamp As Date    Public count As IntegerEnd Class


Change log

DateVersionChange
23 March 20200.1First version of APi v3
30 March 20200.2Various changes in response to user feedback
1 April 20200.3getYears modified to accept an empty theme. to return all years with totals of all sets released
tag added as a parameter to getSets
extendedData added as a parameter to getSets
5 April 20200.4Extensive reorganisation of the sets class
userNotes.userNotes renamed userNotes.notes
14 April 20200.5Additional error codes returned from getSets. 0 matching records now returns success.
15 April 20200.6Number of matches returned by all getXXX methods, and 'No matches' error removed ('matches':0 in such cases now).
16 April 20200.7apiKeyUsage method added.
04 May 20200.8name and category added to minifigCollection class.
01 June 20201.0API now stable and complete. No major changes anticipated.
20 July 20201.01getReviews added.
23 Sept 20201.02getUserMinifigureNotes added and notes parameter added to setMinifigureCollection.
02 Oct 20201.03setCollection and setMinifigCollection, max notes length increased to 1000
04 Feb 20211.04getInstructions2 added for specific use case
03 June 20251.05modelDimensions and itemNumber added to sets

17 likes

Return to home page »