Tmall商品详情API接口

该博客介绍了Tmall商品详情API接口的数据结构和内容,包括esi模块、交易信息、卖家信息、商品信息等详细数据,如商品描述、评分、物流服务等,展示了如何获取和解析天猫超市商品的相关信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

{
“api”: “wdetail”,
“v”: “6.0”,
“ret”: [“SUCCESS::调用成功”],
“data”: {
“apiStack”: [{
“name”: “esi”,
“value”: “{\”feature\”:{\”makeup\”:\”false\”,\”isVirtualRechargeItem\”:\”false\”,\”dailyPrice\”:\”true\”,\”seriesFlag\”:\”true\”,\”isDonateItem\”:\”false\”,\”bSeller\”:\”true\”,\”useMeiLiHuiPrice\”:\”false\”,\”smTaskGuiding\”:\”true\”,\”o2O\”:\”false\”,\”showCommonBanner\”:\”false\”,\”cainiaoSpecial\”:\”true\”,\”guessYouLike\”:\”false\”,\”tmallSupermarket\”:\”true\”,\”isXiaXuan\”:\”false\”,\”isJuPinTuan\”:\”false\”,\”supermarketMiniShopLocationUp\”:\”true\”,\”abNewDetailRoute\”:\”false\”,\”nabundleItem\”:\”false\”,\”hasSku\”:\”false\”,\”bundleItem\”:\”false\”,\”wygProtect\”:\”true\”,\”hasCartRecommend\”:\”false\”,\”openNewSku\”:\”true\”,\”mcEndorsement\”:\”true\”,\”hasBrandScene\”:\”false\”,\”fmcgRecommend\”:\”false\”,\”superActTime\”:\”false\”,\”isXinxuan\”:\”false\”,\”labelPro\”:\”true\”,\”notUseVip95CardBar\”:\”false\”,\”hasApparelIcon\”:\”false\”,\”openGradient\”:\”true\”,\”isCloudChanger\”:\”false\”,\”bybtForTmall\”:\”true\”,\”hideAsk\”:\”false\”,\”overSeaBuy\”:\”false\”,\”wygItem\”:\”false\”,\”hasIntervalPrice\”:\”true\”,\”isDamai\”:\”false\”,\”waitForStart\”:\”false\”,\”newAddress\”:\”true\”,\”hideSMww\”:\”true\”,\”useNewRate\”:\”false\”,\”renovation\”:\”false\”,\”enablePriceAttract\”:\”false\”,\”hasAddCartCoudan\”:\”false\”,\”showLive\”:\”true\”,\”showCuntaoTag\”:\”false\”,\”showInteractionBarRecommend\”:\”true\”,\”recommendReason\”:\”false\”,\”switchToOldApp\”:\”false\”,\”isNewShareGift\”:\”false\”,\”hideShopDsr\”:\”false\”,\”newPrice\”:\”true\”,\”pricedCoupon\”:\”false\”,\”hasCoupon\”:\”false\”,\”buhuo\”:\”false\”,\”xinxuanRec\”:\”false\”,\”showNewPersonBag\”:\”false\”,\”showSku\”:\”false\”,\”showShopCard\”:\”false\”,\”forceNaviAlpha\”:\”true\”,\”showYaoDai\”:\”false\”,\”useBenifitNew\”:\”false\”,\”isXXSale\”:\”false\”,\”enableDpbModule\”:\”false\”,\”showLiteAppRec\”:\”false\”,\”customSkuImage\”:\”false\”,\”closefindsimilar\”:\”true\”,\”showTmallApp\”:\”false\”,\”showEncyclopedia\”:\”false\”,\”hasNewCombo\”:\”false\”,\”smBottomGuessYouLike\”:\”true\”,\”noShareGroup\”:\”true\”,\”hideWangwang\”:\”true\”,\”showInteractionBar\”:\”true\”,\”enableBusiness2020\”:\”true\”,\”showSkuProRate\”:\”true\”,\”hasAddTmallCartCoudan\”:\”true\”,\”useVip95CardStyle\”:\”false\”,\”multistage\”:\”false\”,\”hasQualification\”:\”false\”,\”showShopV4\”:\”false\”,\”cartCoupon\”:\”true\”,\”isTspace\”:\”false\”,\”hasBrandevent\”:\”false\”,\”series\”:\”false\”,\”isTTSale\”:\”false\”,\”hideDsrNew\”:\”false\”,\”newIndicator\”:\”true\”,\”shareGroup\”:\”false\”,\”showSMww\”:\”false\”,\”smSpeBottomBar\”:\”false\”,\”isShopVipMember\”:\”false\”,\”includeSkuData\”:\”true\”},\”trade\”:{\”isWap\”:\”false\”,\”useWap\”:\”true\”,\”cartJumpUrl\”:\”

Mtop API 中的 `mtop.tmall.search.searchShopWithItem` 是阿里巴巴开放平台(MTop)的一个商品搜索接口,用于查询天猫店铺信息以及相关商品详情。这个API允许开发者通过传递特定参数来搜索指定的商品ID或店铺ID,从而获得店铺信息、热销商品等数据。 引用指出,在处理从JSON字符串接收的数据时,可能需要注意去除BOM头,特别是在PHP中。因为BOM头(Byte Order Mark,如`\uFEFF`)通常是编码声明的一部分,如果不移除,可能会干扰到JSON解析: ```php $info = trim($info, chr(239).chr(187).chr(191)); // 去除BOM头 $json_data = json_decode($info, true); // 解析JSON字符串 ``` 引用链接提供了一个更详细的上下文,但没有直接提到 `mtop.tmall.search.searchShopWithItem`,而是关于JSON处理的一般技巧。因此,实际调用这个接口通常涉及发送HTTP请求,并以如下形式构造URL: ```php $url = "https://eco.taobao.com/router/rest"; $data = [ 'method': 'mtop.tmall.search.searchShopWithItem', 'params': { 'itemId': 'your_item_id', // 商品ID 'fields': '店铺名称,商品信息', // 请求的字段 }, 'format': 'json', 'api_key': 'your_api_key', // 阿里巴巴MTop API密钥 'sign_method': 'md5', 'sign': 'calculate_signature_with_data_and_secret' // 使用签名算法对数据和密钥进行加密 ]; // 发送POST请求 $response = file_get_contents($url, false, stream_context_create([ 'http' => [ 'method' => 'POST', 'header' => "Content-Type: application/json\r\n", 'content' => json_encode($data), ] ])); $json_result = json_decode($response, true); ``` 注意替换 `'your_item_id'`, `'your_api_key'` 和签名计算逻辑 (`'calculate_signature_with_data_and_secret'`)。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值