imoonkey

Best Buy

- **Not every SKU is online-sellable** — `addToCart` may return HTTP 400 `ITEM_NOT_SELLABLE` (typical for batteries, store-pickup-only items). Check `getProductPricing` `buttonState.purchasable` first.

imoonkey 56 3 Updated 4mo ago

Resources

6
GitHub

Install

npx skillscat add imoonkey/openweb/src-sites-bestbuy

Install via the SkillsCat registry.

SKILL.md

Best Buy

Overview

E-commerce — electronics retailer. Three read APIs (search, details, pricing) plus a write pair (addToCart / removeFromCart) keyed by server-generated lineId.

Workflows

Search and compare products

  1. searchProducts(query) → suggestion terms, categories, skuId[]
  2. getProductDetails(skuids ← searchProducts) → name, image, rating, reviewCount
  3. getProductPricing(skus ← searchProducts) → currentPrice, regularPrice, savings, availability

Add an item to cart

  1. searchProducts(query)skuId[]
  2. getProductPricing(skus ← searchProducts) → confirm purchasable=true (some SKUs are not online-sellable)
  3. addToCart(skuId ← searchProducts)cartCount, cartSubTotal, summaryItems[].lineId

Add then remove (round-trip)

  1. addToCart(skuId)summaryItems[0].lineId
  2. removeFromCart(lineId ← addToCart.summaryItems[0].lineId)order.cartItemCount, order.lineItems[]

Operations

Operation Intent Key Input Key Output Notes
searchProducts search by keyword query terms, categories, skuId[] entry point
getProductDetails product info by SKU skuids ← searchProducts name, image, rating, reviewCount comma-separated SKUs
getProductPricing pricing by SKU skus ← searchProducts currentPrice, regularPrice, savings, purchasable comma-separated SKUs
addToCart add product to cart skuId ← searchProducts cartCount, cartSubTotal, summaryItems[].lineId write / caution; POST /cart/api/v1/addToCart
removeFromCart remove cart line lineId ← addToCart.summaryItems[0].lineId order.cartItemCount, order.lineItems[] write / caution; DELETE /cart/item/{lineId}

Quick Start

# Search for products
openweb bestbuy exec searchProducts '{"query":"hdmi cable","count":3}'

# Get product details
openweb bestbuy exec getProductDetails '{"skuids":"6472356,6430949"}'

# Pricing
openweb bestbuy exec getProductPricing '{"skus":"6472356"}'

# Add to cart — capture the returned lineId
openweb bestbuy exec addToCart '{"items":[{"skuId":"6472356"}]}'

# Remove from cart — uses path param, NOT a JSON body
openweb bestbuy exec removeFromCart '{"lineId":"<lineId-from-addToCart>"}'

Known Limitations

  • Akamai-protected — all requests run through transport: page against an open bestbuy.com tab. Direct HTTP is blocked.
  • removeFromCart requires a fresh lineId — the line id is server-generated by addToCart and only valid for that cart line. Always chain the two ops (or pass an explicit lineId from a prior add).
  • Not every SKU is online-sellableaddToCart may return HTTP 400 ITEM_NOT_SELLABLE (typical for batteries, store-pickup-only items). Check getProductPricing buttonState.purchasable first.

Categories