【1688阿里巴巴api接口】获得店铺详情数据PHP展示示例

发布时间 2023-06-26 17:28:09作者: API测试开发Cris

店铺详情API接口的作用是获取一个电商平台上某个店铺的详细信息,包括店铺名称、销售商品数量、好评度、logo、店铺描述等。开发者可以通过该接口获取到店铺的原始数据,方便进行数据分析、爬取等操作。

通过该接口获取到的店铺详情数据可以结合其他数据进行深度挖掘,例如可以将店铺数据对比分析,找出竞争对手和市场机会,并对店铺进行定位和优化。

总的来说,该接口可以帮助开发者深度挖掘电商平台上的店铺数据,从而更好地为客户提供个性化服务和优质商品推荐。

1688.seller_info-获得店铺详情【获取接口免费测试

公共参数

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

请求参数

请求参数:seller_id=2206619673102

参数说明:seller_id:卖家id

响应参数

Version: Date:

名称类型必须示例值描述

items

items[] 0   按关键字搜索商品

id

String 0 950078515 店铺id

nick

String 0 余姚市联盛模塑厂 卖家昵称

good_num

String 0    

level

String 0 1  

created

String 0 2009年03月23日  

shop_type

String 0 个体经营 店铺类型

user_num_id

String 0 yylsmould  

company_id

String 0 92330281MA2EP3DC93  

company_dj

String 0 余姚市市场监督管理局  

company_time

String 0 2009-03-23 至 长期  

company_info

Mix 0 company_info[] 公司信息

cid

String 0    

sid

String 0 yylsmould 店铺ID

pic_url

String 0    

video

String 0    

title

String 0 余姚市联盛模塑厂 店铺标题

address

String 0 中国浙江宁波余姚市凤山街道五星村上峰岭15号(自主申报) 卖家详细地址

phone

String 0 13429262679  

zhuy

String 0 https://yylsmould.1688.com./page/contactinfo.htm 店铺主页

fh_score

String 0 0.11  

hm_score

String 0 0.02  

xy_score

String 0 -0.06  

ht_score

String 0 0.41  

menu

String 0 一般经营项目:模具的制造;塑料制品的加工;第一类医疗器械的制造。

PHP请求示例

<?php

// 请求示例 url 默认请求参数已经URL编码处理
// 本示例代码未加密secret参数明文传输,若要加密请参考:https://help/demo/sdk/demo-sign.php
$method = "GET";
$url = "https://1688/seller_info/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&seller_id=2206619673102";
$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));
?>

响应示例

{
	"user": {
		"id": "950078515",
		"nick": "余姚市联盛模塑厂",
		"good_num": null,
		"level": "1",
		"created": "2009年03月23日",
		"shop_type": "个体经营",
		"user_num_id": "yylsmould",
		"company_id": "92330281MA2EP3DC93",
		"company_dj": "余姚市市场监督管理局",
		"company_time": "2009-03-23 至 长期",
		"company_info": {
			"comapnyInfo": {
				"annualRevenue": "人民币 701 万元/年 - 1000 万元/年",
				"factorySize": "2800平方米",
				"manufactureType": "OEM加工、ODM加工",
				"productionCapacity": "600000件",
				"productionUnit": "件",
				"qaQc": "内部",
				"rndStaffNum": "5 - 10 人",
				"technologyType": "注塑/注射"
			},
			"itemList": [
				{
					"itemName": "厂房面积",
					"itemValue": "2800平方米"
				},
				{
					"itemName": "研发人数",
					"itemValue": "5 - 10 人"
				},
				{
					"itemName": "加工方式",
					"itemValue": "OEM加工、ODM加工"
				},
				{
					"itemName": "加工工艺",
					"itemValue": "注塑/注射"
				},
				{
					"itemName": "月产量",
					"itemValue": "600000件"
				},
				{
					"itemName": "年营业额",
					"itemValue": "人民币 701 万元/年 - 1000 万元/年"
				},
				{
					"itemName": "质量控制",
					"itemValue": "内部"
				}
			]
		},
		"cid": "-1",
		"sid": "yylsmould",
		"pic_url": null,
		"video": null,
		"title": "余姚市联盛模塑厂",
		"address": "中国浙江宁波余姚市凤山街道五星村上峰岭15号(自主申报)",
		"phone": "13429262679",
		"zhuy": "https://yylsmould.1688.com./page/contactinfo.htm",
		"fh_score": "-0.15",
		"hm_score": "0.02",
		"xy_score": "-0.13",
		"ht_score": "0.36",
		"menu": "一般经营项目:模具的制造;塑料制品的加工;第一类医疗器械的制造。"
	},
	"secache": "fae723b33d52c0870fda3ba6b0c5b577",
	"secache_time": 1614932379,
	"secache_date": "2021-03-05 16:19:39",
	"translate_status": "",
	"translate_time": 0,
	"language": {
		"default_lang": "cn",
		"current_lang": "cn"
	},
	"error": "",
	"reason": "",
	"error_code": "0000",
	"cache": 1,
	"api_info": "today:7 max:10000",
	"execution_time": 0.062,
	"server_time": "Beijing/2021-03-09 16:55:39",
	"client_ip": "106.6.35.144",
	"call_args": {
		"shop_url": "https://yylsmould.1688.com"
	},
	"api_type": "1688",
	"translate_language": "zh-CN",
	"translate_engine": "google_cn",
	"server_memory": "3.52MB",
	"request_id": "gw-4.6047380bae9e5"
}

异常示例

{
  "error": "item-not-found",
  "reason": "商品没找到",
  "error_code": "2000",
  "success": 0,
  "cache": 0,
  "api_info": "today:0 max:10000",
  "execution_time": 0.081,
  "server_time": "Beijing/2020-06-10 23:44:00",
  "call_args": [],
  "api_type": "taobao",
  "request_id": "15ee0ffc041242"}

错误码解释

状态代码(error_code)状态信息详细描述是否收费
0000 success 接口调用成功并返回相关数据
2000 Search success but no result 接口访问成功,但是搜索没有结果
4000 Server internal error 服务器内部错误
4001 Network error 网络错误
4002 Target server error 目标服务器错误
4003 Param error 用户输入参数错误 忽略
4004 Account not found 用户帐号不存在 忽略
4005 Invalid authentication credentials 授权失败 忽略
4006 API stopped 您的当前API已停用 忽略
4007 Account stopped 您的账户已停用 忽略
4008 API rate limit exceeded 并发已达上限 忽略
4009 API maintenance API维护中 忽略
4010 API not found with these values API不存在 忽略
4012 Please add api first 请先添加api 忽略
4013 Number of calls exceeded 调用次数超限 忽略
4014 Missing url param 参数缺失 忽略
4015 Wrong pageToken 参数pageToken有误 忽略
4016 Insufficient balance 余额不足 忽略
4017 timeout error 请求超时
5000 unknown error 未知错误

文章内容有限,欢迎私信沟通!