es


XML Responses '''(NOTE: XML Responses are deprecated)''' !This documents the Showiki Search API.

Basic Concepts

Shopwiki provides a web-service for performing searches on Shopwiki. A request made to a URL will return a JSON or XML response containing the search results. The basic form of this request will be: :http://api.shopwiki.com/api/<apikey>&<parameters> The most common API call will be '''search''', which takes the parameter '''q=''<query>'''''. A search for the game '''apples to apples''' will take the form: :http://api.shopwiki.com/api/search?key=<api-key>&q=apples+to+apples API keys are needed to use make API calls. The API key does three things: * Authorizes users to make API calls. No key, no call. * Ties revenue to specific API users. * Sets a number search options, like what subset of stores should be searched.

Obtaining an API key

API keys are available to our affiliates. If you wish to become an affiliate, please contact James Keating, ShopWiki General Manager at jk@shopwiki.com. A public/test API key is available; it is 'b2cce8c214472b0c2bc17acf06d4da86'. This test API key is intended to allow you to test the Shopwiki API from a technical standpoint; it is restricted both in the number of stores searched and in the frequency of the requests. Additionally, there is no way to claim revenue produced using the public API key. So, if you want to test the Shopwiki API from a business perspective with live traffic, you should become an affiliate first.

Standard API Call Parameters

There are several standard parameters which all API calls accept.

required

* '''key=''<api-key>''''' ** All calls must include this parameter. ** The API key; a hexidecimal string which authenticates you to use the API. ** The public/test API key is 'b2cce8c214472b0c2bc17acf06d4da86'. *** The search results returned by the test API key are restricted to a subset of Shopwiki's offers and stores. It is intended for testing a front-end and ensuring that it works with the API correctly. *** The test API key may change periodically. When it does, the new key will be listed here.

optional

* '''version=''<integer>''''' ** Optional parameter. ** Selects the version of the API to be used for the call. ** The currently acceptable values are: 1. ** The current default version is: 1. * '''output=''<output-format>''''' ** Optional parameter. ** Selects the output format for responses. ** The currently acceptable values are: json, xml (deprecated). ** The current default version is: json. ** The default can be changed on a perkey basis.

search

XML Response '''(NOTE: XML Responses are deprecated)''' !Searches take a search or query and return a list of (hopefully unique) products. For instance, you might search for 'ipod', and expect to get back a list including 'Ipod Nano 8GB', 'Ipod Shuffle 1GB', and 'Ipod Nano 4GB'. A search can be done using just a keyword string, or it can be filtered based on features of the products you're looking for, like the price range or brands.

Input

* http://api.shopwiki.com/api/search?key=<api-key>&q=<search> * http://api.shopwiki.com/api/search?key=<apiresults>

Examples

* http://api.shopwiki.com/api/search?key=b2cce8c214472b0c2bc17acf06d4da86&q=canon+sd1000&n=5

Parameters

required

* '''q''' ** The query string.

optional

* '''loc''' ** Locale for search. ** Must be in form 'en_US', 'fr_FR', etc. ** Defaults to 'en_US'. * '''n''' ** Number of results desired. ** Defaults to 20. ** Maximum of 500. * '''start''' ** Position in the results. ** Defaults to 0. ** Maximum of 499. * '''bot''' ** Indicates this search is being performed on behalf of a robot (crawler). ** bot=t[rue]. * '''detailed''' ** Indicates whether to included extra information (slower, not necessarily necessary) in the results. ** detailed=t[rue]. ** The following fields are included in offers when detailed=true: *** "number_of_stores" *** "price_range" *** "short_list" * '''min_price''' ** Integer, minimum price. ** Filters results to only include offers above this price. * '''max_price''' * '''brand''' ** Comma-separated list of brands. ** Filters results to only include offers with one of these brands. * '''color''' ** Six-digit hexidecimal color code. ** Filters results to only include offers with this color. * '''sort''' ** sort=price|relevancy ** Dictates sort-key. ** Defaults to 'sort=relevancy'. * '''ascending''' ** ascending=t[rue] ** Dictates sort-order. ** Defaults to false (descending order). * '''site_id''' ** site_id=<commaintegers> ** Filters a search to only the stores with the specified Shopwiki site_ids. ** '''site_id''', '''store_name''', and '''store_url''' will search the union of their sets when used together. *** Don't use them together, that's just silly. * '''store_url''' ** Filters a search to only the stores with the specified store_urls. * '''store_name''' ** Filters a search to only the stores with the specified store_names. ** This really only works if you are working with a subset of all stores. We really only know the names of a tiny number of stores. * '''image_size''' ** Adjusts the size of the hosted_image. The hosted image will not be resized to a larger size than the original. ** Defaults to full-sized. * '''thumbnail_size''' ** Adjusts the size of the thumbnail. The thumbnail will not be resized to a larger size than the original. ** Defaults to 140. * '''relevancy''' ** Adjusts the threshold for a relevant result, relative to the default threshold. ** Values greater than 1.0 produce stricter (that is, fewer) results. ** Values less than 1.0 produce looser (that is, more) results. ** Defaults to 1.0 * '''sku''' ** Toggles the use of sku consolidation to consolidate search results. ** '''sku=false''' disables sku consolidation. All offers are returned in the search results. ** '''sku=true''' enables sku consolidation. Offers which are thought to be duplicates are pruned from the results. ** Defaults to true

stores

XML Response'''(NOTE: XML Responses are deprecated)''' !A stores search basically returns the list of stores a product is available at.

Input

* http://api.shopwiki.com/api/stores?key=<key>&d=<title> * http://api.shopwiki.com/api/stores?key=<key>&d=<title>&o=<offerid> * http://api.shopwiki.com/api/detail?key=<key>&d=<title>&o=<offerid>

Parameters

required

* '''d''' ** Title of the product you are looking up.

optional

* '''o''' ** Offer-id of the offer you are looking up, as returned in the ''offer_id'' field of a search result. * '''s''' ** Site-id of the offer you are looking up, as returned in the ''site_id'' field of a search result. * '''loc''' ** The locale of the offer you are looking up. Defaults to 'en-US'.

store-list

XML Response !Some API users search a specific set of stores. The store-list call returns the list of stores.

Input

* http://api.shopwiki.com/api/store-list?key=<key>

adbar-search

XML Response'''(NOTE: XML Responses are deprecated)''' !The search/stores calls are really intended for an interactive user search through some frontbox or other list of a handful of offers.

Input

* http://api.shopwiki.com/api/adbar-search?key=<key>&q=<keywords> * http://api.shopwiki.com/api/adbar-search?key=<key>&q=<keywords>&n=5

Parameters

required

* '''q''' ** A search string or other collection of keywords.

optional

* '''n''' ** The number of results to return. ** Default value is 5.

redir

The '''redir''' call performs external redirects for affiliates.

parameters

* '''k''' ** The affiliate's API key. * '''s''' ** The site_id associated with an offer. * '''o''' ** An offer ID. * '''v''' ** An optional parameter that specifies the VID of a visitor. * '''j''' ** An optional parameter that specifies the number of milliseconds to wait before redirecting. * '''p''' ** An optional parameter that specifies a URL that will be embedded in an iframe on the redirect page. This is used by affiliates to build jump pages. ** Note: This parameter will be ignored unless a 'j' parameter is specified.

clickout

The '''clickout''' call returns redirect and network information for offers.

parameters

* '''s''' ** The site_id associated with an offer. * '''o''' ** An offer ID. * '''v''' ** An optional parameter that specifies the VID of a visitor.