一、简单说明(给程序员)
用途:通过商品 ID(sku/id)一键获取京东商品完整详情
获取数据:标题、价格、主图、详情、SKU、库存、品牌、店铺、发货地、参数等
优势:
比爬虫更稳定、更安全、官方支持
Python 代码极简,10 行完成请求
返回标准 JSON,直接解析、入库、同步商品
适用:商品同步、ERP 对接、价格监控、铺货、数据分析
二、Python 请求极简代码
python
运行
import requests# 京东 API 网关url = "https://api.jd.com/routerjson"# 请求参数params = {
"method": "jd.item.get", # 商品详情接口
"app_key": "你的AppKey", # 密钥
"sku_id": "100012345678", # 商品ID
"sign": "签名", # 自动生成
"v": "2.0",
"format": "json"}# 发送请求response = requests.get(url, params=params)json_data = response.json()# 输出结果print(json_data)三、标准 JSON 返回参考(商品详情)
json
{
"jd_item_get_response": {
"item": {
"sku_id": "100012345678",
"title": "Apple iPhone 15 手机 黑色 128G",
"price": "5999.00",
"img_url": "https://img14.360buyimg.com/xxx.jpg",
"detail_url": "https://item.jd.com/100012345678.html",
"brand": "Apple",
"shop_name": "京东自营",
"shop_type": "自营",
"stock": "有货",
"area": "中国大陆",
"weight": "200g",
"desc": "商品详情描述",
"sku_spec": "颜色:黑色;存储:128GB",
"cid": 9987,
"create_time": "2025-01-01"
}
}}四、一句话总结
Python + 京东商品详情 API =快速取商品全量信息、自动同步、稳定高效、程序员必备工具