Skip to content

Repository files navigation

SA.Automate.Brickset

Downloads NuGet GitHub license

Brickset connection types and actions for Umbraco Automate. Look up and search LEGO sets as part of an automation workflow.

What is Brickset?

Brickset is a database of LEGO sets, providing details such as pieces, minifigs, theme, pricing, and images, looked up by set number or free-text search.

What can this be used for?

This package is useful when you want LEGO set data inside an Umbraco Automate workflow, for example:

  • Enriching content: pull set details (name, image, piece count) into content as part of an automation.
  • Conditional content: branch a workflow based on a set's theme, year, or availability.
  • Logging/reporting: record set data alongside other workflow data.

Installation

dotnet add package SA.Automate.Brickset

No further setup required. The composer registers itself automatically via Umbraco's IComposer discovery.

Connection types

This package registers a single Brickset connection type:

  • API Key: required. The Brickset API key used by this connection.

Setup

1. Get an API key

Get an API key from brickset.com.

2. Store the key in appsettings.json (optional)

The connection's API Key field is marked sensitive, so instead of entering the key directly in the backoffice you can store it in appsettings.json and reference it using Umbraco Automate's configuration reference syntax:

{
  "Umbraco": {
    "Automate": {
      "Secrets": {
        "BricksetApiKey": "your-api-key"
      }
    }
  }
}

The API Key field already defaults to $Umbraco:Automate:Secrets:BricksetApiKey, so once this is set you can leave the field as-is when creating the connection below — no need to paste the reference in manually.

3. Create the connection in the backoffice

  1. Go to Automate → Connections and create a new Brickset connection.
  2. Give the connection a name and enter your API Key — either the key itself, or, if you stored it in appsettings.json above, the reference $Umbraco:Automate:Secrets:BricksetApiKey (the field's default value).
  3. Click Test connection to verify. This requests a well-known set to confirm the API key is valid.

Usage

Get Set By Number

Add the Get Set By Number action to any automation and select the connection to use. Available fields:

Field Description
Set Number The LEGO set number to look up, e.g. 71043 or 71043-1. If no variant suffix (e.g. -1) is given, -1 is assumed. Supports ${ binding } expressions.

The action outputs the following, which can be referenced via bindings in later workflow steps:

Output Description
SetId Brickset's internal numeric ID for the set.
Name The set's name, e.g. "Millennium Falcon".
SetNumber The resolved set number including variant suffix, e.g. "71043-1".
Year The year the set was released.
Theme The theme, e.g. "Star Wars".
Subtheme The subtheme, e.g. "Ultimate Collector Series".
Pieces The number of pieces in the set.
Minifigs The number of minifigs included in the set.
ImageUrl The URL of the full-size set image.
ThumbnailUrl The URL of the thumbnail set image.
BricksetUrl The URL of the set's page on Brickset.
Rating The average user rating for the set.
ReviewCount The number of user reviews for the set.
PackagingType The packaging type, e.g. "Box".
Availability The set's availability, e.g. "Retail".
InstructionsCount The number of instructions available for the set.
AgeMin The minimum recommended age for the set.
AgeMax The maximum recommended age for the set.
DimensionsHeight The packaging height in centimetres.
DimensionsWidth The packaging width in centimetres.
DimensionsDepth The packaging depth in centimetres.
DimensionsWeight The packaging weight in grams.
Ean The set's EAN barcode.
Upc The set's UPC barcode.
RetailPriceUs The US retail price in USD, as reported by LEGO.com.
RetailPriceUk The UK retail price in GBP, as reported by LEGO.com.
RetailPriceCa The Canadian retail price in CAD, as reported by LEGO.com.
RetailPriceDe The German retail price in EUR, as reported by LEGO.com.
LastUpdated When Brickset's data for this set was last updated.
RawResponse The full, unprocessed JSON response returned by the Brickset API.

Search Sets

Add the Search Sets action to any automation and select the connection to use. Available fields:

Field Description
Query Optional. Free-text search, e.g. a set name. Supports ${ binding } expressions. At least one of Query, Theme, or Year is required.
Theme Optional. Filters by theme, e.g. "Star Wars". Supports ${ binding } expressions. At least one of Query, Theme, or Year is required.
Year Optional. Filters by release year, e.g. 2023. Supports ${ binding } expressions. At least one of Query, Theme, or Year is required.
Page Size Optional. The maximum number of results to return. Defaults to 20. Supports ${ binding } expressions.

The action outputs the following, which can be referenced via bindings in later workflow steps:

Output Description
MatchCount The total number of sets matching the search, as reported by Brickset (may exceed the page size).
Sets The page of matching sets returned, summarised (SetNumber, Name, Year, Theme, Subtheme, Pieces, Minifigs, ThumbnailUrl, BricksetUrl, Rating, RetailPriceUs, RetailPriceUk, RetailPriceCa, RetailPriceDe).
RawResponse The full, unprocessed JSON response returned by the Brickset API.

Save Set To Content

Add the Save Set To Content action to any automation. Writes fields from a Brickset set lookup onto a content item's properties (a draft save) — combine with a Publish Content step in a subsequent step to publish the result. Requires the Umb.Document.Update permission and the content section.

Each field below is optional (other than Content Key) and writes to a hardcoded property alias on the target content item — a field with a supplied value is silently skipped if the content type doesn't have the matching property, so you only need to add the properties for the fields you actually use.

Field Writes to property alias Description
Content Key Required. The key (GUID) of the content item to update. Supports ${ binding } expressions.
Node Name Optional. When supplied, renames the content item itself (its node name), independent of the Name field below. Supports ${ binding } expressions.
Set Id bricksetSetId Brickset's internal numeric ID for the set.
Name bricksetName The set's name, e.g. "Millennium Falcon".
Set Number bricksetSetNumber The resolved set number including variant suffix, e.g. "71043-1".
Year bricksetYear The year the set was released.
Theme bricksetTheme The theme, e.g. "Star Wars".
Subtheme bricksetSubtheme The subtheme, e.g. "Ultimate Collector Series".
Pieces bricksetPieces The number of pieces in the set.
Minifigs bricksetMinifigs The number of minifigs included in the set.
Image Url bricksetImageUrl The URL of the full-size set image.
Thumbnail Url bricksetThumbnailUrl The URL of the thumbnail set image.
Brickset Url bricksetUrl The URL of the set's page on Brickset.
Rating bricksetRating The average user rating for the set.
Review Count bricksetReviewCount The number of user reviews for the set.
Packaging Type bricksetPackagingType The packaging type, e.g. "Box".
Availability bricksetAvailability The set's availability, e.g. "Retail".
Instructions Count bricksetInstructionsCount The number of instructions available for the set.
Age Min bricksetAgeMin The minimum recommended age for the set.
Age Max bricksetAgeMax The maximum recommended age for the set.
Dimensions Height bricksetDimensionsHeight The packaging height in centimetres.
Dimensions Width bricksetDimensionsWidth The packaging width in centimetres.
Dimensions Depth bricksetDimensionsDepth The packaging depth in centimetres.
Dimensions Weight bricksetDimensionsWeight The packaging weight in grams.
Ean bricksetEan The set's EAN barcode.
Upc bricksetUpc The set's UPC barcode.
Retail Price (US) bricksetRetailPriceUs The US retail price in USD, as reported by LEGO.com.
Retail Price (UK) bricksetRetailPriceUk The UK retail price in GBP, as reported by LEGO.com.
Retail Price (CA) bricksetRetailPriceCa The Canadian retail price in CAD, as reported by LEGO.com.
Retail Price (DE) bricksetRetailPriceDe The German retail price in EUR, as reported by LEGO.com.
Last Updated bricksetLastUpdated When Brickset's data for this set was last updated.
Product Description bricksetProductDescription Optional free-text product description, not part of Brickset's API output — typically bound from an expression composed of the other fields. Writes to a rich-text-editor property.
Culture Optional. Culture code (e.g. en-US) for variant content. Leave blank for invariant. Applies to every property written by this action.
Segment Optional. Segment for segmented content. Leave blank for the default segment. Applies to every property written by this action.

All fields above support ${ binding } expressions.

The action outputs the following, which can be referenced via bindings in later workflow steps:

Output Description
ContentKey The key of the content item that was targeted.
Culture The culture that was targeted (null for invariant).
Segment The segment that was targeted (null for the default segment).
UpdatedPropertyAliases The hardcoded property aliases that were actually written (only fields with a supplied value are included).
SkippedPropertyAliases The hardcoded property aliases that had a supplied value but were skipped because the content type doesn't have that property.
NodeNameUpdated Whether the content item's node name was changed.

If the content item does not exist, the action completes with a notFound outcome instead of failing.

Compatibility

Package version Umbraco Automate Umbraco CMS
1.x 17.x – 18.x 17.x – 18.x

Links

About

Use this with Umbraco.Automate so you can get LEGO data from the Brickset API

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages