API Documentation
-
We provide a RESTful API to access our huge repository of summarized reviews. Send us simple HTTP requests and we will send back basic XML responses, which means you can interact with our API from any language.
- Protocol
- REST
- Data Formats
- Currently supported: XML, JSON [.js]
JSON requests also allow use of callback function using 'callback' parameter. - Authentication
- To start with, we support HTTP Basic Authentication. Username and password are authentication parameters, required in all the methods.
http://username:password@www.quarkrank.com/products.xml
- HTTP status codes
-
200 OK Everything is fine. 400 Bad Request Invalid request. Response will be an error message explaining the reason. 401 Not Authorized Authentication credentials are missing or invalid. 404 Not Found Resource does not exist or you're requesting an invalid URI. 500 Internal Server Error Oops! we did something wrong. Please contact us at contact@quarkrank.com - Rate Limit
- None. Please let us know beforehand if you will be generating huge amount of traffic to our site.
- Methods
-
- Get List of Products
Returns list of products given a category. Possible use to generate product listing.
http://www.quarkrank.com/products.{xml,js}Parameters:-
category (Required Parameter): one of [camera, cellphone, flatpaneltv, mp3player]
http://www.quarkrank.com/products.xml?category=camera
-
page (Optional): Page number
http://www.quarkrank.com/products.xml?category=camera&page=2
-
count (Optional): How many products to return per page. Minimum value can be 10 while maximum can be 30.
http://www.quarkrank.com/products.xml?category=camera&count=20
Response: For each product following values are returned- Name, QuarkRank, buzz, navigation specifactions (eg. opticalzoom for cameras)
- Top 5 features and Worst 3 features for this product
- Matching amazon's asin and shopping.com's product id
Response example: -
category (Required Parameter): one of [camera, cellphone, flatpaneltv, mp3player]
- Get information for a product
http://www.quarkrank.com/products/id.{xml,js}To get complete detail for a given product.
This can be used in two ways:- Using the sku of the product at quarkrank
- Using amazon's asin or shopping.com's product ID
Parameters:- id (Required): sku of the product at quarkrank/amazon/shopping.com
- site (Optional): This is required parameter if you are using amazon or shopping.com id. Value is one of [amazon, shopping]
- all_features(Optional): How many features to return for this product. Minimum value is 10 and you can ask for all with value "true". Default value is 10.
Output:- Name, QuarkRank, buzz, navigation specifications (eg. opticalzoom for cameras)
- Top 5 features and Worst 3 features , top 10 features (buzz wize)
- Matching Amazon's asin and Shopping.com's product id
- Top 10 snippets for each feature.
Mapping of feature name to snippets is done using feature id. Each of the feature contains an attribute feature_id
Each bundle of snippets, is wrapped with element name snippet_[snippet_id]
Response example: - Product Search
Returns the matching products for this search string
http://www.quarkrank.com/products.xml?search=search_string
Parameters: None
Output: Matching items with same details as in item listing
Each "product" item will contain additional attribute product_type which tells category of product - Get snippets for a feature
Returns the first 100 snippets for this feature
http://www.quarkrank.com/products/:id/snippets/feature_name.{xml,js}Example:http://www.quarkrank.com/products/039j9k/snippets/value%20for%20money.xml
- Get List of Products
- Ruby on Rails
-
ActiveResource can be used to access our RESTful API in Ruby on Rails.
Note : You need to apply this tiny patch to ActiveResource.
Following is the sample usage :class Product < ActiveResource::Base
self.site = "http://username:password@www.quarkrank.com"
# => Gets the product listing for a category
def self.list options={:category=>"camera"}
find(:all, :params=>options)
end
# => Get the item details for a given product
def self.show sku, site=nil, all_features=false
params = {}
params[:site] = site unless site.nil?
params[:all_features]="true" if all_features
find(sku, :params=>params)
end
# => Search for a given search query
def self.search query
find(:all,:params=>{:search=>query})
end
end
class Snippet < ActiveResource::Base
self.site= "http://username:password@www.quarkrank.com/products/:product_id"
# => Gets the snippets for a given product for a given feature (eg. picture)
# => Example: Features.features("039j9k", "value for money")
def self.snippets product, name
find name.gsub(" ","%20"),:params=>{:product_id=>product}
end
end



