• 实现自动化获取1688商品详情数据接口经验分享


    获取电商平台商品详情数据,主要用过的是爬虫技术,过程比较曲折,最终结果是好的。我将代码都封装在1688.item_get接口中,直接调用此接口可以一步抓取。

    展示一下获取成功示例:

    1688商品详情页展示

    传入商品ID调用item_get获取数据

    响应示例

    1. {
    2. item: {
    3. num_iid: "734672214905",
    4. title: "2023外贸亚马逊速卖通欧美名媛贵妇晚宴轻熟气质女士刺绣连衣裙S",
    5. desc_short: "",
    6. price: "25.90",
    7. total_price: 0,
    8. suggestive_price: 0,
    9. orginal_price: "25.90",
    10. nick: "广州壹顺服饰有限公司",
    11. num: "149654",
    12. min_num: "2",
    13. detail_url: "https://detail.1688.com/offer/734672214905.html",
    14. pic_url: "https://cbu01.alicdn.com/img/ibank/O1CN010fV9Ul1GqHNpZ0Rss_!!2831370673-0-cib.jpg",
    15. brand: "",
    16. brandId: "",
    17. rootCatId: "10166",
    18. cid: "1031910",
    19. crumbs: [ ],
    20. created_time: "",
    21. modified_time: "",
    22. delist_time: "",
    23. desc: "
      0">

      //cbu01.alicdn.com/img/ibank/O1CN01cq6TdB1GqHO7Q4z1e_!!2831370673-0-cib.jpg"/>

      ",
    24. desc_img: [
    25. "https://cbu01.alicdn.com/img/ibank/O1CN01cq6TdB1GqHO7Q4z1e_!!2831370673-0-cib.jpg",
    26. "https://cbu01.alicdn.com/img/ibank/O1CN016Z7AWG1GqHOPHdNbB_!!2831370673-0-cib.jpg?__r__=1684568299970",
    27. "https://cbu01.alicdn.com/img/ibank/O1CN01s3necJ1GqHOVSTyiq_!!2831370673-0-cib.jpg?__r__=1684568299971",
    28. "https://cbu01.alicdn.com/img/ibank/O1CN01Dny9Ao1GqHOUro8KX_!!2831370673-0-cib.jpg?__r__=1684568299971",
    29. "https://cbu01.alicdn.com/img/ibank/O1CN01nXEeQx1GqHNnuyyIV_!!2831370673-0-cib.jpg",
    30. "https://cbu01.alicdn.com/img/ibank/O1CN01iDeOO01GqHNoM2Kwo_!!2831370673-0-cib.jpg",
    31. "https://cbu01.alicdn.com/img/ibank/O1CN01UfJZ0a1GqHNgQ58Wh_!!2831370673-0-cib.jpg",
    32. "https://cbu01.alicdn.com/img/ibank/O1CN01fvVImH1GqHNjvmFVb_!!2831370673-0-cib.jpg",
    33. "https://cbu01.alicdn.com/img/ibank/O1CN01Wnr7QN1GqHNeNPPmC_!!2831370673-0-cib.jpg",
    34. "https://cbu01.alicdn.com/img/ibank/O1CN017vrKet1GqHNlSFGJb_!!2831370673-0-cib.jpg"
    35. ],
    36. item_imgs: [
    37. {
    38. url: "https://cbu01.alicdn.com/img/ibank/O1CN010fV9Ul1GqHNpZ0Rss_!!2831370673-0-cib.jpg"
    39. },
    40. {
    41. url: "https://cbu01.alicdn.com/img/ibank/O1CN01mz3HkK1GqHNmBK4Jh_!!2831370673-0-cib.jpg"
    42. },
    43. {
    44. url: "https://cbu01.alicdn.com/img/ibank/O1CN01pOxOa91GqHNirInSe_!!2831370673-0-cib.jpg"
    45. },
    46. {
    47. url: "https://cbu01.alicdn.com/img/ibank/O1CN011eMgxW1GqHNgPkjCo_!!2831370673-0-cib.jpg"
    48. },
    49. {
    50. url: "https://cbu01.alicdn.com/img/ibank/O1CN01Nys0yw1GqHOOa2c8h_!!2831370673-0-cib.jpg"
    51. },
    52. {
    53. url: "https://cbu01.alicdn.com/img/ibank/O1CN01C2elgI1GqHNpUPCYf_!!2831370673-0-cib.jpg"
    54. },
    55. {
    56. url: "https://cbu01.alicdn.com/img/ibank/O1CN01aBgJrH1GqHNoM0rE7_!!2831370673-0-cib.jpg"
    57. },
    58. {
    59. url: "https://cbu01.alicdn.com/img/ibank/O1CN01CM4kGc1GqHNlSBVBB_!!2831370673-0-cib.jpg"
    60. }
    61. ],
    62. item_weight: "",
    63. item_size: "",
    64. location: "广东省广州市",
    65. post_fee: 8,
    66. express_fee: "",
    67. ems_fee: "",
    68. shipping_to: "",
    69. has_discount: "",
    70. video: "",
    71. is_virtual: "",
    72. sample_id: "",
    73. is_promotion: "",
    74. props_name: "0:0:颜色:黑色;0:1:颜色:白色;0:2:颜色:红色;1:0:尺码:S;1:1:尺码:M;1:2:尺码:L;1:3:尺码:XL;1:4:尺码:XXL",
    75. prop_imgs: {
    76. prop_img: [
    77. {
    78. properties: "0:0",
    79. url: "https://cbu01.alicdn.com/img/ibank/O1CN01C2elgI1GqHNpUPCYf_!!2831370673-0-cib.jpg"
    80. },
    81. {
    82. properties: "0:1",
    83. url: "https://cbu01.alicdn.com/img/ibank/O1CN01CM4kGc1GqHNlSBVBB_!!2831370673-0-cib.jpg"
    84. },
    85. {
    86. properties: "0:2",
    87. url: "https://cbu01.alicdn.com/img/ibank/O1CN01aBgJrH1GqHNoM0rE7_!!2831370673-0-cib.jpg"
    88. }
    89. ]
    90. },
    91. property_alias: "0:0:黑色;0:1:白色;0:2:红色;1:0:S;1:1:M;1:2:L;1:3:XL;1:4:XXL",
    92. props: [
    93. {
    94. name: "面料名称",
    95. show: false,
    96. value: "棉涤"
    97. },
    98. {
    99. name: "图案",
    100. show: false,
    101. value: "纯色"
    102. },
    103. {
    104. name: "工艺",
    105. show: false,
    106. value: "刺绣/绣花"
    107. },
    108. {
    109. name: "产地",
    110. show: false,
    111. value: "广州"
    112. },
    113. {
    114. name: "款式",
    115. show: false,
    116. value: "吊带款"
    117. },
    118. {
    119. name: "组合形式",
    120. show: false,
    121. value: "单件"
    122. },
    123. {
    124. name: "裙长",
    125. show: false,
    126. value: "中长裙"
    127. },
    128. {
    129. name: "裙型",
    130. show: false,
    131. value: "A字裙"
    132. },
    133. {
    134. name: "领型",
    135. show: false,
    136. value: "V字领"
    137. },
    138. {
    139. name: "袖型",
    140. show: false,
    141. value: "无袖"
    142. },
    143. {
    144. name: "袖长",
    145. show: false,
    146. value: "无袖"
    147. },
    148. {
    149. name: "腰型",
    150. show: false,
    151. value: "中腰"
    152. },
    153. {
    154. name: "流行元素",
    155. show: false,
    156. value: "勾花"
    157. },
    158. {
    159. name: "上市年份/季节",
    160. show: false,
    161. value: "2023年秋季"
    162. },
    163. {
    164. name: "主面料成分",
    165. show: false,
    166. value: "棉"
    167. },
    168. {
    169. name: "货号",
    170. show: false,
    171. value: "1018s"
    172. },
    173. {
    174. name: "颜色",
    175. show: false,
    176. value: "黑色,白色,红色"
    177. },
    178. {
    179. name: "尺码",
    180. show: false,
    181. value: "S,M,L,XL,XXL"
    182. },
    183. {
    184. name: "风格类型",
    185. show: false,
    186. value: "私服名媛"
    187. },
    188. {
    189. name: "门襟",
    190. show: false,
    191. value: "套头"
    192. },
    193. {
    194. name: "主面料成分含量",
    195. show: false,
    196. value: "30%(含)-50%(不含)"
    197. },
    198. {
    199. name: "风格",
    200. show: false,
    201. value: "名媛风"
    202. },
    203. {
    204. name: "跨境风格类型",
    205. show: false,
    206. value: "气质优雅"
    207. },
    208. {
    209. name: "是否跨境货源",
    210. show: false,
    211. value: "是"
    212. },
    213. {
    214. name: "主要下游销售地区1",
    215. show: false,
    216. value: "欧美"
    217. },
    218. {
    219. name: "主要下游销售地区2",
    220. show: false,
    221. value: "其他"
    222. }
    223. ],
    224. total_sold: null,
    225. skus: {
    226. sku: [
    227. {
    228. price: "25.90",
    229. total_price: 0,
    230. sales: "0",
    231. properties: "0:0;1:0",
    232. properties_name: "0:0:颜色:黑色;1:0:尺码:S",
    233. quantity: "9978",
    234. sku_id: "5249324174390",
    235. spec_id: "eb81c61de14f4adb405ffcc2c8a4a3fb"
    236. },
    237. {
    238. price: "25.90",
    239. total_price: 0,
    240. sales: "0",
    241. properties: "0:0;1:1",
    242. properties_name: "0:0:颜色:黑色;1:1:尺码:M",
    243. quantity: "9943",
    244. sku_id: "5249324174391",
    245. spec_id: "4b2120e532948daa11e58e09bb260801"
    246. },
    247. {
    248. price: "25.90",
    249. total_price: 0,
    250. sales: "0",
    251. properties: "0:0;1:2",
    252. properties_name: "0:0:颜色:黑色;1:2:尺码:L",
    253. quantity: "9947",
    254. sku_id: "5249324174392",
    255. spec_id: "b99ece08861a79e13a4dba90e97ebff8"
    256. },
    257. {
    258. price: "25.90",
    259. total_price: 0,
    260. sales: "0",
    261. properties: "0:0;1:3",
    262. properties_name: "0:0:颜色:黑色;1:3:尺码:XL",
    263. quantity: "9950",
    264. sku_id: "5249324174393",
    265. spec_id: "5c337082186ff55b2d8267560ac89d59"
    266. },
    267. {
    268. price: "25.90",
    269. total_price: 0,
    270. sales: "0",
    271. properties: "0:0;1:4",
    272. properties_name: "0:0:颜色:黑色;1:4:尺码:XXL",
    273. quantity: "9925",
    274. sku_id: "5249324174394",
    275. spec_id: "dc048f4577f72dd6b932615edef1fab6"
    276. },
    277. {
    278. price: "25.90",
    279. total_price: 0,
    280. sales: "0",
    281. properties: "0:1;1:0",
    282. properties_name: "0:1:颜色:白色;1:0:尺码:S",
    283. quantity: "9992",
    284. sku_id: "5249324174395",
    285. spec_id: "94d1d179497744028aa76873afdeba62"
    286. },
    287. {
    288. price: "25.90",
    289. total_price: 0,
    290. sales: "0",
    291. properties: "0:1;1:1",
    292. properties_name: "0:1:颜色:白色;1:1:尺码:M",
    293. quantity: "9991",
    294. sku_id: "5249324174396",
    295. spec_id: "cef93beef156f1799e736c649f36efae"
    296. },
    297. {
    298. price: "25.90",
    299. total_price: 0,
    300. sales: "0",
    301. properties: "0:1;1:2",
    302. properties_name: "0:1:颜色:白色;1:2:尺码:L",
    303. quantity: "9984",
    304. sku_id: "5249324174397",
    305. spec_id: "82114cbd2c10b5e97b01af1510807e2d"
    306. },
    307. {
    308. price: "25.90",
    309. total_price: 0,
    310. sales: "0",
    311. properties: "0:1;1:3",
    312. properties_name: "0:1:颜色:白色;1:3:尺码:XL",
    313. quantity: "9993",
    314. sku_id: "5249324174398",
    315. spec_id: "c45d8408137e34adf8e695250c42a2e9"
    316. },
    317. {
    318. price: "25.90",
    319. total_price: 0,
    320. sales: "0",
    321. properties: "0:1;1:4",
    322. properties_name: "0:1:颜色:白色;1:4:尺码:XXL",
    323. quantity: "9993",
    324. sku_id: "5249324174399",
    325. spec_id: "df78564262818d6eb0c428a37ab4a251"
    326. },
    327. {
    328. price: "25.90",
    329. total_price: 0,
    330. sales: "0",
    331. properties: "0:2;1:0",
    332. properties_name: "0:2:颜色:红色;1:0:尺码:S",
    333. quantity: "9994",
    334. sku_id: "5249324174400",
    335. spec_id: "4b3436849e25eacb755f6f29ea09e809"
    336. },
    337. {
    338. price: "25.90",
    339. total_price: 0,
    340. sales: "0",
    341. properties: "0:2;1:1",
    342. properties_name: "0:2:颜色:红色;1:1:尺码:M",
    343. quantity: "9993",
    344. sku_id: "5249324174401",
    345. spec_id: "a105e7d232cfb509d4253d59cfe30bbd"
    346. },
    347. {
    348. price: "25.90",
    349. total_price: 0,
    350. sales: "0",
    351. properties: "0:2;1:2",
    352. properties_name: "0:2:颜色:红色;1:2:尺码:L",
    353. quantity: "9991",
    354. sku_id: "5249324174402",
    355. spec_id: "3dbe840b47bcb8f849bff38fc1f049fb"
    356. },
    357. {
    358. price: "25.90",
    359. total_price: 0,
    360. sales: "0",
    361. properties: "0:2;1:3",
    362. properties_name: "0:2:颜色:红色;1:3:尺码:XL",
    363. quantity: "9991",
    364. sku_id: "5249324174403",
    365. spec_id: "ce7fb37f848bc060cfece58cfbe38c19"
    366. },
    367. {
    368. price: "25.90",
    369. total_price: 0,
    370. sales: "0",
    371. properties: "0:2;1:4",
    372. properties_name: "0:2:颜色:红色;1:4:尺码:XXL",
    373. quantity: "9989",
    374. sku_id: "5249324174404",
    375. spec_id: "17a001fccdc38e767030004ac03b8881"
    376. }
    377. ]
    378. },
    379. seller_id: "2216403658837",
    380. sales: 0,
    381. shop_id: "2216403658837",
    382. props_list: {
    383. 0:0: "颜色:黑色",
    384. 0:1: "颜色:白色",
    385. 0:2: "颜色:红色",
    386. 1:0: "尺码:S",
    387. 1:1: "尺码:M",
    388. 1:2: "尺码:L",
    389. 1:3: "尺码:XL",
    390. 1:4: "尺码:XXL"
    391. },
    392. seller_info: {
    393. nick: "广州壹顺服饰有限公司",
    394. user_num_id: "2216403658837",
    395. sid: "b2b-221640365883745cad",
    396. title: "广州壹顺服饰有限公司",
    397. zhuy: "https://winport.m.1688.com/page/index.html?memberId=b2b-221640365883745cad",
    398. shop_name: "广州壹顺服饰有限公司"
    399. },
    400. tmall: "false",
    401. error: "",
    402. warning: "",
    403. url_log: [ ],
    404. unit: null,
    405. is_support_mix: null,
    406. mix_amount: null,
    407. mix_begin: null,
    408. mix_number: null,
    409. scale: "",
    410. sellUnit: "件",
    411. props_img: {
    412. 0:0: "https://cbu01.alicdn.com/img/ibank/O1CN01C2elgI1GqHNpUPCYf_!!2831370673-0-cib.jpg",
    413. 0:1: "https://cbu01.alicdn.com/img/ibank/O1CN01CM4kGc1GqHNlSBVBB_!!2831370673-0-cib.jpg",
    414. 0:2: "https://cbu01.alicdn.com/img/ibank/O1CN01aBgJrH1GqHNoM0rE7_!!2831370673-0-cib.jpg"
    415. },
    416. sales_data: null,
    417. priceRange: [
    418. [
    419. "2",
    420. "25.90"
    421. ]
    422. ],
    423. priceRangeOriginal: [ ],
    424. _ddf: "ti",
    425. sales_info: {
    426. seller_num: "",
    427. repeat_rate_purchase: "",
    428. per_capita_purchases: "",
    429. comment_num: "",
    430. comment_url: ""
    431. },
    432. format_check: "ok",
    433. shop_item: [ ],
    434. relate_items: [ ]
    435. },
    436. error: "",
    437. secache: "7d72e5a9b065698de0522f6542def81c",
    438. secache_time: 1695784483,
    439. secache_date: "2023-09-27 11:14:43",
    440. translate_status: "",
    441. translate_time: 0,
    442. language: {
    443. default_lang: "cn",
    444. current_lang: "cn"
    445. },

     

  • 相关阅读:
    阿里云企业邮箱基于Spring Boot快速实现发送邮件功能
    钟汉良日记:和鹤岗一样低房价的城市不止一个
    【动态规划】字串中回文的个数
    lombok插件浅析
    网络编程 day1
    线程交互现象
    ImportError: /lib/libgdal.so.26: undefined symbol: sqlite3_column_table_name
    java版工程管理系统Spring Cloud+Spring Boot+Mybatis实现工程管理系统源码
    计算机毕业设计(附源码)python疫情下校园食品安全信息管理
    Android 判断当前线程是否是主线程的方法
  • 原文地址:https://blog.csdn.net/Jernnifer_mao/article/details/133345014