一、奇妙之处:直连官方数据源,海量商品信息秒级返回
商品条形码查询API的核心能力是:输入13位或14位标准条码,返回对应的商品结构化信息,包括:

它支持国内商品条码和国外进口条码,直连中国物品编码中心等官方数据源,识别率高,查得率稳定。
二、实战演示:查询条码 6921830106820 的商品信息
下面通过 Python 代码调用该接口。
import urllib3
import json
host = 'https://market.aliyun.com/detail/cmapi00065867'#接口地址
path = '/barcode/index'
method = 'GET'
appcode = '你自己的AppCode' # 替换为真实 AppCode
querys = 'barcode=6921830106820'
url = host + path + '?' + querys
http = urllib3.PoolManager()
headers = {
'Authorization': 'APPCODE ' + appcode
}
response = http.request('GET', url, headers=headers)
content = response.data.decode('utf-8')
data = json.loads(content)
print(json.dumps(data, indent=2, ensure_ascii=False))
返回结果示例:
{
"code": 1,
"msg": "操作成功",
"data": {
"barcode": "6921830106820",
"brand": "老厨",
"goods_name": "老厨香辣牛肉干",
"company": "温州老厨食品有限公司",
"keyword": "牛肉干",
"goods_type": "食品、饮料和烟草>>预制食品和罐头>>小吃>>肉干和处理过的肉",
"category_code": "10005767",
"category_name": "预制/加工牛肉",
"spec": "52g",
"price": "6.00",
"origin_country": "中国",
"remark": "经查,该商品条码已在中国物品编码中心注册..."
}
}
三、返回字段解析

四、应用场景


1615

被折叠的 条评论
为什么被折叠?



