文档中心 > API类目 > 码上淘API

taobao.ma.barcode.productinfo.get (通过条码查询产品信息)

通过条码查询产品信息

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
barcode String 必须 6951439909683 条码值

响应参数

名称 类型 示例值 描述
result BarcodeProductInfo 产品信息
  • └ title
  • String
  • 百事可乐
  • 产品标题
  • └ pic_url
  • String
  • http://gw.alicdn.com/i2/T1MuluFvBXXXcdjOs9_103710.jpg
  • 图片url,如果需要某个尺寸和质量的,url末尾加上_300x300q90
  • └ spu_id
  • Number
  • 2341234
  • 标准产品单元id
  • └ price_min
  • String
  • 2.2
  • 最低价格
  • └ price_max
  • String
  • 4.5
  • 最高价格
  • └ cspu_id
  • Number
  • 12341234
  • 子标准产品单元id,对应现实中的产品
  • └ properties
  • Json
  • {"批准文号" : "无", "适合肤质" : "油性及混合性肤质", "男士护理功能" : "男士面膜", "男士护理单品" : "控油净肤竹炭面膜", "功效" : "舒缓肌肤", "品牌" : "师夷家","化妆品净含量" : "5片" }
  • 产品属性信息

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
MaBarcodeProductinfoGetRequest req = new MaBarcodeProductinfoGetRequest();
req.setBarcode("6951439909683");
MaBarcodeProductinfoGetResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<ma_barcode_productinfo_get_response>
    <result>
        <title>百事可乐</title>
        <pic_url>http://gw.alicdn.com/i2/T1MuluFvBXXXcdjOs9_103710.jpg</pic_url>
        <spu_id>2341234</spu_id>
        <price_min>2.2</price_min>
        <price_max>4.5</price_max>
        <cspu_id>12341234</cspu_id>
        <properties>{&quot;批准文号&quot; : &quot;无&quot;, 	&quot;适合肤质&quot; : &quot;油性及混合性肤质&quot;, 	&quot;男士护理功能&quot; : &quot;男士面膜&quot;, 				&quot;男士护理单品&quot; : &quot;控油净肤竹炭面膜&quot;, 	&quot;功效&quot; : &quot;舒缓肌肤&quot;,	&quot;品牌&quot; : &quot;师夷家&quot;,&quot;化妆品净含量&quot; : &quot;5片&quot; }</properties>
    </result>
</ma_barcode_productinfo_get_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案
isv.invalid-parameter 参数错误 检查传入参数是否正确
isp.find-no-product 对应的条码没有找到相应的商品 如果是个别错误是正常的,因为现在条码库没有完全覆盖条码,如果比较多要检查下用手淘扫这些条码能否找到
isp.service-is-error 服务不可用 联系api负责人排查问题

API工具

如何获得此API

FAQ

返回
顶部