The API currently does not allow to retrieve shipping cost information on stores.
The API does list all the lots that are available for a specific item (../catalog/availability), but this information is somewhat meaningless without knowing the associated shipping costs.
For context, I am pretty far along in building a multi-store part buying tool (similar to BrickLinks easy-buy tool) that is able to automatically search for a cheap distribution of parts over stores. An important factor in this algorithm is the shipping cost of each store.
Suggestion #1: For each lot returned by the ../catalog/availability API endpoint add a field "shipping_cost" with the cost of shipping just a single item from that lot. This seems like a minor modification. For people using the API to find good deals on sets this may already be sufficient. For my algorithm I would prefer to have more information, I also need to know what it costs to buy multiple parts, but having a baseline like this would already be nice.
Suggestion #2: Create a new API endpoint from which all the information on a store can be retrieved, including detailed information on the shipping prices. As argument it would take a country code indicating the shipping destination. As a response it should then give a mapping from store_ids to the information on the store. The information could contain both the shipping tiers and the same store information returned by the ../catalog/availability API endpoint. As an example of what the JSON could look like see the attached example_json.txt file.
Suggestion #3: if the second suggestion is indeed followed then it would make sense to optionally remove the store information from the ../catalog/availability API endpoint. If I retrieve the lots for a couple of hundred different parts I get the same store information many times over, which is rather inefficient. An optional argument ‘store_info’ could be added that defaults to true (to not break existing code). If the argument is set to false only the store_id would be included.
Comments
Finding an optimal solution is then completely infeasible, you need to be happy with finding a 'good' solution. Over the past year I have experimented with lots of algorithms and have settled on one that seems to work pretty well (on random synthetic data). I have already integrated the real data from BrickOwl on which store is selling which lot, the only missing puzzle piece is the shipping information.
I am hoping to launch the tool with a web interface in the summer. I think it could be very beneficial to the BrickOwl community. As a side note, I am a computer science PhD student and this has been a very entertaining hobby project.
Cheaper shipping, cheaper projects,... Then I can do more projects! Ha!
I heard there used to be a tool long ago for desktop, but that doesn't work anymore. Having one on the web would be totally awesome.
For the test, I took the Fondor Haulcraft MOC: https://rebrickable.com/mocs/MOC-137520/Eventus_Engineering_System/fondor-haulcraft-ucs/#parts
I only included stores within the EU, with shipping to The Netherlands.
These are the game changing results:
BrickLink: E 744,49
BrickOwl (picking biggest stores): E 719,88
My tool, with BrickOwl data: E 512,70 !!! That's E 200 less, 30% cheaper!!
For those interested, here are more detailed results:
Bricklink comes up with a selection costing 744,49 euros (including shipping and handling).
Using the BrickOwl store selection tool and picking the store with the most needed lots each time gets me a selection costing 709,88 euros and missing the shipping costs of one store (quote only). Lets say the shipping costs are 10 euros then the final total 719,88 euros.
Using my tool to determine which stores to buy from and then selecting those stores in the BrickOwl store selection tool get a solution of 492.70 euros! Two stores are missing shipping so lets add 20 euros. The grand total then is 512,70 euros. This saves 200 euros for a single MOC. And then I can't even optimise on shipping yet!
This is a game changer!
You can check the results by yourself, here are the stores my tool selected:
FamilyBricks
MARYLAND
FloathBricks
Buy cheap in bulk!
MarcoDea1907 Brick House
Magicshop
Klemmnix
Sunflower_Bricks_Shop
BricksByTheRiver
Bricks Magic
JoanyBrick
https://www.brickowl.com/wishlist/view/P6tu/the-base
The list is still a subject of change and I am not ready to start ordering the needed spares (at least not yet), but the majority of the project is ready... Now it would be amazing to find a way to get the needed spares with the most optimal way. Unfortunately Brick Owl Magic isn't helpful with such a big list of things, but your idea and your project sounds quite what I will be needing in the future.
PS! Awesome project and somewhat sounds like something of a thesis work for a PhD degree .
Right now I can only import rebrickable CSVs into my tool as wishlist. I will soon add the ability to import BrickOwl wishlists. I plan on launching a beta version of the tool somewhere this month so you can try it out then. I will let you know when you can try it out as one of the first users!
Also, I'm assuming it recalculates the shipping rates when parts or added or removed from the list? As that may change the shipment size, which could change the shipping rate...
I'm super-intrigued with this! All us folks that part out sets or are MOCers, well, this is what we desperately want to see. :-) Good for you!!!
My algorithm could then optimise on that as precisely as possible. It could for example try to stay just below a weight treshold for the shipping option. To be able to do that I need the info from BrickOwl; that is why I created this suggestion.
In the end, the more information I have, the better I can optimise. Once the site is live (in a couple of weeks I hope) I will post a message in the forum again so you can check it out.
Edit : Figured it out.
I will check it out . Sorry for not replying to your messages. Daily life has overwhelmed me a bit and I have not had any time to deal with my MOC-s for the past few months ... I will check it out, once I get my my responsibilities on track.
With regards,