首页 > 其他分享 >1688API商品详情页数据,接口封装

1688API商品详情页数据,接口封装

时间:2023-05-30 16:33:37浏览次数:52  
标签:封装 img 详情页 2020 https 1688API com 979836901 ibank

首先,大家要到官方主页去申请一个 appkey,这个是做什么用的呢?App Key 是应用的唯一标识,TOP 通过 App Key 来鉴别应用的身份。AppSecret 是 TOP 给应用分配的密钥,开发者需要妥善保存这个密钥,这个密钥用来保证应用来源的的可靠性,防止被伪造。就是说嘛,想要进门可要先有钥匙啊,所以,appkey 就是我们进入 openAPI 大门的钥匙。

item_get - 获得 1688 商品详情

1688.item_get

请求参数

请求参数:num_iid=610947572360
 
参数说明:num_iid:1688商品ID
sales_data:&sales_data=1 获取近30天成交数据
agent:&agent=1 获取1688分销代发价格数据

请求示例Curl PHP PHPsdk JAVA C# Python

<?php
 
// 请求示例 url 默认请求参数已经URL编码处理
// 本示例代码未加密secret参数明文传输,若要加密请参考:https://open.onebound.cn/help/demo/sdk/demo-sign.php
$method = "GET";
$url = "https://api-gw.onebound.cn/1688/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=610947572360";
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_ENCODING, "gzip");
var_dump(curl_exec($curl));
?>

响应示例

{
	"item": {
		"num_iid": "610947572360",
		"title": "厂家直销小米有品Qin2 Pro智能手机学生机老人机备用机小爱同学4G",
		"desc_short": "",
		"price": "799.00",
		"total_price": 0,
		"suggestive_price": 0,
		"orginal_price": "799.00",
		"nick": "qin多亲科技",
		"num": "1763",
		"detail_url": "https://detail.1688.com/offer/610947572360.html",
		"pic_url": "https://cbu01.alicdn.com/img/ibank/2020/063/830/13235038360_979836901.jpg",
		"brand": "",
		"brandId": "",
		"rootCatId": "",
		"cid": "50903",
		"desc": "<div id=\"offer-template-0\"></div><p><span><span>深圳市多亲科技有限公司(简称“多亲科技”)成立于2014年9月是国内领先的人工智能硬件解决方案供应商。多亲科技积极推动人工智能技术的创新研发,在人工智能终端设备、系统软件的研发和生产领域,具有深厚的技术沉淀与实力。</span></span></p><p><span> </span></p><p><span>        多亲产品销售网络覆盖全国各地乃至远销海外,欢迎企业定制、团购、经销代理。</span></p><p><span>        优质的产品、过硬的技术、完善的服务、是我们合作双赢的开篇。</span></p><p><span>        <span ><strong><span >欢迎有意向者实地考察,垂询电话:13662284449.</span></strong></span></span></p><p><span> </span></p><p><span>温馨提示:</span></p><p><span><span><span>1、可定制--</span></span>承接各种订单订制!为客户定制机身、开机画面、预装软件、包装等定制!</span><br /><span><span><span>2、质量保证--</span></span>本公司专注通讯行业10年,线下线下百花齐放,客户复购率达30%以上。</span><br /><span><span><span>3、价格实惠--</span></span>本店是工厂直供,没有中间商差价,一站到客,薄利多销。</span><br /><span><span><span>4、售后服务--</span></span>本店出售的所有产品均提供1年的质保。因质量原因退换货(非人为因素)30天内换新。</span></p><p> </p><p><span><img alt=\"undefined\" height=\"446.22866894197955\" src=\"https://cbu01.alicdn.com/img/ibank/2020/560/807/14112708065_979836901.jpg\" width=\"790\" /><br /><img alt=\"undefined\" height=\"457.5154730327144\" src=\"https://cbu01.alicdn.com/img/ibank/2020/303/507/14112705303_979836901.jpg\" width=\"790\" /><br /><img alt=\"undefined\" height=\"443.2365499573014\" src=\"https://cbu01.alicdn.com/img/ibank/2020/499/812/14150218994_979836901.jpg\" width=\"790\" /><br /><img alt=\"undefined\" height=\"440.350569675723\" src=\"https://cbu01.alicdn.com/img/ibank/2020/770/128/14199821077_979836901.jpg\" width=\"790\" /><br /></span></p><p><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/588/942/13197249885_979836901.jpg\" /></p><p><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/778/789/13234987877_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/109/489/13234984901_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/156/072/13197270651_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/270/710/13235017072_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/735/999/13234999537_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/549/252/13197252945_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/409/552/13197255904_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/247/935/13278539742_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/355/845/13278548553_979836901.jpg\" /><br /><br /></p><p><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/917/372/13197273719_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/969/099/13234990969_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/175/455/13278554571_979836901.jpg\" /></p><p><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/427/386/13314683724_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/331/365/13278563133_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/654/500/13235005456_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/542/110/13235011245_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/291/020/13235020192_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/329/635/13278536923_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/996/155/13278551699_979836901.jpg\" /></p><p><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/230/920/13235029032_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/464/972/13197279464_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/380/275/13278572083_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/999/462/13197264999_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/868/245/13278542868_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/843/410/13235014348_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/897/200/13235002798_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/914/800/13235008419_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/709/762/13197267907_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/427/545/13278545724_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/741/003/13197300147_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/175/710/13235017571_979836901.jpg\" /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/410/485/13278584014_979836901.jpg\" /><br /><br /><img alt=\"undefined\" src=\"https://cbu01.alicdn.com/img/ibank/2020/863/665/13278566368_979836901.jpg\" /><br /><br /><br /></p>",
		"item_imgs": [
			{
				"url": "https://cbu01.alicdn.com/img/ibank/2020/063/830/13235038360_979836901.jpg"
			},
			{
				"url": "https://cbu01.alicdn.com/img/ibank/2020/445/748/13819847544_979836901.jpg"
			},
			{
				"url": "https://cbu01.alicdn.com/img/ibank/2020/487/543/13234345784_979836901.jpg"
			},
			{
				"url": "https://cbu01.alicdn.com/img/ibank/2020/296/695/13418596692_979836901.jpg"
			},
			{
				"url": "https://cbu01.alicdn.com/img/ibank/2020/167/778/13462877761_979836901.jpg"
			}
		],
		"item_weight": "",
		"post_fee": "",
		"express_fee": "",
		"ems_fee": "",
		"shipping_to": "",
		"video": [],
		"sample_id": "",
		"props_name": "0:0:机身内存:64GB;1:0:颜色:铁灰色;1:1:颜色:瓷白色",
		"prop_imgs": {
			"prop_img": []
		},
		"property_alias": "0:0:64GB;1:0:铁灰色;1:1:瓷白色",
		"props": [
			{
				"name": "品牌",
				"value": "多亲"
			},
			{
				"name": "型号",
				"value": "Qin 2 Pro"
			},
			{
				"name": "手机类型",
				"value": "老人手机"
			},
			{
				"name": "外形",
				"value": "直板"
			},
			{
				"name": "主屏尺寸",
				"value": "大屏幕(5.0英寸—5.9英寸)"
			},
			{
				"name": "网络制式",
				"value": "移动4G(TD-LTE),联通/电信4G(FDD-LTE)"
			},
			{
				"name": "操作系统",
				"value": "Android 9.0系统"
			},
			{
				"name": "电池容量",
				"value": "2100"
			},
			{
				"name": "摄像头像素",
				"value": "1200万-1999万"
			},
			{
				"name": "存储卡",
				"value": "支持存储卡"
			},
			{
				"name": "处理器核心",
				"value": "八核"
			},
			{
				"name": "运行内存",
				"value": "2GB"
			},
			{
				"name": "手机版本",
				"value": "大陆行货"
			},
			{
				"name": "售后类型",
				"value": "全国联保"
			},
			{
				"name": "上市时间",
				"value": "2019"
			},
			{
				"name": "适用送礼场合",
				"value": "员工福利,颁奖纪念,广告促销,节日,展销会,公关策划,生日,商务馈赠"
			},
			{
				"name": "3C证书编号",
				"value": "2019161606319519"
			},
			{
				"name": "CPU品牌",
				"value": "展讯"
			},
			{
				"name": "运营商",
				"value": "中国移动,中国电信,中国联通"
			},
			{
				"name": "网络模式",
				"value": "单卡单模"
			},
			{
				"name": "机身内存",
				"value": "64GB"
			},
			{
				"name": "颜色",
				"value": "铁灰色,瓷白色"
			},
			{
				"name": "电信设备进网许可证编号",
				"value": "02-B613-192425"
			}
		],
		"total_sold": "1",
		"scale": "",
		"sellUnit": "",
		"skus": {
			"sku": [
				{
					"price": "799.00",
					"total_price": 0,
					"sales": "55",
					"properties": "0:0;1:1",
					"properties_name": "0:0:机身内存:64GB;1:1:颜色:瓷白色",
					"quantity": "932",
					"sku_id": "4309097072612",
					"spec_id": "63828b15ad641fdb131775f32e4c050c"
				},
				{
					"price": "799.00",
					"total_price": 0,
					"sales": "159",
					"properties": "0:0;1:0",
					"properties_name": "0:0:机身内存:64GB;1:0:颜色:铁灰色",
					"quantity": "831",
					"sku_id": "4302217872901",
					"spec_id": "0eb631954bfe8fb00a45824fc6193f2f"
				}
			]
		},
		"seller_id": "2206619673102",
		"sales": 30,
		"shop_id": "",
		"props_list": {
			"0:0": "机身内存:64GB",
			"1:0": "颜色:铁灰色",
			"1:1": "颜色:瓷白色"
		},
		"seller_info": {
			"nick": "qin多亲科技",
			"user_num_id": "2206619673102",
			"sid": "b2b-2206619673102e9470",
			"title": "深圳多亲科技实力卖场",
			"zhuy": "https://winport.m.1688.com/page/index.html?memberId=b2b-2206619673102e9470",
			"shop_name": "qin多亲科技"
		},
		"tmall": "",
		"data_from": "1688app",
		"error": "",
		"unit": "部",
		"is_support_mix": null,
		"mix_amount": null,
		"mix_begin": null,
		"mix_number": null,
		"min_num": "2",
		"sales_data": "",
		"location": "广东省 深圳市",
		"props_img": [],
		"sales_info": {
			"seller_num": "",
			"repeat_rate_purchase": "",
			"per_capita_purchases": "",
			"comment_num": "",
			"comment_url": ""
		},
		"desc_img": [
			"https://cbu01.alicdn.com/img/ibank/2020/560/807/14112708065_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/303/507/14112705303_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/499/812/14150218994_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/770/128/14199821077_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/588/942/13197249885_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/778/789/13234987877_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/109/489/13234984901_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/156/072/13197270651_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/270/710/13235017072_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/735/999/13234999537_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/549/252/13197252945_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/409/552/13197255904_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/247/935/13278539742_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/355/845/13278548553_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/917/372/13197273719_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/969/099/13234990969_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/175/455/13278554571_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/427/386/13314683724_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/331/365/13278563133_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/654/500/13235005456_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/542/110/13235011245_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/291/020/13235020192_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/329/635/13278536923_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/996/155/13278551699_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/230/920/13235029032_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/464/972/13197279464_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/380/275/13278572083_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/999/462/13197264999_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/868/245/13278542868_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/843/410/13235014348_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/897/200/13235002798_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/914/800/13235008419_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/709/762/13197267907_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/427/545/13278545724_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/741/003/13197300147_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/175/710/13235017571_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/410/485/13278584014_979836901.jpg",
			"https://cbu01.alicdn.com/img/ibank/2020/863/665/13278566368_979836901.jpg"
		],
		"shop_item": [],
		"relate_items": []
	},
	"secache": "f75c59301daa3fc1610a8563c998f851",
	"secache_time": 1608276252,
	"secache_date": "2020-12-18 15:24:12",
	"translate_status": "",
	"translate_time": 0,
	"language": {
		"default_lang": "cn",
		"current_lang": "cn"
	},

  

标签:封装,img,详情页,2020,https,1688API,com,979836901,ibank
From: https://www.cnblogs.com/Api0blogs97/p/17443637.html

相关文章

  • 拼多多商品详情接口(封装代码)
    一、使用拼多多商品接口可以获取拼多多商品详情。下面是获取商品详情的基本步骤和代码详解。1.注册账号并创建应用,获取API访问权限和密钥。2.根据API文档了解所需的参数和返回结果,构造请求参数和签名。其中,需要特别注意的是签名的生成方法,必须按照规定的方法进行,否则会导......
  • 2.4. 封装与访问控制
    封装(Encapsulation)是面向对象编程的一个核心概念,它意味着将数据(属性)和方法(操作数据的函数)捆绑在一起,形成一个类(Class)。封装的目的是将数据和操作数据的方法隐藏起来,以防止外部对数据的直接访问。这样,我们就可以通过定义公共接口(PublicInterface)来控制外部对类的访问,提高代码的可维......
  • java之封装
    封装:将属性和方法封装为一个整体,属性和方法都有权限限制classPerson{privateintage;//私有属性,只能在本类中访问publicvoidsetAge(intage){if(age<0||age>200)age=0;else{this.age=age;......
  • ASEMI单向可控硅BT151参数,BT151封装,BT151体积
    编辑-Z单向可控硅BT151参数:型号:BT151存储接点温度范围Tstg:-40~150℃工作接点温度范围Tj:-40~125℃断态重复峰值电压VDRM:650V重复峰值反向电压VRRM:650VRMS导通电流IT(RMS):12A非重复浪涌峰值导通电流ITSM:120A峰值栅极电流IGM:2A平均栅极功耗PG(AV):0.5W峰值栅极功率PGM:5WIGT:4mAVGT:0.75VV......
  • ASEMI单向可控硅BT151参数,BT151封装,BT151体积
    编辑-Z单向可控硅BT151参数:型号:BT151存储接点温度范围Tstg:-40~150℃工作接点温度范围Tj:-40~125℃断态重复峰值电压VDRM:650V重复峰值反向电压VRRM:650VRMS导通电流IT(RMS):12A非重复浪涌峰值导通电流ITSM:120A峰值栅极电流IGM:2A平均栅极功耗PG(AV):0.5W峰值栅极功率PGM:5WIG......
  • vue对kindeditor进行封装以及使用
    下载kindeditor后需要使用的文件如下(其他没用到的可删除)封装成组件以及自定义上传插件上传图片后生成image标签插入上传文件后生成下载a链接插入<template><divclass="kindeditor-component"><inputid="file-input"style="display:none"type="file"&g......
  • 将ajax请求封装到jQuery库当中
    1. 手动把ajax封装到js库  28代码在com.bjpowernode.ajax.servletAjaxRequest10Servletpackagecom.bjpowernode.ajax.servlet;importjakarta.servlet.ServletException;importjakarta.servlet.annotation.WebServlet;importjakarta.servlet.http.HttpServlet;importja......
  • vue-封装组件-超出部分限制...,并且提示
    显示效果 代码:<template><divclass="tip"><el-tooltip:content="content"placement="top"width="400":disabled="!isShowTooltip"><spanclass="me......
  • jQuery库的初次封装
    1.  AJAX代码封装  22-26- AJAX请求相关的代码都是类似的,有很多重复的代码,这些重复的代码能不能不写,能不能封装一个工具类。要发送ajax请求的话,就直接调用这个工具类中的相关函数即可。- 接下来,手动封装一个工具类,这个工具类我们可以把它看做是一个JS的库。我们把这个JS库起......
  • 封装 JDBCUtils和事务
    1. JDBC 的相关 API 小结  8322. 封装 JDBCUtils 【关闭连接, 得到连接】  8332.1 说明在jdbc操作中,获取连接和释放资源是经常使用到可以将其封装JDBC连接的具类JDBCUtils2.2 代码实现实际使用使用工具类 JDBCUtils代码在com.stulzl.utils.JDBCUtils      833......