如何使用淘宝商品API 的 taobao.product.get?

我使用过淘宝客API的taobao.tbk.item.get, 成功拿到商品资料。但当我调用商品API 的 taobao.product.get, 我拿不到资料,也没有出现什么错误。

这是淘宝客API:

<?php

header('Content-Type: text/html; charset=utf-8');
require_once('TopSdk.php');

$c = new TopClient;
$c->appkey = 'appkey ';
$c->secretKey = 'secretKey ';
$req = new TbkItemInfoGetRequest;
$req->setFields("num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url");
$req->setPlatform("1");
$req->setNumIids("556420459115");
$resp = $c->execute($req);

echo 'title:';
echo $resp->results->n_tbk_item->title.'</br>';

?>

这是商品API 的 taobao.product.get:

<?php

header('Content-Type: text/html; charset=utf-8');
require_once('TopSdk.php');


$c = new TopClient;
$c->appkey = 'appkey ';
$c->secretKey = 'secretKey ';
$req = new ProductGetRequest;
$req->setCustomerProps("20000:优衣库:型号:001:632501:1234");
$req->setFields("product_id,outer_id");
$req->setProductId("556420459115");
$req->setCid("50012286");
$req->setProps("10005:10027;10006:29729");
$req->setMarketId("2");
$resp = $c->execute($req);

?>
阅读 6.7k
1 个回答

你查询的这个556420459115 这个产品是不存在的所以返回的是空

该接口是天猫商家发布商品时,查询关联产品信息时使用,非商品查询接口。
商品查询接口:taobao.item.seller.get

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题