Giter Site home page Giter Site logo

bestbuy-sdk-php's Introduction

Best Buy SDK for PHP Build Status

License Latest Stable Version Coverage Status Total Downloads

This is a high-level PHP client for the Best Buy developer API.

Getting Started

  1. Sign-up for a developer API Key at https://developer.bestbuy.com/
  2. 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 your composer.json file:

      "require": {
        "bestbuy/bestbuy": "^1.0"
      }
  3. Use the package. There are several ways to provide the key to the Client:
    • Set an environment variable of BBY_API_KEY to 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']);

Documentation

Store Availability

$bby->availability(int|int[]|string $skus, int|int[]|string $stores, [array $responseConfig = []]);

  1. A single SKU/Store #
    $bby->availability(6354884, 611);
  2. An array of SKUs/Store #s
    $bby->availability([6354884, 69944141], [611, 281]);
  3. A valid query for SKUs/Stores
    $bby->availability('name=Star*', 'area(55347, 25)');

Product Categories

$bby->categories(string $search = '', [array $responseConfig = []]);

  1. All categories
    $bby->categories();
  2. A single category
    $bby->categories('cat00000');
  3. A query for categories
    $bby->categories('name=Home*');

Open Box Products

$bby->openBox(int|int[]|string $search = '', [array $responseConfig = []]);

  1. All open box products
    $bby->openBox();
  2. A single product
    $bby->openBox(6354884);
  3. An array of products
    $bby->openBox([6354884, 69944141]);
  4. A query
    $bby->openBox('category.id=cat00000');

Product Information

$bby->products(int|string $search = '', [array $responseConfig = []]);

  1. All products
    $bby->products();
  2. A single product
    $bby->products(6354884);
  3. A query for products
    $bby->products('name=Star*');

Product Recommendations

$bby->recommendations(string $type, int|string $categoryIdOrSku = null, [array $responseConfig = []]);

  1. Trending or Most Viewed products
    $bby->recommendations(\BestBuy\Client::RECOMMENDATIONS_TRENDING);
    $bby->recommendations(\BestBuy\Client::RECOMMENDATIONS_TRENDING, 'cat00000');
  2. Similar or Also Viewed products
    $bby->recommendations(\BestBuy\Client::RECOMMENDATIONS_SIMILAR, 6354884);

Product Reviews

$bby->reviews(int|string $search = '', [array $responseConfig = []]);

  1. All reviews
    $bby->reviews();
  2. A single review
    $bby->reviews(69944141);
  3. A query for reviews
    $bby->reviews('comment=purchase*');

Stores

$bby->stores(int|string $search = '', [array $responseConfig = []]);

  1. All stores
    $bby->stores();
  2. A single store
    $bby->stores(611);
  3. A query for stores
    $bby->stores('name=eden*');

Version

$bby->version();

bestbuy-sdk-php's People

Contributors

ecaron avatar troymccabe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bestbuy-sdk-php's Issues

Migrate to MIT License

@troymccabe, I'd like to relicense this from GPLv2 to MIT. Bootstrap and jQuery both did this. All that's necessary is to get each commiter's +1. Since its just you and me, I figure it should be pretty easy.

So, +1?

Pagination

Just want to ask that how items/products will be paginate?

bby->products('name=iphone*')

This returns only items from 0-10.. what if i want to see more?

error response when modelNumber includes a /

When I pass in modelNumber=MUF-128BA/AM

it throws an error. the forward / is not very happy.

I tried URL encoding the value, even double URL encoding, but to not avail, it still returns an error.

Is there something possibly server-side in the configuration that is preventing even a URL encoded string from being parsed correctly?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.