接口名称:item_search 关键词搜索拼多多商品列表
调用方式:支持GET、POST
公共参数
名称 | 类型 | 必须 | 描述 |
---|---|---|---|
key | String | 是 | 调用key |
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版本 |
请求参数
请求参数:q=女装&start_price=0&end_price=0&page=1&cat=0&discount_only=&sort=&page_size=
参数说明:q:关键词, sort:排序[bid,_bid,_sale,sale] (bid:商品价格,sale:销量,加_前缀为从大到小排序)
响应参数
名称 | 类型 | 必须 | 示例值 | 描述 |
---|---|---|---|---|
items | items[] | 0 | 根据关键词取商品列表 | |
title | String | 0 | 啄木鸟双面穿棉衣女2020冬装加厚宽松韩版棉袄小个子羽绒棉外套冬 | 商品标题 |
pic_url | String | 0 | https://t00img.yangkeduo.com/goods/images/2020-12-08/1226cd586487b63527d86fdabb8608cc.jpeg | 宝贝图片 |
price | Float | 0 | 198 | 价格 |
promotion_price | Float | 0 | 198 | 优惠价格 |
sales | Int | 0 | 14830 | 销量 |
num_iid | Bigint | 0 | 203344831134 | 宝贝ID |
sample_id | String | 0 | 商品风格标识ID | |
seller_nick | String | 0 | 时沫女装专营店 | 掌柜昵称 |
post_fee | Float | 0 | 物流费用 | |
area | String | 0 | 店铺所在地 | |
detail_url | String | 0 | http://yangkeduo.com/goods.html?goods_id=203344831134 | 宝贝链接 |
请求示例(代码展示)
支持curl、PHP、PHPsdk、Java、C#、Python等语言程序调用。下面是Python语言代码展示:
# coding:utf-8
"""
Compatible for python2.x and python3.x
requirement: pip install requests
"""
from __future__ import print_function
import requests
# 请求示例 url 默认请求参数已经做URL编码
url = "https://服务器地址/pinduoduo/item_search/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&q=女装&start_price=0&end_price=0&page=1&cat=0&discount_only=&sort=&page_size="
headers = {
"Accept-Encoding": "gzip",
"Connection": "close"
}
if __name__ == "__main__":
r = requests.get(url, headers=headers)
json_obj = r.json()
print(json_obj)
对电商API接口感兴趣的朋友,欢迎评论区交流分享。