Discussion Forum: Thread 369752

 Author: EricCochran View Messages Posted By EricCochran
 Posted: May 12, 2025 19:42
 Subject: API: Getting item details in one request?
 Viewed: 112 times
 Topic: Help
 Report:
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

EricCochran (1)

Location:  USA, Georgia
Member Since Contact Type Status
Apr 4, 2025 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store Closed Store: Eric
Is there a way to get the parts list of a Lego set without needing to make dozens
of API requests?

For example, as I see from the documentation, to get the parts for set 8360-1,
I need to hit
https://api.bricklink.com/api/store/v1/items/SET/8360-1/subsets
then I need to hit
https://api.bricklink.com/api/store/v1/items/PART/{part number}/images/{color
id}
for each part that the first API call returns in its array. This could add up
to hitting the API rate limit for my access token really fast.

Is there an API like https://api.bricklink.com/api/store/v1/items/SET/8360-1/subsets
but that returns the item details like the image url for each part in its payload
to avoid making dozens of API calls per set?
 Author: EricCochran View Messages Posted By EricCochran
 Posted: May 12, 2025 22:02
 Subject: Re: API: Getting item details in one request?
 Viewed: 67 times
 Topic: Help
 Report:
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

EricCochran (1)

Location:  USA, Georgia
Member Since Contact Type Status
Apr 4, 2025 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store Closed Store: Eric
In case anyone comes across this, I'm going to assume the image URL structures
never change and construct the image URLs myself instead of hitting the images
endpoint dozens of times to get the image URLs.

https://img.bricklink.com/ItemImage/PN/{color_id}/{no}.png

In Help, EricCochran writes:
  Is there a way to get the parts list of a Lego set without needing to make dozens
of API requests?

For example, as I see from the documentation, to get the parts for set 8360-1,
I need to hit
https://api.bricklink.com/api/store/v1/items/SET/8360-1/subsets
then I need to hit
https://api.bricklink.com/api/store/v1/items/PART/{part number}/images/{color
id}
for each part that the first API call returns in its array. This could add up
to hitting the API rate limit for my access token really fast.

Is there an API like https://api.bricklink.com/api/store/v1/items/SET/8360-1/subsets
but that returns the item details like the image url for each part in its payload
to avoid making dozens of API calls per set?
 Author: v100Bricks View Messages Posted By v100Bricks
 Posted: May 13, 2025 04:24
 Subject: Re: API: Getting item details in one request?
 Viewed: 66 times
 Topic: Help
 Report:
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

v100Bricks (436)

Location:  United Kingdom, Scotland
Member Since Contact Type Status
Aug 31, 2023 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: v100Bricks
I have been using the logic:
'https://img.bricklink.com/ItemImage/PN/'+itemColour+'/'+itemNo+'.png'
and
'https://img.bricklink.com/PL/'+itemNo+'.jpg' when i don't
specificaly have a colour to display.

This has worked for the last year or so without a problem.
It also works for other Item Types by changing the PL to:
SN for Sets
ML for Minfigs
BL for BOOK
GL for GEAR
C for CATALOG
IL for INSTRUCTION
OL for ORIGINAL_BOX
 Author: EricCochran View Messages Posted By EricCochran
 Posted: May 13, 2025 23:46
 Subject: Re: API: Getting item details in one request?
 Viewed: 58 times
 Topic: Help
 Report:
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

EricCochran (1)

Location:  USA, Georgia
Member Since Contact Type Status
Apr 4, 2025 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store Closed Store: Eric
Thanks. Yeah, I'm now doing exactly that for all my images.

In Help, v100Bricks writes:
  I have been using the logic:
'https://img.bricklink.com/ItemImage/PN/'+itemColour+'/'+itemNo+'.png'
and
'https://img.bricklink.com/PL/'+itemNo+'.jpg' when i don't
specificaly have a colour to display.

This has worked for the last year or so without a problem.
It also works for other Item Types by changing the PL to:
SN for Sets
ML for Minfigs
BL for BOOK
GL for GEAR
C for CATALOG
IL for INSTRUCTION
OL for ORIGINAL_BOX
 Author: yensid View Messages Posted By yensid
 Posted: May 22, 2025 02:00
 Subject: Re: API: Getting item details in one request?
 Viewed: 61 times
 Topic: Help
 Report:
Cancel Message
Cancel
Reply to Message
Reply
BrickLink
ID Card

yensid (253)

Location:  USA, California
Member Since Contact Type Status
Aug 8, 2019 Contact Member Seller
Buying Privileges - OKSelling Privileges - OK
Store: Yensid Bricks
I'm not sure how your system is built, but if it is relational, you can download
the catalog, then relate to it via item type and number. This will give you
most the details you are looking for.

Catalog Download: https://www.bricklink.com/catalogDownload.asp

The way you list is the only way I know of doing it without the catalog downloaded.
Don't worry about the API call limit. on a busy day on inputting, the system
I built blows past the call limit and I have never been shut off. I suspect
it is there to reference if they have someone abusing or spamming the API. I
will regularly get a bunch of subset lists, get the details and then get the
pricing for each item and not had any issues.

Mike


In Help, EricCochran writes:
  Is there a way to get the parts list of a Lego set without needing to make dozens
of API requests?

For example, as I see from the documentation, to get the parts for set 8360-1,
I need to hit
https://api.bricklink.com/api/store/v1/items/SET/8360-1/subsets
then I need to hit
https://api.bricklink.com/api/store/v1/items/PART/{part number}/images/{color
id}
for each part that the first API call returns in its array. This could add up
to hitting the API rate limit for my access token really fast.

Is there an API like https://api.bricklink.com/api/store/v1/items/SET/8360-1/subsets
but that returns the item details like the image url for each part in its payload
to avoid making dozens of API calls per set?