bestbuy / bestbuy
High level PHP client for the Best Buy API
Installs: 8 000
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 9
Forks: 4
Open Issues: 1
pkg:composer/bestbuy/bestbuy
Requires
- php: >=5.4
- ext-curl: *
- psr/log: ^1.0
Requires (Dev)
- phpdocumentor/phpdocumentor: ^2.0
- phpunit/phpunit: ^4.8
- satooshi/php-coveralls: ^1.0
- squizlabs/php_codesniffer: ^2.0
This package is not auto-updated.
Last update: 2025-10-24 19:17:44 UTC
README
This is a high-level PHP client for the Best Buy developer API.
Getting Started
- Sign-up for a developer API Key at https://developer.bestbuy.com/
- Install the package
-
Using the command line
composer require bestbuy/bestbuy -
Using
composer.json
Add"bestbuy/bestbuy": "^1.0"inside of the require part of yourcomposer.jsonfile:"require": { "bestbuy/bestbuy": "^1.0" }
-
- Use the package. There are several ways to provide the key to the
Client:- Set an environment variable of
BBY_API_KEYto your key and invoke the method
$bby = new \BestBuy\Client(); - Send the key in as a string when invoking the method
$bby = new \BestBuy\Client('YOURKEY'); - Send the key in as part of an object when invoking the method
$bby = new \BestBuy\Client(['key' => 'YOURKEY']);
- Set an environment variable of
Documentation
- Store Availability
- Product Categories
- Open Box Products
- Product Information
- Product Recommendations
- Product Reviews
- Stores
- Version
Store Availability
$bby->availability(int|int[]|string $skus, int|int[]|string $stores, [array $responseConfig = []]);
- A single SKU/Store #
$bby->availability(6354884, 611); - An array of SKUs/Store #s
$bby->availability([6354884, 69944141], [611, 281]); - A valid query for SKUs/Stores
$bby->availability('name=Star*', 'area(55347, 25)');
Product Categories
$bby->categories(string $search = '', [array $responseConfig = []]);
- All categories
$bby->categories(); - A single category
$bby->categories('cat00000'); - A query for categories
$bby->categories('name=Home*');
Open Box Products
$bby->openBox(int|int[]|string $search = '', [array $responseConfig = []]);
- All open box products
$bby->openBox(); - A single product
$bby->openBox(6354884); - An array of products
$bby->openBox([6354884, 69944141]); - A query
$bby->openBox('category.id=cat00000');
Product Information
$bby->products(int|string $search = '', [array $responseConfig = []]);
- All products
$bby->products(); - A single product
$bby->products(6354884); - A query for products
$bby->products('name=Star*');
Product Recommendations
$bby->recommendations(string $type, int|string $categoryIdOrSku = null, [array $responseConfig = []]);
- Trending or Most Viewed products
$bby->recommendations(\BestBuy\Client::RECOMMENDATIONS_TRENDING);
$bby->recommendations(\BestBuy\Client::RECOMMENDATIONS_TRENDING, 'cat00000'); - Similar or Also Viewed products
$bby->recommendations(\BestBuy\Client::RECOMMENDATIONS_SIMILAR, 6354884);
Product Reviews
$bby->reviews(int|string $search = '', [array $responseConfig = []]);
- All reviews
$bby->reviews(); - A single review
$bby->reviews(69944141); - A query for reviews
$bby->reviews('comment=purchase*');
Stores
$bby->stores(int|string $search = '', [array $responseConfig = []]);
- All stores
$bby->stores(); - A single store
$bby->stores(611); - A query for stores
$bby->stores('name=eden*');