Best Buy has opened up its retail catalog in hopes that innovative developers will help to expand the company’s online presence. Best Buy Remix (currently in Beta) exposes information about Best Buy products and stores.
Interested? Apply for an API key, download the PHP client library and get started!
What is this?
BestBuy_Service_Remix is a PHP library for placing HTTP calls to the Best Buy Remix API.
How Do I Use It?
To use BestBuy_Service_Remix in your PHP project, just follow these simple steps:
Download The Code From Google Code
Click on the icon below to go get the source from Google Code:
The most recent download will contain source code, usage instructions, and documentation.
Add the code to your PHP project
You’ll need to add the contents of the ‘lib’ folder to your include path.
Create a BestBuy_Service_Remix API client with a valid API key
<?php
require_once('BestBuy/Service/Remix.php');
$remix = new BestBuy_Service_Remix('YourApiKey');
BestBuy_Service_Remix returns a response object containing API response data and HTTP metadata recorded by cURL
Data may be requested in either XML (default) or JSON format.
<?php
require_once('BestBuy/Service/Remix.php');
$remix = new BestBuy_Service_Remix('YourApiKey');
// Retrieve a list of Movies containing the text "Bat"
$result = $remix->products(array('name=bat*','type=Movie'))->query();
if(!$result->isError())
{
echo $result;
}
else if(403 != $result->http_code)
{
// API errors result in an error document with detailed info
echo $result->toSimpleXml()->message;
}
else
{
// 403 errors do not contain a full document, only an h1 message
echo $result->toSimpleXml()->h1;
}
Documentation
Complete documentation is included with each download in the ‘docs’ folder.
Licensing
This library is licensed under a BSD license.
Discuss
Share your thoughts, or just let us know what you’re up to over at the Arc90 blog.
