Store Queries

What does it do?
The store query will allow you to gain information about all Best Buy Stores. You will also be able to perform product availabilty queries for each store.
The Stores API
          Base URL: http://api.remix.bestbuy.com/{version}/stores
          Curent Version: V1
          HTTP Method: GET
Default Queries:
If you run a query without setting the optional parameters, this is what happens:
  • Returns in XML Format. For all attributes see Parameter [format]
  • Sorted by Postal Code. [sort]
  • All possible attributes are shown by default. [show]
  • Results will be page 1 of X. 10 results per page.[page]
Attributes
Each query URL will have required and optional parameters that must be included to complete a query.
Parameters Required Options
apiKey yes String Value
For more information, see Requesting a Key.
format no String Value
json or xml
page no Positive Integer Value
show no String Value
Specify string of "all" or
Product Attributes
Example: name,address,region
Comma delimited
sort no String Value
Attribute.{SORT METHOD}
Methods: desc, asc
Basic Examples
#1 This is the most basic query that will return page 1 of all stores.
          http://api.remix.bestbuy.com/v1/stores?apiKey={YourApiKey}
#2 This query changes the same #1 query format from the default XML to JSON.
          http://api.remix.bestbuy.com/v1/stores?format=json&apiKey={YourApiKey}
#3 This query changed the same #1 query to the third page.
          http://api.remix.bestbuy.com/v1/stores?page=3&apiKey={API KEY HERE}
#4 This query changes the same #1 query from the default all attributes to a subset of attributes.
          http://api.remix.bestbuy.com/v1/stores?show=name,address,region&apiKey={API KEY HERE}
#5 This query changes the same #1 query to sort by the region attribute in descending manner.
          http://api.remix.bestbuy.com/v1/stores?sort=region.desc&apiKey={API KEY HERE}
Filtering Functions
You can essentially filter by any active store Attribute. List of Attributes here {Link Coming Soon}
Function Required Options
Operators Supported: =, >, <, <=, >=, !=
stores() no String Value
stores(area()) no String Value
Accepts Postal code
Accepts Lat/Long Comma Seperated

Examples for stores()
#1 This filter pulls all stores that are from the region of Minnesota.
          http://api.remix.bestbuy.com/v1/stores(region='MN')?apiKey={API KEY HERE}
#2 This filter pulls all stores that start with 604 for their postal code.
          http://api.remix.bestbuy.com/v1/stores(postalCode=604*)?apiKey={API KEY HERE}
#3 This filter pulls all stores greater than -74.226158 on the Longitude line.
          http://api.remix.bestbuy.com/v1/stores(lng>-74.226158)?apiKey={API KEY HERE}
#3 This filter is similar to #3 but also adds a Latitude Line. This pulls all stores greater than -74.226158 on the Longitude line and all stores greater than or equal to 40.147675 on the Latitude Line.
          http://api.remix.bestbuy.com/v1/stores(lng>-74.226158&lat>=40.147675)?apiKey={API KEY HERE}
Examples for stores(area())
#1 This filter pulls all stores in a 20 mile box around postal code 55423.
          http://api.remix.bestbuy.com/v1/stores(area(55423,20))?apiKey={API KEY HERE}
#2 This filter pulls all stores within a 20 mile box from lat/long 44.862858,-93.292763.
          http://api.remix.bestbuy.com/v1/stores(area(44.862858,-93.292763,20))?apiKey={API KEY HERE}
Additional Information:
Using Longitude and Latitude with stores()
Using the stores type, you can pass in the longitude and latitude of a geographical location to return Best Buy store locations for that area. As you might guess, you will have to determine the longitude and latitude for the area first. There are several methods of determining this. Searching the internet on "how do I determine longitude and latitude?" will give you a sampling. One interesting way to determine longitude and latitude is from a cell phone via the cell phone API. You can write an iPhone app, for instance, and ask the iPhone for current longitude and latitude, then turn around and plug that into something interesting like Remix. As an example, you might use this query in these situations:
  • You have determined longitude and latitude for a particular geographical area and you want to bring data back from Remix on all the Best Buy stores within these coordinates
  • Instead of using zip codes as the center point for a store area, you want to use a query that uses longitude and latitude.
How area() works on the back end
The Remix API takes that one point plus the radius and figures out what the two points would be that define the box or area. It does this to square your line in order to have a contained area. As an example, if your center point is in Chicago and you give a radius of 50 miles, we use one point 50 miles SW of Chicago and one point 50 miles NE of Chicago to define the box. Then we get the stores in that box and sort them by distance from the center point you specified.

Comments