简体   繁体   English

如何使用 api 从 cj、clickbank 和 linkshare、ebay 获取产品列表?

[英]how to grab product lists from cj, clickbank and linkshare, ebay using api?

Hello i want to get the product lists from cj, clickbank and linkshare via API's to display the whole lists on my site , if this is possible or its a nightmare , where am i standing please generous reply is needed, tell me how to grab the product list using their respective API's , i have found alot of blogs and posts regarding this but none is enough to solve my prob, thats yi said a nightmare.您好,我想通过 API 从 cj、clickbank 和 linkshare 获取产品列表,以在我的网站上显示整个列表,如果这是可能的或者是一场噩梦,我在哪里,请慷慨回复,告诉我如何获取使用各自 API 的产品列表,我发现了很多关于此的博客和帖子,但没有一个足以解决我的问题,那是 yi 说的噩梦。

this is what i got for clickbank这就是我为 clickbank 得到的

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.clickbank.com/rest/1.3/products/list");
curl_setopt($ch, CURLOPT_HEADER, true); 
curl_setopt($ch, CURLOPT_HTTPGET, true); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml",  "Authorization:DEV-7979307A05A8A50B6535A5AD5DCD8EDB060B:API-4D297E18498B51B70EA986DC7422B1BCE488"));
$result = curl_exec($ch);
curl_close($ch);

print_r($result);

the apikey and dev key is the real one of my affiliate account i created , i am giving the real info because i need it to be done, it is throwing the same error , site parameter is missing, apikey 和 dev 密钥是我创建的真实会员帐户之一,我提供真实信息,因为我需要完成它,它抛出相同的错误,缺少站点参数,

same is what i want for the other two.同样是我想要的其他两个。

much thanks in advance .非常感谢提前。 cheers.干杯。

Okey , that question i posted was somewhat one and half month before , i know answers are present all around the web but scattered and i want them to be gathered so if some one need it can use it.好吧,我发布的那个问题是在一个半月前发布的,我知道答案在网络上随处可见但分散,我希望将它们收集起来,以便如果有人需要它可以使用它。

first of all i am giving you for CJ, Comission Junction: 1) Creat a page eg cjcall.php and put the following code on that page.首先我给你 CJ, Comission Junction: 1) 创建一个页面,例如 cjcall.php 并将以下代码放在该页面上。

// CJ Product Grabing cjcall.php

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://product-search.api.cj.com/v2/product-search?website-id=YOUR-SITE-ID&keywords=KEYWORD&records-per-page=30&serviceable-area=US");

    curl_setopt($ch, CURLOPT_HEADER,false); 

    curl_setopt($ch, CURLOPT_HTTPGET, true); 

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml",  "Authorization:YOUR-CJ-DEVELOPER-ID"));
    $result = curl_exec($ch);

THIS will give you responce of products against your keyword if it is matching products.如果它是匹配的产品,这会给你对你的关键字的产品的反应。

you can get you result the way you want i figured it this way that i created a new page called cjcronjob.php and put the following code on that page and run it , there you can use the product details, ie may be save in the database.你可以按照你想要的方式得到你的结果我是这样想的,我创建了一个名为 cjcronjob.php 的新页面,并将以下代码放在该页面上并运行它,在那里你可以使用产品详细信息,即可以保存在数据库。

//cjcronjob.php //cjcronjob.php

$homepage = file_get_contents('ABSOLUTE-PATH-TO-THE-FIRST-CJCALL.PHP-FILE/cjcall.php');


$object = simplexml_load_string($homepage);


    foreach($object->products->product as $cjres)
    {

}

nOW each product is in your control use it in here inside the foreach loop which will run twenty times here as specified in the curl call.现在每个产品都在您的控制之下,在 foreach 循环中使用它,该循环将按照 curl 调用中的指定在此处运行 20 次。 clickbank is still a mystery , may be they dont allow you to perform more against their API clickbank 仍然是个谜,可能是他们不允许您对他们的 API 执行更多操作

okey the second was linkshare product grabing from linkshare , which is a bit different than other affiliate channels, in a sence that here first you will create relation on the linkshare advertisers , and you can the products of those who will allow you to be his advertiser or affiliate:好吧,第二个是从linkshare抓取linkshare产品,这与其他联盟渠道有点不同,因为在这里首先您将与linkshare广告客户建立关系,然后您可以将那些允许您成为他的广告客户的产品或附属公司:

here is the code:这是代码:

$ch = curl_init();

    $cv = curl_version();

    curl_setopt($ch, CURLOPT_HEADER, FALSE);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

    curl_setopt($ch, CURLOPT_HTTPGET, TRUE);

    curl_setopt($ch, CURLOPT_URL, "http://productsearch.linksynergy.com/productsearch?token=YOUR-LINKSHARE-TOKEN-ID-A-VERY-LONG-STRING&keyword=%22YOUR-KEYWORD%22&MaxResults=20&pagenumber=1&mid=MID-THE-ID-OF-THE-ADVERTIZER-WHO-HAS-ALLOWED-YOU&sort=retailprice&sorttype=asc&sort=productname&sorttype=asc");
$xml_data = curl_exec($ch);
curl_close($ch);

$object = simplexml_load_string($xml_data);

    foreach($object->item as $signprod)
    {}

under the foreach loop you can do what ever you want, just print_r($signprod) and you will get the details , put the keyword matching against your allowed advertiser's product, by helping you more say i have a relation with some cookies site, who's MID is xxxxx , then i write cookies in the keyword and it get results for me, do accordingly.在 foreach 循环下,您可以做任何您想做的事情,只需 print_r($signprod) 并且您将获得详细信息,将关键字与您允许的广告商的产品相匹配,通过帮助您更多地说我与某些 cookie 网站有关系,谁是MID 是 xxxxx ,然后我在关键字中写入 cookie 并为我获取结果,请执行相应操作。 its simple and yeah it will take a long time on net if someone is new like me, which i was before more than a month ago.它很简单,是的,如果有人像我一样是新人,那将需要很长时间才能上网,这是我一个多月前的经历。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM