淘宝/天猫获得店铺的所有商品 API 代码分享 返回值说明

item_search_shop-获得店铺的所有商品

请求代码分享

<?php

// 请求示例 url 默认请求参数已经URL编码处理
// 本示例代码未加密secret参数明文传输,若要加密请参考:https://open.onebound.cn/help/demo/sdk/demo-sign.php
$method = "GET";
$url = "https://服务器地址/taobao/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&shop_id=433655136&page=1&sort=";
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_ENCODING, "gzip");
var_dump(curl_exec($curl));
?>
响应参数
Version: Date:
名称
类型
必须
示例值
描述
num_iid
Bigint
0
579813460997
商品ID
pic_url
String
0
//img.alicdn.com/bao/uploaded/i3/478952498/O1CN011UK7q9WzgFGKQw8_!!478952498.jpg
图片地址
title
String
0
英伦小皮鞋女复古2020秋冬新款网红毛毛鞋女百搭外穿粗跟中跟单鞋
店铺标题
orginal_price
String
0
398.00
优惠价
price
Float
0
148
价格
sales
Int
0
7
销量
detail_url
String
0
//item.taobao.com/item.htm?id=579813460997
宝贝链接
公共参数
名称
类型
必须
描述
key
String
调用key(必须以GET方式拼接在URL中)
secret
String
调用密钥
api_name
String
API接口名称(包括在请求地址中)[item_search,item_get,item_search_shop等]
cache
String
[yes,no]默认yes,将调用缓存的数据,速度比较快
result_type
String
[json,jsonu,xml,serialize,var_export]返回数据格式,默认为json,jsonu输出的内容中文可以直接阅读
lang
String
[cn,en,ru]翻译语言,默认cn简体中文
version
String
API版本
请求参数
请求参数:shop_id=433655136&page=1&sort= 参数说明: shop_id:shop_id page:页码 sort:排序[new,bid,sale] (new 新品,bid:价格,sale:销量,bid加_前缀为从大到小排序)
posted @ 2023-03-20 11:28  女程序员喵喵  阅读(31)  评论(0)    收藏  举报