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 |
checkKeyCheck if an API key is valid. |
|
|
loginLog in as a user and retrieve a token that can be used in subsequent API calls. |
|
|
checkUserHashCheck if a userHash key is valid. |
|
|
getKeyUsageStatsGet key usage stats for the last 30 days. Note that only calls to the getSets method count against key usage. |
|
|
Sets |
||
| Method | Parameters | Output |
getSetsRetrieve a list of sets, or more information about a particular one. |
|
|
getAdditionalImagesGet a list of URLs of additional set images for the specified set. |
|
|
getInstructionsGet a list of instructions for the specified set. |
|
|
getInstructions2Get a list of instructions for the specified set without the need to look up the set ID first. |
|
|
getReviewsGet user reviews for the specified set. |
|
|
getThemesGet a list of themes, with the total number of sets in each. |
|
|
getSubthemesGet a list of subthemes for a given theme, with the total number of sets in each. |
|
|
getYearsGet a list of years for a given theme, with the total number of sets in each. |
|
|
Set collection management |
||
| Method | Parameters | Output |
setCollectionSet a user's collection details. |
|
|
getUserNotesGet all of a user's set notes. |
|
|
Minifig collection management |
||
| Method | Parameters | Output |
getMinifigCollectionGet a list of minifigs owned/wanted by a user. |
|
|
setMinifigCollectionAdd/change a user's 'loose' minifig collection. Note: due to the way this method works pass either own/want/qtyowned OR notes |
|
|
getUserMinifigNotesGet all of a user's minifigure notes. |
|
|
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 |
17 likes