关于电商API接口系列(详情页详情,产品列表,按图搜索,店铺所有产品等数据采集)

一、什么是电商API

​​​​​​​程接口(Application Programming Interface),是一组用于访问某个软件或硬件的协议、规则和工具集合。电商API就是各大电商平台提供给开发者访问平台数据的接口。目前,主流电商平台如淘宝、天猫、京东、苏宁等都有自己的API。

二、电商API的应用价值

1.直接对接原始数据源,数据提取更加准确和完整。

2.查询速度更快,可以快速响应用户请求实现对数据的即时操作。

3.避免了手动采集数据的繁琐步骤,不仅大大提高了工作效率,还可以有效避免人为错误。

4.获取数据更为稳定可靠,抓取数据可以随时进行,不受时间和地点的限制,方便管理分析。

三、电商API的数据类型

电商API提供的数据种类多样,一般可分为以下几类:

1.商品数据:商品ID、商品名称、商品价格、库存等。

2.交易数据:订单号、付款时间、收货人等。

3.店铺数据:店铺ID、店铺名称、开店时间、店铺评分等。

4.营销数据:促销信息、优惠券信息、秒杀活动等。

四、常见的电商API

1.Taobao API:淘宝API可以获取到淘宝平台上各种商品、类目、店铺等信息,并且能够实现下单、退款、物流等操作。

2.JD API:京东API与淘宝API类似,也可以获取到京东平台上各种商品、类目、店铺等信息,并且支持下单、退货、物流等操作。

3.PDD API:拼多多API可以获取到拼多多平台上各种商品、店铺等数据,同时也支持下单、发货等操作。

五、利用电商API获取数据的步骤

1.申请API接口:首先要在相应电商平台上注册账号并申请API接口。

2.获取授权:在账号注册成功后,需要获取相应的授权才能访问电商API。

3.调用API:根据电商API提供的请求格式,通过编程实现相关接口的调用。

4.解析数据:API返回的数据一般是json或xml格式,需要对数据进行解析处理。

5.存储与分析:最后,把解析成功的数据进行存储和分析,以便更好地了解市场情况、产品热度、消费趋势等信息。

六、注意事项

1.电商API对频次有限制,不能过于频繁地调用,否则可能会被禁止访问。

2.API访问时需要授权,保护API密钥的安全性也是很重要的。

3.电商API返回的数据会受到电商平台的限制,不同平台对API返回数据的限制可能不同。

4.数据内容会有变化,需要定期维护更新获取数据。

七、接口响应示例

{
	"item": {
		"num_iid": "711340498476",
		"title": "夏季冰丝运动裤男款ins高街潮流直筒宽松休闲裤学生百搭条纹长裤",
		"desc_short": "",
		"price": "79",
		"total_price": 0,
		"suggestive_price": 0,
		"orginal_price": "155.00",
		"nick": "aykki服饰旗舰店",
		"num": "200",
		"min_num": 0,
		"detail_url": "https://item.taobao.com/item.htm?id=711340498476",
		"pic_url": "//img.alicdn.com/imgextra/i4/2260390468/O1CN01P3ucGT1FKOBhN1l55_!!0-item_pic.jpg",
		"brand": "AYKKI",
		"brandId": "717674886",
		"rootCatId": "30",
		"cid": "3035",
		"crumbs": [],
		"created_time": "",
		"modified_time": "",
		"delist_time": "",
		"desc": "\n  

", "desc_img": [ "http://assets.alicdn.com/kissy/1.0.0/build/imglazyload/spaceball.gif", "http://img.alicdn.com/imgextra/i1/2260390468/O1CN01dTHJee1FKOBRUH17J_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i2/2260390468/O1CN01uRof0W1FKOBiCLb5D_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i2/2260390468/O1CN01Gmi2lA1FKOBgDnO6Q_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i1/2260390468/O1CN01ub1XFR1FKOBagNgun_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i4/2260390468/O1CN01xWmCHI1FKOBaIAh0E_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i3/2260390468/O1CN01SAuw4S1FKOBebWrz2_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i1/2260390468/O1CN01YdJrVd1FKOBYDjc9S_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i1/2260390468/O1CN01j30qyj1FKOBffJUNd_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i1/2260390468/O1CN01NdP0mR1FKOBebUvMy_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i3/2260390468/O1CN01xEkdHZ1FKOBiCNoHa_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i3/2260390468/O1CN01ofWLyM1FKOBaIAMFq_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i2/2260390468/O1CN01sRRdge1FKOBYDk5HM_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i2/2260390468/O1CN011Gl87u1FKOBXTGfdL_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i2/2260390468/O1CN01sYYaZL1FKOBgDpbOl_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i3/2260390468/O1CN010zrl4E1FKOBXTEvYV_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i2/2260390468/O1CN01bfO4VU1FKOBhMmRzW_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i2/2260390468/O1CN01sHZq0S1FKOBaID2aj_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i2/2260390468/O1CN01UcJk3s1FKOBhMn3Q4_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i4/2260390468/O1CN016QrfYq1FKOBaIApMw_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i2/2260390468/O1CN01EzUJM21FKOBhMlFDB_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i2/2260390468/O1CN01r3z4Wi1FKOBdIR6Qo_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i1/2260390468/O1CN01IHXEgX1FKOBXTFfIy_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i3/2260390468/O1CN01p7cz7T1FKOBaIBplS_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i1/2260390468/O1CN01qfi3SN1FKOBYDlI9I_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i1/2260390468/O1CN01YK53iK1FKOBdIV7x7_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i2/2260390468/O1CN017zBr061FKOBbkJElW_!!2260390468.jpg", "http://img.alicdn.com/imgextra/i4/2260390468/O1CN010eRyxM1FKOBebZ5GD_!!2260390468.jpg" ], "item_imgs": [ { "url": "https://img.alicdn.com/imgextra/i4/2260390468/O1CN01P3ucGT1FKOBhN1l55_!!0-item_pic.jpg" }, { "url": "https://img.alicdn.com/imgextra/i2/2260390468/O1CN01qaMHsZ1FKOBbkFLLl_!!2260390468.jpg" }, { "url": "https://img.alicdn.com/imgextra/i1/2260390468/O1CN01Jw96IY1FKOBagJOaX_!!2260390468.jpg" }, { "url": "https://img.alicdn.com/imgextra/i3/2260390468/O1CN017bJ9XL1FKOBagGAj2_!!2260390468.jpg" }, { "url": "https://img.alicdn.com/imgextra/i1/2260390468/O1CN01LdLvsi1FKOBdILawx_!!2260390468.jpg" } ], "item_weight": "", "item_size": "", "location": "浙江杭州", "post_fee": 0, "express_fee": null, "ems_fee": "", "shipping_to": "", "has_discount": "true", "video": { "url": null }, "is_virtual": "", "sample_id": "", "is_promotion": "true", "props_name": "20518:28314:尺码:S;20518:28315:尺码:M;20518:28316:尺码:L;20518:28317:尺码:XL;20518:6145171:尺码:2XL;20518:115781:尺码:3XL;1627207:28341:颜色:黑色;1627207:4168285:颜色:咖色;1627207:7085041:颜色:深灰", "prop_imgs": { "prop_img": [ { "properties": "1627207:28341", "url": "//img.alicdn.com/imgextra/i4/2260390468/O1CN01lnkPYb1FKOBdIJqnG_!!2260390468.jpg" }, { "properties": "1627207:4168285", "url": "//img.alicdn.com/imgextra/i3/2260390468/O1CN017bJ9XL1FKOBagGAj2_!!2260390468.jpg" }, { "properties": "1627207:7085041", "url": "//img.alicdn.com/imgextra/i1/2260390468/O1CN01LdLvsi1FKOBdILawx_!!2260390468.jpg" } ] }, "property_alias": "", "props": [ { "name": "品牌", "value": "AYKKI" }, { "name": "尺码", "value": "S M L XL 2XL 3XL" }, { "name": "面料", "value": "其他/other" }, { "name": "图案", "value": "条纹" }, { "name": "腰型", "value": "中腰" }, { "name": "颜色", "value": "黑色 咖色 深灰" }, { "name": "货号", "value": "A1-K741" }, { "name": "弹力", "value": "微弹" }, { "name": "细分风格", "value": "潮" }, { "name": "基础风格", "value": "青春流行" }, { "name": "品牌类型", "value": "时尚潮牌" }, { "name": "适用季节", "value": "夏季" }, { "name": "上市年份季节", "value": "2023年夏季" }, { "name": "厚薄", "value": "常规" }, { "name": "适用场景", "value": "其他休闲" }, { "name": "服装版型", "value": "宽松型" }, { "name": "款式细节", "value": "口袋装饰" }, { "name": "适用对象", "value": "青年" }, { "name": "裤长", "value": "长裤" }, { "name": "款式", "value": "运动裤" }, { "name": "裤脚口款式", "value": "直筒" }, { "name": "颜色", "value": "基础色(黑灰白等)" }, { "name": "销售渠道类型", "value": "纯电商(只在线上销售)" }, { "name": "材质成分", "value": "聚酯纤维64% 棉31% 聚氨酯弹性纤维(氨纶)5%" } ], "total_sold": "55", "skus": { "sku": [ { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28314;1627207:28341", "properties_name": "20518:28314:尺码:S;1627207:28341:颜色:黑色", "quantity": "200", "sku_id": "5154776002626" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28315;1627207:28341", "properties_name": "20518:28315:尺码:M;1627207:28341:颜色:黑色", "quantity": "200", "sku_id": "5154776002627" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28316;1627207:28341", "properties_name": "20518:28316:尺码:L;1627207:28341:颜色:黑色", "quantity": "200", "sku_id": "5154776002628" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28317;1627207:28341", "properties_name": "20518:28317:尺码:XL;1627207:28341:颜色:黑色", "quantity": "200", "sku_id": "5154776002629" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:6145171;1627207:28341", "properties_name": "20518:6145171:尺码:2XL;1627207:28341:颜色:黑色", "quantity": "200", "sku_id": "5154776002630" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:115781;1627207:28341", "properties_name": "20518:115781:尺码:3XL;1627207:28341:颜色:黑色", "quantity": "200", "sku_id": "5154776002631" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28314;1627207:4168285", "properties_name": "20518:28314:尺码:S;1627207:4168285:颜色:咖色", "quantity": "200", "sku_id": "5154776002632" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28315;1627207:4168285", "properties_name": "20518:28315:尺码:M;1627207:4168285:颜色:咖色", "quantity": "200", "sku_id": "5154776002633" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28316;1627207:4168285", "properties_name": "20518:28316:尺码:L;1627207:4168285:颜色:咖色", "quantity": "200", "sku_id": "5154776002634" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28317;1627207:4168285", "properties_name": "20518:28317:尺码:XL;1627207:4168285:颜色:咖色", "quantity": "200", "sku_id": "5154776002635" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:6145171;1627207:4168285", "properties_name": "20518:6145171:尺码:2XL;1627207:4168285:颜色:咖色", "quantity": "200", "sku_id": "5154776002636" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:115781;1627207:4168285", "properties_name": "20518:115781:尺码:3XL;1627207:4168285:颜色:咖色", "quantity": "200", "sku_id": "5154776002637" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28314;1627207:7085041", "properties_name": "20518:28314:尺码:S;1627207:7085041:颜色:深灰", "quantity": "200", "sku_id": "5154776002638" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28315;1627207:7085041", "properties_name": "20518:28315:尺码:M;1627207:7085041:颜色:深灰", "quantity": "200", "sku_id": "5154776002639" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28316;1627207:7085041", "properties_name": "20518:28316:尺码:L;1627207:7085041:颜色:深灰", "quantity": "200", "sku_id": "5154776002640" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:28317;1627207:7085041", "properties_name": "20518:28317:尺码:XL;1627207:7085041:颜色:深灰", "quantity": "200", "sku_id": "5154776002641" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:6145171;1627207:7085041", "properties_name": "20518:6145171:尺码:2XL;1627207:7085041:颜色:深灰", "quantity": "200", "sku_id": "5154776002642" }, { "price": "79", "total_price": 0, "orginal_price": "79", "properties": "20518:115781;1627207:7085041", "properties_name": "20518:115781:尺码:3XL;1627207:7085041:颜色:深灰", "quantity": "200", "sku_id": "5154776002643" } ] }, "seller_id": "2260390468", "sales": 400, "shop_id": "114240955", "props_list": { "20518:28314": "尺码:S", "20518:28315": "尺码:M", "20518:28316": "尺码:L", "20518:28317": "尺码:XL", "20518:6145171": "尺码:2XL", "20518:115781": "尺码:3XL", "1627207:28341": "颜色:黑色", "1627207:4168285": "颜色:咖色", "1627207:7085041": "颜色:深灰" }, "seller_info": { "nick": "aykki服饰旗舰店", "item_score": "4.7 ", "score_p": "4.7 ", "delivery_score": "4.7 ", "shop_type": "B", "user_num_id": "2260390468", "sid": "114240955", "title": "aykki服饰旗舰店", "zhuy": "https://shop114240955.taobao.com/", "shop_name": "aykki服饰旗舰店" }, "tmall": true, "error": "", "warning": "", "url_log": [], "fav_count": "1154", "fans_count": "13.0万", "freight": "快递: 免运费", "props_imgs": { "prop_img": [ { "properties": "1627207:28341", "url": "//img.alicdn.com/imgextra/i4/2260390468/O1CN01lnkPYb1FKOBdIJqnG_!!2260390468.jpg" }, { "properties": "1627207:4168285", "url": "//img.alicdn.com/imgextra/i3/2260390468/O1CN017bJ9XL1FKOBagGAj2_!!2260390468.jpg" }, { "properties": "1627207:7085041", "url": "//img.alicdn.com/imgextra/i1/2260390468/O1CN01LdLvsi1FKOBdILawx_!!2260390468.jpg" } ] }, "_ddf": "xdl", "promo_type": null, "props_img": { "1627207:28341": "//img.alicdn.com/imgextra/i4/2260390468/O1CN01lnkPYb1FKOBdIJqnG_!!2260390468.jpg", "1627207:4168285": "//img.alicdn.com/imgextra/i3/2260390468/O1CN017bJ9XL1FKOBagGAj2_!!2260390468.jpg", "1627207:7085041": "//img.alicdn.com/imgextra/i1/2260390468/O1CN01LdLvsi1FKOBdILawx_!!2260390468.jpg" }, "format_check": "ok", "shop_item": [], "relate_items": [] }, "error": "", "secache": "f59f966dd8bcb4458b4134384e3cb44e", "secache_time": 1686819438, "secache_date": "2023-06-15 16:57:18", "translate_status": "", "translate_time": 0, "language": { "default_lang": "cn", "current_lang": "cn" }, ``` ```

你可能感兴趣的:(爬虫,后端,API)