Flipkart Product API Get Affiliate Product using PHP

Categories:

If you are creating a affiliate website using WordPress or core PHP here is something for you. We have created and tested flipkart affiliate API which fetch products.

Steps to Create PHP Get Product Code

  • You need Fk-Affiliate-Id and Fk-Affiliate-Token to proceed from Flipkart Website
  • Check your API status here

flipkart product api

PHP code here

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://affiliate-api.flipkart.net/affiliate/1.0/search.json?query=sony+mobiles&resultCount=5",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Fk-Affiliate-Id: sa******",
    "Fk-Affiliate-Token: d********************8"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

As you can see I have passed two search queries in code “Sony mobile” and Result “5” you can customize it as well.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *