• 淘宝API接口,获取数据


    一、API如何使用
    1)开发者注册一个账号

    2)然后为每个 应用注册一个应用程序键(App Key) 。

    3)下载 API的SDK并掌握基本的API基础知识和调用

    4)利用SDK接口和对象,传入AppKey或者必要的时候获取并传入SessionKey来进行程序开发。

    5)利用平台的文档中心和API测试工具,对接口进行测试。从而了解返回信息,方便程序获取。

    以上是一般 API应用开发的关键流程,其中通过文档中心和API测试工具,进行概念了解和接口信息查询很重要。因为这些数据就是我们需要在逐步显示出来的。的API很多,不过都分为了好几个领域,慢慢就会了解深入了。

     请求参数

    请求参数:num_iid=666902640174&is_promotion=1

    参数说明:num_iid:淘宝商品ID
    is_promotion:是否获取取促销价

    API测试工具 

    公共参数

    名称类型必须描述
    keyString调用key(必须以GET方式拼接在URL中)
    secretString调用密钥
    api_nameStringAPI接口名称(包括在请求地址中)[item_search,item_get,item_search_shop等]
    cacheString[yes,no]默认yes,将调用缓存的数据,速度比较快
    result_typeString[json,jsonu,xml,serialize,var_export]返回数据格式,默认为json,jsonu输出的内容中文可以直接阅读
    langString[cn,en,ru]翻译语言,默认cn简体中文
    versionStringAPI版本

    数据得出

    1. Request address:
    2. https://api-gw.onebound.cn/taobao/item_get/?key=&
    3. &num_iid=666902640174&is_promotion=1&cache=no&&lang=zh-CN&secret=
    4. ---------------------------------------
    5. Result Object:
    6. ---------------------------------------
    7. {
    8. "item": {
    9. "num_iid": "666902640174",
    10. "title": "长款连衣裙女2022秋季新款气质流行V领轻熟风洋气减龄打底长裙子",
    11. "desc_short": "",
    12. "price": "298",
    13. "total_price": 0,
    14. "suggestive_price": 0,
    15. "orginal_price": "398.00",
    16. "nick": "戈萨妮亚旗舰店",
    17. "num": "200",
    18. "min_num": 0,
    19. "detail_url": "https://item.taobao.com/item.htm?id=666902640174",
    20. "pic_url": "//img.alicdn.com/imgextra/i1/1770983129/O1CN012IuyxI1Yz81jGVJ0w_!!0-item_pic.jpg",
    21. "brand": "戈萨妮亚",
    22. "brandId": "303948707",
    23. "rootCatId": "16",
    24. "cid": "50010850",
    25. "crumbs": [],
    26. "created_time": "",
    27. "modified_time": "",
    28. "delist_time": "",
    29. "desc": "",
    30. "desc_img": [],
    31. "item_imgs": [
    32. {
    33. "url": "//img.alicdn.com/imgextra/i1/1770983129/O1CN012IuyxI1Yz81jGVJ0w_!!0-item_pic.jpg"
    34. },
    35. {
    36. "url": "//img.alicdn.com/imgextra/i1/1770983129/O1CN015iYEAh1Yz81TqCKMs_!!1770983129.jpg"
    37. },
    38. {
    39. "url": "//img.alicdn.com/imgextra/i1/1770983129/O1CN01XdvVt11Yz81doUD8I_!!1770983129.jpg"
    40. },
    41. {
    42. "url": "//img.alicdn.com/imgextra/i3/1770983129/O1CN017N0Gl31Yz81gQspkO_!!1770983129.jpg"
    43. },
    44. {
    45. "url": "//img.alicdn.com/imgextra/i3/1770983129/O1CN01EvUh1g1Yz81l4WIT4_!!1770983129.jpg"
    46. }
    47. ],
    48. "item_weight": "",
    49. "item_size": "",
    50. "location": "北京",
    51. "post_fee": 0,
    52. "express_fee": null,
    53. "ems_fee": "",
    54. "shipping_to": "",
    55. "has_discount": "true",
    56. "video": [],
    57. "is_virtual": "",
    58. "sample_id": "",
    59. "is_promotion": "true",
    60. "props_name": "20509:28315:尺码:M;20509:28316:尺码:L;20509:28317:尺码:XL;20509:6145171:尺码:2XL;20509:115781:尺码:3XL;20509:3727387:尺码:4XL;1627207:28326:颜色分类:红色",
    61. "prop_imgs": {
    62. "prop_img": [
    63. {
    64. "properties": "1627207:28326",
    65. "url": "//img.alicdn.com/imgextra/i3/1770983129/O1CN01lLmJHo1Yz81fCYnXN_!!1770983129.jpg"
    66. }
    67. ]
    68. },
    69. "property_alias": "",
    70. "props": [
    71. {
    72. "name": "品牌",
    73. "value": "戈萨妮亚"
    74. },
    75. {
    76. "name": "适用年龄",
    77. "value": "35-39周岁"
    78. },
    79. {
    80. "name": "尺码",
    81. "value": "M L XL 2XL 3XL 4XL"
    82. },
    83. {
    84. "name": "面料",
    85. "value": "其他"
    86. },
    87. {
    88. "name": "图案",
    89. "value": "纯色"
    90. },
    91. {
    92. "name": "风格",
    93. "value": "通勤"
    94. },
    95. {
    96. "name": "通勤",
    97. "value": "简约"
    98. },
    99. {
    100. "name": "领型",
    101. "value": "V领"
    102. },
    103. {
    104. "name": "腰型",
    105. "value": "中腰"
    106. },
    107. {
    108. "name": "衣门襟",
    109. "value": "套头"
    110. },
    111. {
    112. "name": "颜色分类",
    113. "value": "红色"
    114. },
    115. {
    116. "name": "袖型",
    117. "value": "常规"
    118. },
    119. {
    120. "name": "组合形式",
    121. "value": "单件"
    122. },
    123. {
    124. "name": "货号",
    125. "value": "GS22B2207"
    126. },
    127. {
    128. "name": "裙型",
    129. "value": "A字裙"
    130. },
    131. {
    132. "name": "适用季节",
    133. "value": "春季"
    134. },
    135. {
    136. "name": "年份季节",
    137. "value": "2022年春季"
    138. },
    139. {
    140. "name": "袖长",
    141. "value": "长袖"
    142. },
    143. {
    144. "name": "裙长",
    145. "value": "长裙"
    146. },
    147. {
    148. "name": "流行元素/工艺",
    149. "value": "印花"
    150. },
    151. {
    152. "name": "款式",
    153. "value": "其他/other"
    154. },
    155. {
    156. "name": "销售渠道类型",
    157. "value": "纯电商(只在线上销售)"
    158. },
    159. {
    160. "name": "廓形",
    161. "value": "A型"
    162. },
    163. {
    164. "name": "材质成分",
    165. "value": "聚酯纤维95% 聚氨酯弹性纤维(氨纶)5%"
    166. }
    167. ],
    168. "total_sold": "85",
    169. "skus": {
    170. "sku": [
    171. {
    172. "price": "298",
    173. "total_price": 0,
    174. "orginal_price": "298",
    175. "properties": "20509:28315;1627207:28326",
    176. "properties_name": "20509:28315:尺码:M;1627207:28326:颜色分类:红色",
    177. "quantity": "78",
    178. "sku_id": "4985007239455"
    179. },
    180. {
    181. "price": "298",
    182. "total_price": 0,
    183. "orginal_price": "298",
    184. "properties": "20509:28316;1627207:28326",
    185. "properties_name": "20509:28316:尺码:L;1627207:28326:颜色分类:红色",
    186. "quantity": "79",
    187. "sku_id": "4985007239456"
    188. },
    189. {
    190. "price": "298",
    191. "total_price": 0,
    192. "orginal_price": "298",
    193. "properties": "20509:28317;1627207:28326",
    194. "properties_name": "20509:28317:尺码:XL;1627207:28326:颜色分类:红色",
    195. "quantity": "74",
    196. "sku_id": "4985007239457"
    197. },
    198. {
    199. "price": "298",
    200. "total_price": 0,
    201. "orginal_price": "298",
    202. "properties": "20509:6145171;1627207:28326",
    203. "properties_name": "20509:6145171:尺码:2XL;1627207:28326:颜色分类:红色",
    204. "quantity": "76",
    205. "sku_id": "4985007239458"
    206. },
    207. {
    208. "price": "298",
    209. "total_price": 0,
    210. "orginal_price": "298",
    211. "properties": "20509:115781;1627207:28326",
    212. "properties_name": "20509:115781:尺码:3XL;1627207:28326:颜色分类:红色",
    213. "quantity": "79",
    214. "sku_id": "4985007239459"
    215. },
    216. {
    217. "price": "298",
    218. "total_price": 0,
    219. "orginal_price": "298",
    220. "properties": "20509:3727387;1627207:28326",
    221. "properties_name": "20509:3727387:尺码:4XL;1627207:28326:颜色分类:红色",
    222. "quantity": "79",
    223. "sku_id": "4985007239460"
    224. }
    225. ]
    226. },
    227. "seller_id": "1770983129",
    228. "sales": 100,
    229. "shop_id": "106215633",
    230. "props_list": {
    231. "20509:28315": "尺码:M",
    232. "20509:28316": "尺码:L",
    233. "20509:28317": "尺码:XL",
    234. "20509:6145171": "尺码:2XL",
    235. "20509:115781": "尺码:3XL",
    236. "20509:3727387": "尺码:4XL",
    237. "1627207:28326": "颜色分类:红色"
    238. },
    239. "seller_info": {
    240. "nick": "戈萨妮亚旗舰店",
    241. "item_score": "4.9 ",
    242. "score_p": "4.9 ",
    243. "delivery_score": "4.9 ",
    244. "shop_type": "B",
    245. "user_num_id": "1770983129",
    246. "sid": "106215633",
    247. "title": "戈萨妮亚旗舰店",
    248. "zhuy": "https://shop106215633.taobao.com/",
    249. "shop_name": "戈萨妮亚旗舰店"
    250. },
    251. "tmall": true,
    252. "error": "",
    253. "warning": "",
    254. "url_log": [],
    255. "fav_count": "1654",
    256. "fans_count": "4.8万",
    257. "freight": "快递: 免运费",
    258. "props_imgs": {
    259. "prop_img": [
    260. {
    261. "properties": "1627207:28326",
    262. "url": "//img.alicdn.com/imgextra/i3/1770983129/O1CN01lLmJHo1Yz81fCYnXN_!!1770983129.jpg"
    263. }
    264. ]
    265. },
    266. "_ddf": "xdl",
    267. "promo_type": null,
    268. "props_img": {
    269. "1627207:28326": "//img.alicdn.com/imgextra/i3/1770983129/O1CN01lLmJHo1Yz81fCYnXN_!!1770983129.jpg"
    270. },
    271. "format_check": "ok",
    272. "shop_item": [],
    273. "relate_items": []
    274. },
    275. "error": "",
    276. "secache": "780cd33a1221e7ecb267977f2de5971f",
    277. "secache_time": 1660638239,
    278. "secache_date": "2022-08-16 16:23:59",
    279. "translate_status": "",
    280. "translate_time": 0,
    281. "language": {
    282. "default_lang": "cn",
    283. "current_lang": "cn"
    284. },
    285. "reason": "",
    286. "error_code": "0000",
    287. "cache": 0,
    288. "api_info": "today:83 max:10100 all[192=83+49+60];expires:2030-12-31",
    289. "execution_time": "7.488",
    290. "server_time": "Beijing/2022-08-16 16:23:59",
    291. "client_ip": "106.6.39.226",
    292. "call_args": {
    293. "num_iid": "666902640174",
    294. "is_promotion": "1"
    295. },
    296. "api_type": "taobao",
    297. "translate_language": "zh-CN",
    298. "translate_engine": "google_new",
    299. "server_memory": "5.91MB",
    300. "request_id": "gw-1.62fb5418368bc",
    301. "last_id": "1154524625"
    302. }

  • 相关阅读:
    从C语言到C++_40(多线程相关)C++线程接口+线程安全问题加锁(shared_ptr+STL+单例)
    Python基于随机游走模型的PageRank算法及应用
    Qt 堆栈窗体QStackedWidget使用
    iOS .a类型静态库使用终端进行拆解和合并生成
    leetcode刷题:栈与队列02(用队列实现栈)
    【动态规划 状态机dp 性能优化】3098. 求出所有子序列的能量和
    项目经理如何做好任务分解,制定项目计划
    语雀P0级故障复盘,有9个字亮了
    助力智慧交通,开发构建道路交通场景下智能车辆检测识别系统
    Qt6.3.2下QChart的使用
  • 原文地址:https://blog.csdn.net/api_Anzexi/article/details/126368853