un-official Node.js client for Flipkart Affiliates API
Requires "request" npm package
Install using npm
npm i flipkart-api-affiliate-client
Require Library
var client = require('flipkart-api-affiliate-client');
Create Client
var fkClient = new client({
trackingId:"<YOUR TRACKING ID>",
token:"<YOUR TOKEN>",
},"<FORMAT>");
Usage Examples
Get the Product Feed of The API
fkClient.getProductsFeedListing().then(function(value){
console.log(value); //object with status, error and body
});
Get the Product Feed Of The API.
Takes Url as the parameter obtained from the Products Feed Listing
fkClient.getProductsFeed(Url).then(function(value){
console.log(value); //object with status, error and body
});
Get the Books Category Feed Of The API.
fkClient.getBooksCategoryFeed().then(function(value){
console.log(value); //object with status, error and body
});
Get the Top Selling Books Of The API.
Takes Url as the parameter obtained from the Books Category Feed
fkClient.getTopSellingBooks(Url).then(function(value){
console.log(value); //object with status, error and body
});
Search based on the Keywords.
doKeywordSearch("category",limit) takes two parameters.
category of the product you are searching for. and limit (by default the limt is set to 5)
fkClient.doKeywordSearch("mobiles",10).then(function(value){
console.log(value); //object with status, error and body
});
Search based On the Product Id
doIdSearch(productId) takes "ProductId" as a parameter.
fkClient.doIdSearch(productId).then(function(value){
console.log(value); //object with status, error and body
});
Get All Offers
fkClient.getAllOffers().then(function(value){
console.log(value); //object with status, error and body
});
Get Deals of the Day
fkClient.getDealsOfTheDay().then(function(value){
console.log(value); //object with status, error and body
});
Get orders report based on start_date , end_date, offset and status
getOrdersReport(obj) takes an object as a parameter
object Structure
{
startDate:'2012-03-01',
endDate:'2018-04-01',
status:'approved',
offset:'0'
}
fkClient.getOrdersReport(obj).then(function(value){
console.log(value); //object with status, error and body
});
Get App Install Report based on start_date, end_date and status
getAppInstallReport(obj) takes object as a parameter
Object Structure
{
startDate:'2012-03-01',
endDate:'2018-04-01',
status:'disapproved',
}
fkClient.getAppInstallReport(obj).then(function(value){
console.log(value); //object with status, error and body
});