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 is https://brickset.com/api/v3.asmx. Methods are invoked using the format https://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 with get are used to retrieve data. Those beginning with set are used to make changes to a user's collection information.

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


Methods

You can click on a method name to test it.

General methods

Method Parameters Output

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

Method Parameters Output

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

Method Parameters Output

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

Method Parameters Output

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.
Parameter Notes
setID Internal SetID
query Search 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
owned Set to 1 to retrieve a user's owned sets
wanted Set to 1 to retrieve a user's wanted sets
updatedSince yyyy-mm-dd format
orderBy Sort 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.
pageSize Specify how many records to retrieve (default: 20, max: 500)
pageNumber Specify which page of records to retrieve, use in conjunction with pageSize (default: 1)
extendedData Set to 1 to retrieve the full data set, including tags, description and notes.

setCollection

Parameter Notes
own 1 or 0. If 0 then qtyOwned is automatically set to 0
want 1 or 0
qtyOwned 0-999. If > 0 then own is automatically set to 1
notes User notes, max 1000 characters
rating User rating 1-5

getMinifigCollection

Parameter Notes
owned Set to 1 to retrieve minifigs owned
wanted Set to 1 to retrieve minifigs wanted
query This can be a minifig number or name. Wildcards are added before and after. If omitted, all minifigs owned are returned.

setMinifigCollection

Parameter Notes
own 1 or 0. If 0 then qtyOwned is automatically set to 0
want 1 or 0
qtyOwned 0-999. If > 0 then own is automatically set to 1
notes User 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 DateTime
End Class

Class LEGOCom
    Public US As New LEGOComDetails
    Public UK As New LEGOComDetails
    Public CA As New LEGOComDetails
    Public DE As New LEGOComDetails
End Class

Class LEGOComDetails
    Public retailPrice As Decimal?
    Public dateFirstAvailable As DateTime?
    Public dateLastAvailable As DateTime?
End Class

Class dimensions
    Public height As Single?
    Public width As Single?
    Public depth As Single?
    Public weight As Single?
End Class

Class modelDimensions
    Public dimension1 As Single?
    Public dimension2 As Single?
    Public dimension3 As Single?
End Class

Class extendedData
    Public notes As String
    Public tags() As String
    Public description As String
End Class

Class collection
    Public owned As Boolean?
    Public wanted As Boolean?
    Public qtyOwned As Integer?
    Public rating As Integer?
    Public notes As String
End Class

Class collections
    Public ownedBy As Integer?
    Public wantedBy As Integer?
End Class

Class barcodes
    Public EAN As String
    Public UPC As String
End Class

Class itemNumbers
     Public NA As String
     Public EU As String
End Class

Class ageRange
    Public min As Integer?
    Public max As Integer?
End Class

Class image
    Public thumbnailURL As String
    Public imageURL As String
End Class

Other classes

Class rating
    Public overall As Integer
    Public parts As Integer
    Public buildingExperience As Integer
    Public playability As Integer
    Public valueForMoney As Integer
End Class

Class reviews
    Public author As String
    Public datePosted As Date
    Public rating As rating
    Public title As String
    Public review As String
    Public HTML As Boolean
End Class

Class 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 Boolean
End Class

Class themes
    Public theme As String
    Public setCount As Integer
    Public subthemeCount As Integer
    Public yearFrom As Integer
    Public yearTo As Integer
End Class

Class subthemes
    Public theme As String
    Public subtheme As String
    Public setCount As Integer
    Public yearFrom As Integer
    Public yearTo As Integer
End Class

Class years
    Public theme As String
    Public year As String
    Public setCount As Integer
End Class

Class instructions
    Public URL As String
    Public description As String
End Class

Class userNotes
    Public setID As Integer
    Public notes As String
End Class

Class userMinifigNotes 
    Public minifigNumber As String
    Public notes As String
End Class

Class apiKeyUsage
    Public dateStamp As Date
    Public count As Integer
End Class



Change log

Date Version Change
23 March 2020 0.1 First version of APi v3
30 March 2020 0.2 Various changes in response to user feedback
1 April 2020 0.3 getYears 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 2020 0.4 Extensive reorganisation of the sets class
userNotes.userNotes renamed userNotes.notes
14 April 2020 0.5 Additional error codes returned from getSets. 0 matching records now returns success.
15 April 2020 0.6 Number of matches returned by all getXXX methods, and 'No matches' error removed ('matches':0 in such cases now).
16 April 2020 0.7 apiKeyUsage method added.
04 May 2020 0.8 name and category added to minifigCollection class.
01 June 2020 1.0 API now stable and complete. No major changes anticipated.
20 July 2020 1.01 getReviews added.
23 Sept 2020 1.02 getUserMinifigureNotes added and notes parameter added to setMinifigureCollection.
02 Oct 2020 1.03 setCollection and setMinifigCollection, max notes length increased to 1000
04 Feb 2021 1.04 getInstructions2 added for specific use case
03 June 2025 1.05 modelDimensions and itemNumber added to sets
Return to home page ยป