淘宝/天猫按关键字搜索商品的API接口返回值通常包含以下信息:
item_search-
taobao.item_search
公共参数
请求地址: https://o0b.cn/jelena
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
key | String | 是 | 调用key(必须以GET方式拼接在URL中) |
secret | String | 是 | 点击注册账号获取Key |
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版本 请求参数 |
请求参数:q=女装&start_price=0&end_price=0&page=1&cat=0&discount_only=&sort=&page_size=&seller_info=&nick=&ppath=&imgid=&filter=
参数说明:q:搜索关键字
page:页数
响应参数
Version: Date:
名称 | 类型 | 必须 | 示例值 | 描述 |
---|---|---|---|---|
items | items[] | 0 | 按关键字搜索淘宝商品 | |
page | Int | 0 | 1 | 页码 |
real_total_results | Int | 0 | 360000 | 商品数量 |
total_results | Int | 0 | 360000 | 商品数量 |
page_size | Int | 0 | 10 | 接口返回数量 |
pagecount | Int | 0 | 200 | 总页数 |
item | item[] | 0 | 商品详情数据 | |
item_weight_update | Int | 0 | 0 | 请求示例 |
- 复制
-- 请求示例 url 默认请求参数已经URL编码处理
curl -i "https://api-gw.onebound.cn/taobao/item_search/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&q=女装&start_price=0&end_price=0&page=1&cat=0&discount_only=&sort=&page_size=&seller_info=&nick=&ppath=&imgid=&filter="
响应示例
复制
{
"items": {
"page": "1",
"real_total_results": "360000",
"total_results": "360000",
"page_size": 10,
"pagecount": "200",
"_ddf": "szx",
"item": [
{
"title": "高腰百搭羊羔绒阔腿裤冬季保暖",
"pic_url": "https://img.alicdn.com/img/bao/uploaded/i4/O1CN01TpegE82EAUGWQD2JI_!!0-item_pic.jpg",
"promotion_price": "50.00",
"orginal_price": "50.00",
"price": "50.00",
"sales": 0,
"num_iid": "756775095301",
"seller_id": "1704328704",
"detail_url": "https://item.taobao.com/item.htm?id=756775095301"
},
{
"title": "德绒圆领打底衫短款修身内搭长袖T恤女秋冬纯色弧形小众百搭上衣",
"pic_url": "https://img.alicdn.com/img/bao/uploaded/i4/O1CN01xuzAuZ2LY21GBhlfE_!!3937219703-0-C2M.jpg",
"promotion_price": "44.40",
"orginal_price": "44.40",
"price": "44.40",
"sales": 0,
"num_iid": "825927041956",
"seller_id": "3937219703",
"detail_url": "https://item.taobao.com/item.htm?id=825927041956"
},
{
"title": "美式辣妹螺纹修身女打底衫长袖",
"pic_url": "https://img.alicdn.com/img/bao/uploaded/i4/O1CN010d2Jxj1ZOJwsXSEHg_!!862293184.jpg",
"promotion_price": "58.00",
"orginal_price": "58.00",
"price": "58.00",
"sales": 0,
"num_iid": "735775262176",
"seller_id": "862293184",
"detail_url": "https://item.taobao.com/item.htm?id=735775262176"
},
{
"title": "2024年新款高腰复古牛仔裤女秋季",
"pic_url": "https://img.alicdn.com/img/bao/uploaded/i4/O1CN01YfwUGX1h1tbd5rczJ_!!2206584264218-0-C2M.jpg",
"promotion_price": "59.85",
"orginal_price": "59.85",
"price": "59.85",
"sales": 0,
"num_iid": "837243885999",
"seller_id": "2206584264218",
"detail_url": "https://item.taobao.com/item.htm?id=837243885999"
},
{
"title": "【秋冬绝美可单穿慵懒小上衣】",
"pic_url": "https://img.alicdn.com/img/bao/uploaded/i4/O1CN01m6HRZH1zxkhIMd3OG_!!0-item_pic.jpg",
"promotion_price": "57.00",
"orginal_price": "57.00",
"price": "57.00",
"sales": 0,
"num_iid": "818387607863",
"seller_id": "2209434566781",
"detail_url": "https://item.taobao.com/item.htm?id=818387607863"
},
{
"title": "秋季新款复古高腰阔腿牛仔裤女宽松显瘦垂感拖地直筒长裤水洗做旧",
"pic_url": "https://img.alicdn.com/img/bao/uploaded/i4/O1CN01aJeIvR1mQEi3d7tnq_!!2206588314948-2-C2M.jpg",
"promotion_price": "74.85",
"orginal_price": "74.85",
"price": "74.85",
"sales": 0,
"num_iid": "819491929229",
"seller_id": "2206588314948",
"detail_url": "https://item.taobao.com/item.htm?id=819491929229"
},
{
"title": "美式复古豹纹牛仔裤女男夏季潮牌小众阔腿裤宽松垂感休闲长裤腰带",
"pic_url": "https://img.alicdn.com/img/bao/uploaded/i4/O1CN01fQC8Vc2LY21fSyrpo_!!3937219703-0-C2M.jpg",
"promotion_price": "55.80",
"orginal_price": "55.80",
"price": "55.80",
"sales": 0,
"num_iid": "797999211515",
"seller_id": "3937219703",
"detail_url": "https://item.taobao.com/item.htm?id=797999211515"
使用淘宝/天猫API接口时,需要先在淘宝开放平台注册开发者账号并获取API密钥。然后,根据API文档构建HTTP请求,发送到API接口,并处理返回的响应数据。开发者可以根据自己的需求,将搜索结果以列表、图片轮播等形式呈现给用户,提供便捷的购物体验。