API简介,如何运用API接口获取商品数据(淘宝/天猫、1688、拼多多、京东等二十多个海内外电商平台)

API:应用程序接口(API:Application Program Interface)

应用程序接口是一组定义、程序及协议的集合,通过 API 接口实现计算机软件之间的相互通信。API 的一个主要功能是提供通用功能集。程序员通过调用 API 函数对应用程序进行开发,可以减轻编程任务。 API 同时也是一种中间件,为各种不同平台提供数据共享。

什么是API测试

API测试是一种用于验证API(应用程序编程接口)的软件测试类型。它与GUI测试非常不同,主要集中在软件体系结构的业务逻辑层。在API测试中,您无需使用标准的用户输入(键盘)和输出,而是使用软件将调用发送到API,获取输出并记下系统的响应。

API测试需要可以通过API进行交互的应用程序。为了测试API,您需要

使用测试工具调用API

编写自己的代码调用API

API简介,如何运用API接口获取商品数据(淘宝/天猫、1688、拼多多、京东等二十多个海内外电商平台)_第1张图片

淘宝/天猫API获得淘宝商品详情 API

API简介,如何运用API接口获取商品数据(淘宝/天猫、1688、拼多多、京东等二十多个海内外电商平台)_第2张图片 获得Key和secret  

https://api-gw.onebound.cn/taobao/item_get/?key=&
&num_iid=642885619273&is_promotion=1&cache=no&&lang=zh-CN&secret=
---------------------------------------
Result Object:
---------------------------------------
{
	"item": {
		"num_iid": "642885619273",
		"title": "Clever&Ketch女包包2022新款时尚链条单肩斜挎亮片星空洋气流苏包",
		"desc_short": "",
		"price": "299",
		"total_price": 0,
		"suggestive_price": 0,
		"orginal_price": "479.00",
		"nick": "cleverketch箱包旗舰店",
		"num": "200",
		"min_num": 0,
		"detail_url": "https://item.taobao.com/item.htm?id=642885619273",
		"pic_url": "//img.alicdn.com/imgextra/i1/2207281504206/O1CN01n4ZtmV1gwOWhI23fN_!!2207281504206-0-lubanu-s.jpg",
		"brand": "CLEVER&KETCH",
		"brandId": "2512537612",
		"rootCatId": "50006842",
		"cid": "50012010",
		"crumbs": [],
		"created_time": "",
		"modified_time": "",
		"delist_time": "",
		"desc": "

", "desc_img": [ "http://img.alicdn.com/imgextra/i3/2207281504206/O1CN01f3e6oO1gwOWbmeZEa_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i1/2207281504206/O1CN01eio0my1gwOWf7laBT_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i4/2207281504206/O1CN01xXEUwr1gwOWbmeESp_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i1/2207281504206/O1CN01UFxjHr1gwOWf7iQm8_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i1/2207281504206/O1CN01EVAkMR1gwOWcxWrH1_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i1/2207281504206/O1CN01b7Nimc1gwOWhHSXlp_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i4/2207281504206/O1CN018bYX0U1gwOWcxYwBP_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i1/2207281504206/O1CN01YfT3Ju1gwOWhHR4Hp_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i2/2207281504206/O1CN014kOZkc1gwOWdDALeG_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i1/2207281504206/O1CN01IrbjwS1gwOWeMP3eR_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i3/2207281504206/O1CN01SlP6se1gwOWfc2GO4_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i4/2207281504206/O1CN01m2sA5B1gwOWeMS0aG_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i1/2207281504206/O1CN016a6Xr71gwOWdD84Hk_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i3/2207281504206/O1CN01U6nKYY1gwOWdD8nzZ_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i1/2207281504206/O1CN01aCCaVY1gwOWcxYnsj_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i4/2207281504206/O1CN01LmvCP71gwOWdDA51R_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i3/2207281504206/O1CN01ND1Ns01gwOWZmtAhj_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i4/2207281504206/O1CN01f3KVFr1gwOWeMSD3k_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i4/2207281504206/O1CN01KAO74J1gwOWfc17hL_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i4/2207281504206/O1CN01kcTJI21gwOWZmtRM9_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i1/2207281504206/O1CN01cj0gH91gwOWZEe2pg_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i2/2207281504206/O1CN01BhotYT1gwOWi7tne3_!!2207281504206.jpg", "http://img.alicdn.com/imgextra/i1/2207281504206/O1CN01mIv78m1gwOWXuHf9I_!!2207281504206.jpg" ], "item_imgs": [ { "url": "//img.alicdn.com/imgextra/i1/2207281504206/O1CN01n4ZtmV1gwOWhI23fN_!!2207281504206-0-lubanu-s.jpg" }, { "url": "//img.alicdn.com/imgextra/i4/2207281504206/O1CN01VecWSw1gwOWeMzmMm_!!2207281504206-0-lubanu-s.jpg" }, { "url": "//img.alicdn.com/imgextra/i1/2207281504206/O1CN01CGeXMo1gwOWhI1Fnu_!!2207281504206-0-lubanu-s.jpg" }, { "url": "//img.alicdn.com/imgextra/i2/2207281504206/O1CN01DOWjoB1gwOWdDimzs_!!2207281504206-0-lubanu-s.jpg" }, { "url": "//img.alicdn.com/imgextra/i3/2207281504206/O1CN010D89tr1gwOWihOs0o_!!2207281504206-0-lubanu-s.jpg" } ], "item_weight": "", "item_size": "", "location": "广东广州", "post_fee": " 免运费", "express_fee": null, "ems_fee": "", "shipping_to": "", "has_discount": "true", "video": [], "is_virtual": "", "sample_id": "", "is_promotion": "true", "props_name": "1627207:28341:颜色分类:黑色;1627207:4266701:颜色分类:米白色", "prop_imgs": { "prop_img": [ { "properties": "1627207:28341", "url": "//img.alicdn.com/imgextra/i4/2207281504206/O1CN013fDWEW1gwOWgbaNsy_!!2207281504206.jpg" }, { "properties": "1627207:4266701", "url": "//img.alicdn.com/imgextra/i3/2207281504206/O1CN01c4FT0N1gwOWih4f7Q_!!2207281504206.jpg" } ] }, "property_alias": "", "props": [ { "name": "品牌", "value": "CLEVER&KETCH" }, { "name": "质地", "value": "PU" }, { "name": "材质工艺", "value": "PU革" }, { "name": "闭合方式", "value": "磁扣" }, { "name": "图案", "value": "纯色" }, { "name": "风格", "value": "欧美时尚" }, { "name": "形状", "value": "横款方形" }, { "name": "成色", "value": "全新" }, { "name": "流行元素", "value": "链子" }, { "name": "颜色分类", "value": "米白色 黑色" }, { "name": "内部结构", "value": "拉链暗袋" }, { "name": "有无夹层", "value": "无" }, { "name": "上市时间", "value": "2021年夏季" }, { "name": "是否可折叠", "value": "否" }, { "name": "货号", "value": "CK100-3501" }, { "name": "背包方式", "value": "单肩斜挎手提" }, { "name": "适用场景", "value": "休闲" }, { "name": "里料材质", "value": "合成革" }, { "name": "肩带样式", "value": "单根" }, { "name": "适用对象", "value": "青年" }, { "name": "提拎部件类型", "value": "锁链式提把" }, { "name": "箱包硬度", "value": "软" }, { "name": "款式", "value": "单肩包" }, { "name": "大小", "value": "小" }, { "name": "流行款式名称", "value": "流苏包" }, { "name": "销售渠道类型", "value": "纯电商(只在线上销售)" } ], "total_sold": "1286", "skus": { "sku": [ { "price": "299", "total_price": 0, "orginal_price": "299", "properties": "1627207:28341", "properties_name": "1627207:28341:颜色分类:黑色", "quantity": "200", "sku_id": "4789520302243" }, { "price": "299", "total_price": 0, "orginal_price": "299", "properties": "1627207:4266701", "properties_name": "1627207:4266701:颜色分类:米白色", "quantity": "200", "sku_id": "4789520302244" } ] }, "seller_id": "2207281504206", "sales": 200, "shop_id": "170019206", "props_list": { "1627207:28341": "颜色分类:黑色", "1627207:4266701": "颜色分类:米白色" }, "seller_info": { "nick": "cleverketch箱包旗舰店", "item_score": "4.9 ", "score_p": "4.9 ", "delivery_score": "4.9 ", "shop_type": "B", "user_num_id": "2207281504206", "sid": "170019206", "title": "cleverketch箱包旗舰店", "zhuy": "https://shop170019206.taobao.com/", "shop_name": "cleverketch箱包旗舰店" }, "tmall": true, "error": "", "warning": "", "url_log": [], "fav_count": "18098", "fans_count": "40.8万", "freight": "快递: 免运费", "props_imgs": { "prop_img": [ { "properties": "1627207:28341", "url": "//img.alicdn.com/imgextra/i4/2207281504206/O1CN013fDWEW1gwOWgbaNsy_!!2207281504206.jpg" }, { "properties": "1627207:4266701", "url": "//img.alicdn.com/imgextra/i3/2207281504206/O1CN01c4FT0N1gwOWih4f7Q_!!2207281504206.jpg" } ] }, "_ddf": "xdl", "promo_type": null, "props_img": { "1627207:28341": "//img.alicdn.com/imgextra/i4/2207281504206/O1CN013fDWEW1gwOWgbaNsy_!!2207281504206.jpg", "1627207:4266701": "//img.alicdn.com/imgextra/i3/2207281504206/O1CN01c4FT0N1gwOWih4f7Q_!!2207281504206.jpg" }, "format_check": "ok", "shop_item": [], "relate_items": [] }, "error": "", "secache": "4fb7c81c7e0bf7810d291f80e5b1ccc6", "secache_time": 1661390721, "secache_date": "2022-08-25 09:25:21", "translate_status": "", "translate_time": 0, "language": { "default_lang": "cn", "current_lang": "cn" }, "reason": "", "error_code": "0000", "cache": 0, "api_info": "today:1 max:10100 all[18=1+1+16];expires:2030-12-31", "execution_time": "4.042", "server_time": "Beijing/2022-08-25 09:25:21", "client_ip": "106.6.34.173", "call_args": { "num_iid": "642885619273", "is_promotion": "1" }, "api_type": "taobao", "translate_language": "zh-CN", "translate_engine": "google_new", "server_memory": "0.95MB", "request_id": "gw-4.6306cf7d79e2c", "last_id": "1173917767" }

 

你可能感兴趣的:(php,开发语言)