### Start Development Server with Middleman Source: https://github.com/bestbuyapis/api-documentation/blob/master/README.md Starts a local development server using Middleman to preview the API documentation. Requires Middleman to be installed via Bundler. ```bash bundle exec middleman server ``` -------------------------------- ### Install Dependencies with Bundler Source: https://github.com/bestbuyapis/api-documentation/blob/master/README.md Installs all project dependencies using Bundler. Requires Ruby and Bundler to be installed on the system. ```bash bundle install ``` -------------------------------- ### Get Also Bought Products (JavaScript) Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/recommendations/_also-bought.md This example shows how to fetch also bought products using the Best Buy Node.js SDK. It initializes the SDK with an API key and then calls the 'recommendations' method with 'alsoBought' and the product SKU. The output is logged to the console. ```javascript var bby = require('bestbuy')('YourAPIKey'); bby.recommendations('alsoBought', 8880044).then(function(data){ console.log(data); }); ``` -------------------------------- ### API Environment Setup Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/overview/_postman.md Instructions for setting up your API key within a Postman environment for authentication. ```APIDOC ## API Key Setup ### Description To authenticate your requests, you must define your `apiKey` within a Postman environment. ### Method N/A (Environment Setup) ### Endpoint N/A (Environment Setup) ### Parameters #### Query Parameters - **apiKey** (string) - Required - Your unique Best Buy API key. ### Request Example 1. Create or select an environment in Postman. 2. Add `apiKey` as a variable with your API key as its value. ### Response N/A (Environment Setup) ``` -------------------------------- ### Search Products by Multiple Attributes (AND) Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/search/_index.md Illustrates how to search for products that match multiple criteria simultaneously using the AND operator ('&'). This example finds products from a specific manufacturer that are on sale for less than a certain price. It includes cURL and JavaScript examples. ```shell curl 'https://api.bestbuy.com/v1/products(manufacturer=canon&salePrice<1000)?format=json&show=sku,name,salePrice&apiKey=YourAPIKey' ``` ```javascript var bby = require('bestbuy')('YourAPIKey'); bby.products('manufacturer=canon&salePrice<1000',{show:'sku,name,salePrice'}).then(function(data){ console.log(data); }); ``` -------------------------------- ### Search Products by Any Attribute (OR) Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/search/_index.md Shows how to search for products where at least one of the specified attributes matches using the OR operator ('|'). This example finds products that are either 'wifiReady' or 'wifiBuiltIn'. cURL and JavaScript client examples are provided. ```shell curl "https://api.bestbuy.com/v1/products(wifiReady=true|wifiBuiltIn=true)?format=json&show=sku,name,salePrice&apiKey=YourAPIKey" ``` ```javascript var bby = require('bestbuy')('YourAPIKey'); bby.products('wifiReady=true|wifiBuiltIn=true',{show:'sku,name,salePrice'}).then(function(data){ console.log(data); }); ``` -------------------------------- ### Clone Repository using Git Source: https://github.com/bestbuyapis/api-documentation/blob/master/README.md Clones the forked Best Buy API documentation repository to your local machine. Requires Git to be installed. ```bash git clone https://github.com/YOURUSERNAME/api-documentation.git ``` -------------------------------- ### Query Open Box Offers by SKU using JavaScript Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/openbox/_single-sku.md This JavaScript example shows how to retrieve open box offers for a given SKU using the Best Buy API client library. It utilizes a promise-based approach to handle the asynchronous API call and logs the returned data to the console. Ensure the 'bestbuy' package is installed and your API key is configured. ```javascript var bby = require('bestbuy')('YourAPIKey'); bby.openBox(8610161).then(function(data){ console.log(data); }); ``` -------------------------------- ### Search by Multiple Attributes (OR) Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/search/_index.md Enables searching for resources where at least one of the specified attribute conditions must be met. This example finds products that have either Wi-Fi Ready or built-in Wi-Fi. ```APIDOC ## GET /v1/products ### Description Retrieves a list of products matching multiple criteria combined with the OR operator. This example finds products that are either Wi-Fi Ready or have built-in Wi-Fi. ### Method GET ### Endpoint /v1/products ### Query Parameters - **attribute1=value1|attribute2=value2** (string) - Required - Search terms combined with '|' for OR logic. Example: `wifiReady=true|wifiBuiltIn=true`. - **format** (string) - Optional - Specifies the response format (e.g., json). - **show** (string) - Optional - Comma-separated list of attributes to include in the response. - **apiKey** (string) - Required - Your Best Buy API key. ### Request Example ```shell curl "https://api.bestbuy.com/v1/products(wifiReady=true|wifiBuiltIn=true)?format=json&show=sku,name,salePrice&apiKey=YourAPIKey" ``` ### Response #### Success Response (200) - **sku** (integer) - The Stock Keeping Unit of the product. - **name** (string) - The name of the product. - **salePrice** (float) - The sale price of the product. #### Response Example ```json { "from": 1, "to": 10, "total": 500, "currentPage": 1, "totalPages": 50, "queryTime": "0.005", "totalTime": "0.030", "partial": false, "canonicalUrl": "/v1/products(wifiReady=true|wifiBuiltIn=true)?show=sku,name,salePrice&format=json&apiKey=YourAPIKey", "products": [ { "sku": 1012749, "name": "Acer - Aspire 11.6 inch Tablet with 120GB Memory", "salePrice": 661.98 }, { "sku": 4255007, "name": "Acer - B1-720 7\" Android Tablet - 16GB - Iron Gray", "salePrice": 128.98 } ] } ``` ``` -------------------------------- ### Products API - Facets Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/overview/_facets.md Retrieve summary information about items returned by a query using the `facets` parameter. This example shows the top 5 manufacturers for flat-panel TVs. ```APIDOC ## GET /v1/products ### Description Retrieves a list of products and their associated facet information. This example specifically filters for 'All Flat-Panel TVs' and shows the top 5 manufacturers. ### Method GET ### Endpoint /v1/products ### Query Parameters - **categoryPath.name** (string) - Required - The name of the category path to filter products. - **show** (string) - Optional - Comma-separated list of fields to include in the response. - **facet** (string) - Optional - Specifies the facet to retrieve and the number of items to show (e.g., "manufacturer,5"). - **format** (string) - Optional - The desired response format (e.g., "json"). - **apiKey** (string) - Required - Your Best Buy API key. ### Request Example ```shell https://api.bestbuy.com/v1/products(categoryPath.name="All%20Flat-Panel%20TVs")?format=json&show=sku,name,salePrice&facet=manufacturer,5&apiKey=YourAPIKey ``` ### Response #### Success Response (200) - **products** (array) - An array of product objects. - **facets** (object) - An object containing facet information, such as counts for different manufacturers. - **manufacturer** (object) - An object where keys are manufacturer names and values are their counts. #### Response Example ```json { "products": [ ], "facets": { "manufacturer": { "samsung": 96, "lg": 46, "sharp": 24, "vizio": 23, "insignia™": 18 } } } ``` ``` -------------------------------- ### Search by Multiple Attributes (AND) Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/search/_index.md Allows searching for resources where all specified attribute conditions must be met. This example finds products from a specific manufacturer that are on sale for less than a certain price. ```APIDOC ## GET /v1/products ### Description Retrieves a list of products matching multiple criteria combined with the AND operator. This example finds Canon products with a sale price less than $1000. ### Method GET ### Endpoint /v1/products ### Query Parameters - **attribute1=value1&attribute2products(categoryPath.id=pcmcat194000050022&manufacturer=Apple)?apiKey={{apiKey}}&format=json` ### Parameters #### Path Parameters - **products(categoryPath.id=...)** (string) - Required - Example shows filtering by category ID and manufacturer. #### Query Parameters - **apiKey** (string) - Required - Your unique Best Buy API key. - **format** (string) - Optional - Specifies the response format (e.g., `json`). ### Request Example `GET /v1/products(categoryPath.id=pcmcat194000050022&manufacturer=Apple)?apiKey={{apiKey}}&format=json` ### Response N/A (Parameter Handling) ``` -------------------------------- ### GET /products/{productId}/images Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/products/_images.md Retrieves all available image URLs for a specific product. ```APIDOC ## GET /products/{productId}/images ### Description Retrieves various image URLs for a product, including large, small, side images, and interactive 360-degree images. ### Method GET ### Endpoint /products/{productId}/images ### Parameters #### Path Parameters - **productId** (string) - Required - The unique identifier of the product. #### Query Parameters None #### Request Body None ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **accessoriesImage** (string) - URL of the accessories image. - **alternateViewsImage** (string) - URL of an alternate view image. - **angleImage** (string) - URL of the product's angle image. - **backViewImage** (string) - URL of the rear view image. - **energyGuideImage** (string) - URL of the product's EnergyGuide image. - **image** (string) - URL of the main product detail page image. - **largeFrontImage** (string) - URL of the large front view image. - **largeImage** (string) - URL of a large version of the product image. - **leftViewImage** (string) - URL of the left side view image. - **mediumImage** (string) - URL of a medium-sized product image. - **remoteControlImage** (string) - URL of the remote control image. - **rightViewImage** (string) - URL of the right side view image. - **spin360Url** (string) - URL for the interactive 360-degree view. - **thumbnailImage** (string) - URL of the image used on listing pages. - **topViewImage** (string) - URL of the top view image. #### Response Example { "accessoriesImage": "https://example.com/images/product123/accessories.jpg", "alternateViewsImage": "https://example.com/images/product123/alternate.jpg", "angleImage": "https://example.com/images/product123/angle.jpg", "backViewImage": "https://example.com/images/product123/back.jpg", "energyGuideImage": "https://example.com/images/product123/energyguide.jpg", "image": "https://example.com/images/product123/main.jpg", "largeFrontImage": "https://example.com/images/product123/large_front.jpg", "largeImage": "https://example.com/images/product123/large.jpg", "leftViewImage": "https://example.com/images/product123/left.jpg", "mediumImage": "https://example.com/images/product123/medium.jpg", "remoteControlImage": "https://example.com/images/product123/remote.jpg", "rightViewImage": "https://example.com/images/product123/right.jpg", "spin360Url": "https://example.com/images/product123/360spin", "thumbnailImage": "https://example.com/images/product123/thumbnail.jpg", "topViewImage": "https://example.com/images/product123/top.jpg" } ``` -------------------------------- ### GET /products Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/overview/_retrievingCollections.md Retrieves a collection of all products in the Best Buy catalog. The default maximum page size is 100 items. ```APIDOC ## GET /products ### Description Retrieves a collection of all products available in the Best Buy catalog. The default maximum page size is 100 items. For more information on handling results greater than 100, refer to the Pagination documentation. ### Method GET ### Endpoint https://api.bestbuy.com/v1/products?apiKey=YourAPIKey ### Query Parameters - **apiKey** (string) - Required - Your unique Best Buy API key. ### Request Example ``` https://api.bestbuy.com/v1/products?apiKey=YourAPIKey ``` ### Response #### Success Response (200) - **item** (string) - The type of items returned and counted (e.g., 'Product'). - **current page** (integer) - The page number currently being returned. - **totalPages** (integer) - The total number of pages required to list all items. - **from** (integer) - The index of the first item returned on the current page. - **to** (integer) - The index of the last item returned on the current page. - **total** (integer) - The total number of items returned by the query. - **queryTime** (string) - The time required to search the database (e.g., '15.34ms'). - **totalTime** (string) - The time required to parse, search, format, and return results (e.g., '22.56ms'). - **canonicalURL** (string) - The non-server part of the query URL. - **partial** (boolean) - A flag indicating whether the query returned only partial results due to a timeout. #### Response Example ```json { "from": 1, "to": 100, "current_page": 1, "item": { "name": "Product" }, "total": 1500, "totalPages": 15, "queryTime": "15.34ms", "totalTime": "22.56ms", "canonicalURL": "/v1/products?apiKey=YourAPIKey", "partial": false } ``` ``` -------------------------------- ### Fetch Open Box Offers by SKUs (JavaScript) Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/openbox/_multiple-skus.md This JavaScript code uses the Best Buy SDK to find open box offers for a provided list of SKUs. It initializes the SDK with an API key and then calls the `openBox` method with the SKU query. ```javascript var bby = require('bestbuy')('YourAPIKey'); bby.openBox('sku in(5729048,7528703,4839357,8153056,8610161)').then(function(data){ console.log(data); }); ``` -------------------------------- ### Fetch Product Data with Cursor Mark (Shell) Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/overview/_cursormark.md Demonstrates how to fetch the first page of product data using `curl` with the `cursorMark=*` parameter. It specifies the API endpoint, query parameters for filtering and showing specific fields, page size, and an API key. The output is expected in JSON format. ```shell curl -G "https://api.bestbuy.com/v1/products(type=HardGood)?format=json&show=sku,name,salePrice&pageSize=100&apiKey=YourAPIKey" --data-urlencode "cursorMark=*" ``` -------------------------------- ### GET /categories Source: https://context7.com/bestbuyapis/api-documentation/llms.txt Retrieve the complete Best Buy category hierarchy for taxonomy and navigation purposes. ```APIDOC ## GET /categories ### Description Retrieve the complete Best Buy category hierarchy for taxonomy and navigation purposes. ### Method GET ### Endpoint https://api.bestbuy.com/v1/categories ### Query Parameters - **format** (string) - Optional - Specifies the response format (e.g., json). - **show** (string) - Optional - Comma-separated list of fields to include in the response (e.g., id). - **apiKey** (string) - Required - Your Best Buy API key. ### Request Example ```shell curl "https://api.bestbuy.com/v1/categories?format=json&show=id&apiKey=YourAPIKey" ``` ### Response #### Success Response (200) - **categories** (array) - A list of category objects. - **id** (string) - The unique identifier for the category. #### Response Example ```json { "from": 1, "to": 10, "total": 4328, "currentPage": 1, "totalPages": 433, "queryTime": "0.003", "totalTime": "0.025", "partial": false, "canonicalUrl": "/v1/categories?show=id&format=json&apiKey=YourAPIKey", "categories": [ { "id": "abcat0010000" }, { "id": "abcat0020001" }, { "id": "abcat0020002" }, { "id": "abcat0020004" }, { "id": "abcat0100000" } ] } ``` ``` -------------------------------- ### GET /categories(name={name}) Source: https://context7.com/bestbuyapis/api-documentation/llms.txt Find specific categories and retrieve their hierarchical path from root to the target category. ```APIDOC ## GET /categories(name={name}) ### Description Find specific categories and retrieve their hierarchical path from root to the target category. ### Method GET ### Endpoint https://api.bestbuy.com/v1/categories(name={name}) ### Query Parameters - **format** (string) - Optional - Specifies the response format (e.g., json). - **show** (string) - Optional - Comma-separated list of fields to include in the response (e.g., path). - **apiKey** (string) - Required - Your Best Buy API key. ### Request Example ```shell curl "https://api.bestbuy.com/v1/categories(name=Sony%20DSLR%20Camera*)?format=json&show=path&apiKey=YourAPIKey" ``` ### Response #### Success Response (200) - **categories** (array) - A list of matching category objects. - **path** (array) - The hierarchical path of the category from the root. - **id** (string) - The ID of the category in the path. - **name** (string) - The name of the category in the path. #### Response Example ```json { "from": 1, "to": 1, "total": 1, "currentPage": 1, "totalPages": 1, "queryTime": "0.011", "totalTime": "0.014", "partial": false, "canonicalUrl": "/v1/categories(name=\"Sony DSLR Camera*\")?show=path&format=json&apiKey=YourAPIKey", "categories": [ { "path": [ { "id": "cat00000", "name": "Best Buy" }, { "id": "pcmcat128500050004", "name": "Name Brands" }, { "id": "cat15063", "name": "Sony" }, { "id": "pcmcat97200050015", "name": "Sony DSLR Camera" } ] } ] } ``` ``` -------------------------------- ### GET /categories Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/overview/_retrievingCollections.md Retrieves a collection of all product categories. The default maximum page size is 100. Consult Pagination for details on retrieving more than 100 results. ```APIDOC ## GET /categories ### Description Retrieves a collection of all product categories offered by Best Buy. The default maximum page size is 100 items. For more information on handling results greater than 100, refer to the Pagination documentation. ### Method GET ### Endpoint https://api.bestbuy.com/v1/categories?apiKey=YourAPIKey ### Query Parameters - **apiKey** (string) - Required - Your unique Best Buy API key. ### Request Example ``` https://api.bestbuy.com/v1/categories?apiKey=YourAPIKey ``` ### Response #### Success Response (200) - **item** (string) - The type of items returned and counted (e.g., 'Category'). - **current page** (integer) - The page number currently being returned. - **totalPages** (integer) - The total number of pages required to list all items. - **from** (integer) - The index of the first item returned on the current page. - **to** (integer) - The index of the last item returned on the current page. - **total** (integer) - The total number of items returned by the query. - **queryTime** (string) - The time required to search the database (e.g., '8.50ms'). - **totalTime** (string) - The time required to parse, search, format, and return results (e.g., '15.20ms'). - **canonicalURL** (string) - The non-server part of the query URL. - **partial** (boolean) - A flag indicating whether the query returned only partial results due to a timeout. #### Response Example ```json { "from": 1, "to": 100, "current_page": 1, "item": { "name": "Category" }, "total": 250, "totalPages": 3, "queryTime": "8.50ms", "totalTime": "15.20ms", "canonicalURL": "/v1/categories?apiKey=YourAPIKey", "partial": false } ``` ``` -------------------------------- ### Fetch Product Data with Cursor Mark (Node.js) Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/overview/_cursormark.md Shows how to retrieve product data using the Best Buy API Node.js SDK. It initializes the SDK with an API key and then calls the products method with parameters including `type`, `show`, `pageSize`, and `cursorMark=*`. The retrieved data is logged to the console. ```javascript var bby = require('bestbuy')('YourAPIKey'); bby.products('type=HardGood',{show:'sku,name,salePrice',pageSize:100,cursorMark=*}).then(function(data){ console.log(data); }); ``` -------------------------------- ### GET /stores Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/overview/_retrievingCollections.md Retrieves a collection of all Best Buy stores. The default maximum page size is 100. Refer to Pagination for handling more than 100 results. ```APIDOC ## GET /stores ### Description Retrieves a collection of all Best Buy stores. The default maximum page size is 100 items. For more information on handling results greater than 100, refer to the Pagination documentation. ### Method GET ### Endpoint https://api.bestbuy.com/v1/stores?apiKey=YourAPIKey ### Query Parameters - **apiKey** (string) - Required - Your unique Best Buy API key. ### Request Example ``` https://api.bestbuy.com/v1/stores?apiKey=YourAPIKey ``` ### Response #### Success Response (200) - **item** (string) - The type of items returned and counted (e.g., 'Store'). - **current page** (integer) - The page number currently being returned. - **totalPages** (integer) - The total number of pages required to list all items. - **from** (integer) - The index of the first item returned on the current page. - **to** (integer) - The index of the last item returned on the current page. - **total** (integer) - The total number of items returned by the query. - **queryTime** (string) - The time required to search the database (e.g., '10.12ms'). - **totalTime** (string) - The time required to parse, search, format, and return results (e.g., '18.90ms'). - **canonicalURL** (string) - The non-server part of the query URL. - **partial** (boolean) - A flag indicating whether the query returned only partial results due to a timeout. #### Response Example ```json { "from": 1, "to": 100, "current_page": 1, "item": { "name": "Store" }, "total": 500, "totalPages": 5, "queryTime": "10.12ms", "totalTime": "18.90ms", "canonicalURL": "/v1/stores?apiKey=YourAPIKey", "partial": false } ``` ``` -------------------------------- ### GET /products/{sku}/stores Source: https://context7.com/bestbuyapis/api-documentation/llms.txt Query near real-time product availability at specific stores based on SKU and location. ```APIDOC ## GET /products/{sku}/stores ### Description Query near real-time product availability at specific stores based on SKU and location. ### Method GET ### Endpoint https://api.bestbuy.com/v1/products/{sku}/stores.json ### Query Parameters - **postalCode** (string) - Required - The postal code to search for nearby stores. - **apiKey** (string) - Required - Your Best Buy API key. ### Request Example ```shell curl "https://api.bestbuy.com/v1/products/4807511/stores.json?postalCode=55423&apiKey=YourAPIKey" ``` ### Response #### Success Response (200) - **ispuEligible** (boolean) - Indicates if In-Store Pickup is eligible for the product at these stores. - **stores** (array) - A list of stores with product availability information. - **storeID** (string) - The ID of the store. - **name** (string) - The name of the store. - **address** (string) - The street address of the store. - **city** (string) - The city of the store. - **state** (string) - The state of the store. - **postalCode** (string) - The postal code of the store. - **storeType** (string) - The type of Best Buy store. - **minPickupHours** (null) - Placeholder, likely for future use. - **lowStock** (boolean) - Indicates if the product is low in stock at this store. - **distance** (number) - The distance of the store from the specified postal code. #### Response Example ```json { "ispuEligible": true, "stores": [ { "storeID": "10", "name": "Maplewood", "address": "1795 County Rd D E", "city": "Maplewood", "state": "MN", "postalCode": "55109", "storeType": "Big_Box_Store", "minPickupHours": null, "lowStock": false, "distance": 16.594 } ] } ``` ``` -------------------------------- ### GET /stores/{storeId} Source: https://context7.com/bestbuyapis/api-documentation/llms.txt Retrieve store operating hours, including detailed daily schedules for the next two weeks. ```APIDOC ## GET /stores/{storeId} ### Description Retrieve store operating hours including detailed daily schedules for the next two weeks. ### Method GET ### Endpoint https://api.bestbuy.com/v1/stores(storeId={storeId}) ### Query Parameters - **format** (string) - Optional - Specifies the response format (e.g., json). - **show** (string) - Optional - Comma-separated list of fields to include in the response (e.g., hours,hoursAmPm,gmtOffset,detailedHours). - **apiKey** (string) - Required - Your Best Buy API key. ### Request Example ```shell curl "https://api.bestbuy.com/v1/stores(storeId=1118)?format=json&show=hours,hoursAmPm,gmtOffset,detailedHours&apiKey=YourAPIKey" ``` ### Response #### Success Response (200) - **hours** (string) - A summary of daily store hours. - **hoursAmPm** (string) - Detailed store hours in AM/PM format. - **gmtOffset** (number) - The GMT offset for the store's time zone. - **detailedHours** (array) - An array of objects, each detailing the opening and closing times for a specific date. - **day** (string) - The day of the week. - **date** (string) - The specific date. - **open** (string) - The opening time. - **close** (string) - The closing time. #### Response Example ```json { "from": 1, "to": 1, "total": 1, "currentPage": 1, "totalPages": 1, "stores": [ { "hours": "Mon: 10-9; Tue: 10-9; Wed: 10-9; Fri: 12:01-10; Sat: 9-10; Sun: 11-8", "hoursAmPm": "Mon: 10am-9pm; Tue: 10am-9pm; Wed: 10am-9pm; Fri: 12:01am-10pm; Sat: 9am-10pm; Sun: 11am-8pm", "gmtOffset": -5, "detailedHours": [ { "day": "Sunday", "date": "2015-11-22", "open": "11:00", "close": "20:00" }, { "day": "Monday", "date": "2015-11-23", "open": "10:00", "close": "21:00" } ] } ] } ``` ``` -------------------------------- ### Query Open Box Products Source: https://context7.com/bestbuyapis/api-documentation/llms.txt Finds discounted open box offers for a specific product SKU. It returns details about the condition and pricing of available open box items. Requires an API key and the target SKU. ```shell curl "https://api.bestbuy.com/beta/products/8610161/openBox?apiKey=YourAPIKey" ``` ```javascript var bby = require('bestbuy')('YourAPIKey'); bby.openBox(8610161).then(function(data){ console.log(data); }); ``` -------------------------------- ### GET /products/mostViewed Source: https://github.com/bestbuyapis/api-documentation/blob/master/source/includes/recommendations/_most-viewed.md Retrieves the top ten most viewed products on BestBuy.com. This can be filtered by category or subcategory. ```APIDOC ## GET /products/mostViewed ### Description Retrieves the top ten most viewed products on BestBuy.com. This endpoint can be filtered by category or subcategory using their respective IDs. ### Method GET ### Endpoint `/v1/products/mostViewed` ### Parameters #### Query Parameters - **apiKey** (string) - Required - Your Best Buy API key. - **categoryId** (string) - Optional - The ID of the category to filter by. ### Request Example ```shell https://api.bestbuy.com/v1/products/mostViewed(categoryId=abcat0107000)?apiKey=YourAPIKey ``` ### Response #### Success Response (200) - **metadata** (object) - Contains metadata about the request, including the canonical URL and result set count. - **results** (array) - An array of product objects, each containing details like sku, customer reviews, descriptions, images, names, prices, links, and rank. #### Response Example ```json { "metadata": { "context": { "canonicalUrl": "https://api.bestbuy.com/v1/products/mostViewed(categoryId=abcat0107000)?apiKey=YourAPIKey" }, "resultSet": { "count": 10 } }, "results": [ { "sku": "5852832", "customerReviews": { "averageScore": 4.3, "count": 4816 }, "descriptions": { "short": "Compatible with more than 270,000 entertainment device brands; replaces up to 10 remotes; programmable buttons" }, "images": { "standard": "https://pisces.bbystatic.com/image2/BestBuy_US/images/products/5852/5852832_sa.jpg" }, "names": { "title": "Logitech - Harmony 665 10-Device Universal Remote - Black" }, "prices": { "regular": 79.99, "current": 79.99 }, "links": { "product": "https://api.bestbuy.com/v1/products/5852832.json?apiKey=YourAPIKey", "web": "https://api.bestbuy.com/click/-/5852832/pdp", "addToCart": "https://api.bestbuy.com/click/-/5852832/cart" }, "rank": 1 } // ... more products ] } ``` ### Endpoint-Specific Attributes - **rank** (integer) - The rank of a product based on how frequently it is viewed on BESTBUY.COM product detailed page. ``` -------------------------------- ### GET /products/{sku}/openBox Source: https://context7.com/bestbuyapis/api-documentation/llms.txt Find discounted open box offers for specific SKUs with condition ratings and special pricing. ```APIDOC ## GET /products/{sku}/openBox ### Description Find discounted open box offers for specific SKUs with condition ratings and special pricing. ### Method GET ### Endpoint `/beta/products/{sku}/openBox` ### Parameters #### Query Parameters - **apiKey** (string) - Required - Your Best Buy API key. ### Request Example ```shell curl "https://api.bestbuy.com/beta/products/8610161/openBox?apiKey=YourAPIKey" ``` ### Response #### Success Response (200) - **results** (array) - An array of open box offers for the specified SKU. - **customerReviews** (object) - Customer review information. - **averageScore** (string) - The average customer review score. - **count** (integer) - The number of customer reviews. - **descriptions** (object) - Product descriptions. - **short** (string) - A short description of the product. - **images** (object) - Product images. - **standard** (string) - The URL for the standard product image. - **links** (object) - Links related to the product. - **product** (string) - The API endpoint for the product. - **web** (string) - A web link to the product's page. - **addToCart** (string) - A link to add the product to the cart. - **names** (object) - Product names. - **title** (string) - The title of the product. - **offers** (array) - An array of available offers for the product. - **condition** (string) - The condition of the open box item (e.g., "excellent", "certified"). - **prices** (object) - Pricing information for the offer. - **current** (number) - The current price of the offer. - **regular** (number) - The regular price of the offer. - **prices** (object) - General pricing information for the product. - **current** (number) - The current price of the product. - **regular** (number) - The regular price of the product. - **sku** (string) - The SKU of the product. #### Response Example ```json { "results": [ { "customerReviews": { "averageScore": "4.5", "count": 471 }, "descriptions": { "short": "Google Chrome 64-bitTechnical details: Intel® Celeron® processor; 11.6" display; 2GB memory; 16GB eMMC flash memorySpecial features: Bluetooth; HDMI outputNote: DVD/CD drive not included" }, "images": { "standard": "http://img.bbystatic.com/BestBuy_US/images/products/8610/8610161_rc.jpg" }, "links": { "product": "https://api.bestbuy.com/v1/products/8610161.json?apiKey=YourAPIKey", "web": "http://www.bestbuy.com/site/acer-11-6-chromebook-intel-celeron-2gb-memory-16gb-emmc-flash-memory-moonstone-white/8610161.p?id=1219351773817&skuId=8610161", "addToCart": "https://api.bestbuy.com/click/-/8610161/cart" }, "names": { "title": "Acer - 11.6" Chromebook - Intel Celeron - 2GB Memory - 16GB eMMC Flash Memory - Moonstone White" }, "offers": [ { "condition": "excellent", "prices": { "current": 175.99, "regular": 199 } }, { "condition": "certified", "prices": { "current": 187.99, "regular": 199 } } ], "prices": { "current": 199, "regular": 199 }, "sku": "8610161" } ] } ``` ``` -------------------------------- ### Search Products Using Wildcard String Matching Source: https://context7.com/bestbuyapis/api-documentation/llms.txt Perform flexible searches on text fields using wildcards to match patterns. The API automatically tokenizes strings for matching. This example searches for products with 'iPhone' in the long description or a specific SKU, returning SKU and name. ```shell curl 'https://api.bestbuy.com/v1/products(longDescription=iPhone*|sku=7619002)?show=sku,name&pageSize=15&page=5&apiKey=YourAPIKey&format=json' ``` ```javascript var bby = require('bestbuy')('YourAPIKey'); bby.products('longDescription=iPhone*|sku=7619002', {show:'sku,name', pageSize:15, page:5}).then(function(data){ console.log(data); }); ```