The ShopStyle API allows client applications to retrieve the underlying data for all the basic elements of the ShopStyle websites, including products, brands, retailers, categories, and looks. For ease of development, the API is a REST-style web service, composed of simple HTTP GET requests. Data is returned to the client in either XML or JSON formats. The API is client-language independent and easy to use from PHP, Java, JavaScript, or any other modern development context.
To use the ShopStyle API, you need to first sign up here to get your unique API key. Once you have this key, you can start making the API calls described below.
To use the ShopStyle API, make sure your Partner ID is appended to all requests.
This document is intended for programmers who would like to develop a client application that will use the ShopStyle API. The client will need to know how to invoke an HTTP request with a particular URL and process the body of the response as either XML or JSON.
Here are the basic steps for using the API, regardless of the client language you are using:
- Choose the method that returns the data your application needs. For example, the apiSearch method is used to get products that match a given category or brand.
- Construct a URL for that method with the appropriate host, method name, and query parameters.
- Invoke the URL as an HTTP GET.
- When the HTTP response arrives, extract the required data elements from the response's body.
The rest of this document describes the details of constructing the right URL for each of the API's methods. The XML format of the responses may be seen by clicking on the sample URLs shown for each method. The responses in JSON format contain identical information, just in a different language.
There is also a sample client application written in PHP.
Â
All ShopStyle API URLs have the following form:
The METHOD_NAME is taken from the list of methods in the API shown at left.
All methods in the API accept these parameters:
| pid | Unique API_KEY string that is assigned to the caller. Sign up here to get your Shopstyle API key. Your Partner ID: This parameter must be present. |
|
format |
The format of the response. Supported values are:
|
| site | Specifies the ShopStyle website to be searched or queried (optional; defaults to US fashion).
|
Â
Many of the methods listed in the next section accept this set of optional product query parameters, which are similar to query parameters used by the ShopStyle websites:
| fts | Text search terms, as a user would enter in a Search: field. |
| cat | A product category. Only products within the category will be returned. The easiest way to find values for this parameter is to browse to a category on the ShopStyle website and take the last element of the URL path, e.g., from http://www.shopstyle.com/browse/dresses, use "dresses." Another way is to look at the categories of the products returned by the apiSearch or to look at the list of categories from apiGetCategoryHistogram. |
| fl |
Specify one or more filters on the query for brand, retailer, price, discount, and/or size. Each filter value has an initial letter and a numeric id. The easiest way to construct a filter list is to do a search on ShopStyle, select one or more filters in the UI, and copy the resulting URL. To convert brand or retailer names to ids, use the http://www.shopstyle.com/browse/womens-clothes?fl=d0&fl=b3510&fl=b689&fl=r21 Filter prefixes are:
|
| pdd | A "price drop date" expressed as a number of milliseconds since Jan 1, 1970. If present, limits the results to products whose price has dropped since the given date. |
| prodid | The id of a specific product to return. This may be specified multiple times to get many products in one response. |
Â