前言我给你一套最简可运行代码只需要替换AppKey、AppSecret、AccessToken、店铺昵称就能直接获取店铺所有商品标题、价格、主图、销量、库存。一、你需要提前准备淘宝开放平台创建应用 → 获取app_keyapp_secretaccess_token店铺授权目标店铺昵称如xx 官方旗舰店二、最简 Python 代码直接复制运行python运行import requests import time import hashlib # 【必须替换成你自己的】 APP_KEY 你的AppKey APP_SECRET 你的AppSecret ACCESS_TOKEN 你的access_token SHOP_NICK 店铺昵称 # 例小米官方旗舰店 # 淘宝API签名函数 def sign(params): sorted_params sorted(params.items()) param_str .join(f{k}{v} for k, v in sorted_params) sign_str APP_SECRET param_str APP_SECRET return hashlib.md5(sign_str.encode()).hexdigest().upper() # 获取店铺商品一页最多200个 def get_taobao_shop_items(page_no1): params { method: taobao.items.onsale.get, # 获取在售商品 app_key: APP_KEY, session: ACCESS_TOKEN, fields: num_iid,title,price,pic_url,volume,sku, page_no: page_no, page_size: 200, format: json, v: 2.0, sign_method: md5, timestamp: time.strftime(%Y-%m-%d %H:%M:%S) } params[sign] sign(params) url https://eco.taobao.com/router/rest try: resp requests.post(url, dataparams, timeout10) return resp.json() except: return {} # 自动分页拉取【全店所有商品】 def get_all_shop_items(): all_items [] page 1 while True: print(f正在获取第 {page} 页...) data get_taobao_shop_items(page) try: # 解析商品列表 items data[taobao_items_onsale_get_response][items][item] if not items: break all_items.extend(items) page 1 time.sleep(1) # 限流必须加 except: break return all_items # 运行 if __name__ __main__: items get_all_shop_items() print(f\n✅ 共获取商品数量{len(items)}) # 输出前3个商品看看 for i, item in enumerate(items[:3]): print(f\n商品{i1}) print( ID, item[num_iid]) print( 标题, item[title]) print( 价格, item[price]) print( 主图, item[pic_url])三、返回的商品字段你能拿到什么plaintextnum_iid 商品ID title 商品标题 price 价格 pic_url 主图 volume 销量 sku 规格库存四、必须注意防封 / 防报错必须加 sleep (1)1 秒 1 页否则会被限流一页最多200 个商品没有权限会报401 / 403店铺昵称必须正确五、我可以帮你需要我帮你把商品保存成 JSON / Excel自动抓取 SKU、详情、描述做成可视化界面