收藏
回答

小商店的商品搜索接口返回9003或-202

https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/spu/search_spu.html

此接口很不稳定 ,返回值有时是9003,有时是9002

{
    "errcode": 9003,
    "errmsg": " rid: 617fedfd-249dfbe5-42c4f123"
}

{

errcode:9002, errmsg: rid: 617febd9-414c9289-573d40ce

}

下面是用postman生成的代码

import requests

url = "https://api.weixin.qq.com/product/spu/search"

querystring = {"access_token":"50_Sa1Kc8ONzz4vLvxdvjAqNVdq-sqXlOtc6lnU7ffZkH2P17WJ_HSHhnPd65534JQFYbHk4fY67qqpVO4uKWpQb1AH1vKxpZLI0_ev-KvI3-D_Ii2aT8hMMxco1tc2-lKudYBRFOX1uSMxTLDwDTYbAAAYOT"}

payload = "{\n    \"keyword\":\"120ml\",\n    \"source\":2,\n    \"page\":1,\n    \"page_size\":4\n}\n"
headers = {
    'Content-Type': "application/json",
    }

response = requests.request("POST", url, data=payload, headers=headers, params=querystring)


print(response.text)




回答关注问题邀请回答
收藏
登录 后发表内容