文档中心 > API类目 > 淘宝商品API

taobao.itemprops.get (获取标准商品类目属性)

通过设置必要的参数,来获取商品后台标准类目属性,以及这些属性里面详细的属性值prop_values。

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
fields String 可选 pid,name,must,multi,prop_values
  • 默认值:pid,name,must,multi,prop_values
  • 需要返回的字段列表,见:ItemProp,默认返回:pid, name, must, multi, prop_values
    cid Number 必须 44343 叶子类目ID,如果只传cid,则只返回一级属性,通过taobao.itemcats.get获得叶子类目ID
    pid Number 可选 3232 属性id (取类目属性时,传pid,不用同时传PID和parent_pid)
    parent_pid Number 可选 4834 父属性ID
    is_key_prop Boolean 可选 true 是否关键属性。可选值:true(是),false(否)
    is_sale_prop Boolean 可选 true 是否销售属性。可选值:true(是),false(否)
    is_color_prop Boolean 可选 true 是否颜色属性。可选值:true(是),false(否) (删除的属性不会匹配和返回这个条件)
    is_enum_prop Boolean 可选 true 是否枚举属性。可选值:true(是),false(否) (删除的属性不会匹配和返回这个条件)。如果返回true,属性值是下拉框选择输入,如果返回false,属性值是用户自行手工输入。
    is_input_prop Boolean 可选 true 在is_enum_prop是true的前提下,是否是卖家可以自行输入的属性(注:如果is_enum_prop返回false,该参数统一返回false)。可选值:true(是),false(否) (删除的属性不会匹配和返回这个条件)
    is_item_prop Boolean 可选 true 是否商品属性,这个属性只能放于发布商品时使用。可选值:true(是),false(否)
    child_path String 可选 3932:13221;2113:2345 类目子属性路径,由该子属性上层的类目属性和类目属性值组成,格式pid:vid;pid:vid.取类目子属性需要传child_path,cid
    type Number 可选 1
  • 默认值:1
  • 获取类目的类型:1代表集市、2代表天猫
    attr_keys String [] 可选 []
  • 最大列表长度:50
  • 属性的Key,支持多条,以“,”分隔

    响应参数

    名称 类型 示例值 描述
    last_modified Date 2010-01-01 00:00:00 最近修改时间(只有取全量或增量的时候会返回该字段)。格式:yyyy-MM-dd HH:mm:ss
    item_props ItemProp [] 商品属性
    • └ pid
    • Number
    • 20000
    • 属性 ID 例:品牌的PID=20000
    • └ parent_pid
    • Number
    • 10000
    • 上级属性ID
    • └ parent_vid
    • Number
    • 24455
    • 上级属性值ID
    • └ name
    • String
    • 颜色
    • 属性名
    • └ is_key_prop
    • Boolean
    • true
    • 是否关键属性。可选值:true(是),false(否)
    • └ is_sale_prop
    • Boolean
    • true
    • 是否销售属性。可选值:true(是),false(否)
    • └ is_color_prop
    • Boolean
    • true
    • 是否颜色属性。可选值:true(是),false(否)
    • └ is_enum_prop
    • Boolean
    • true
    • 是否是可枚举属性。可选值:true(是),false(否)
    • └ is_input_prop
    • Boolean
    • true
    • 在is_enum_prop是true的前提下,是否是卖家可以自行输入的属性(注:如果is_enum_prop返回false,该参数统一返回false)。可选值:true(是),false(否)。对于品牌和型号属性(包括子属性):如果用户是C卖家,则可自定义属性;如果是B卖家,则不可自定义属性,而必须要授权的属性。
    • └ is_item_prop
    • Boolean
    • true
    • 是否商品属性。可选值:true(是),false(否)
    • └ must
    • Boolean
    • true
    • 发布产品或商品时是否为必选属性。可选值:true(是),false(否)
    • └ multi
    • Boolean
    • true
    • 发布产品或商品时是否可以多选。可选值:true(是),false(否)
    • └ status
    • String
    • normal
    • 状态。可选值:normal(正常),deleted(删除)
    • └ child_template
    • String
    • SomeTemplate
    • 子属性的模板(卖家自行输入属性时需要用到)
    • └ sort_order
    • Number
    • 1
    • 排列序号。取值范围:大于零的整排列序号。取值范围:大于零的整数
    • └ is_allow_alias
    • Boolean
    • true
    • 是否允许别名。可选值:true(是),false(否)
    • prop_values
    • PropValue []
    • 属性值
    • └ cid
    • Number
    • 50010538
    • 类目ID
    • └ pid
    • Number
    • 1627207
    • 属性 ID
    • └ vid
    • Number
    • 3232483
    • 属性值ID
    • └ name
    • String
    • 军绿色
    • 属性值
    • └ prop_name
    • String
    • 颜色
    • 属性名
    • └ status
    • String
    • normal
    • 状态。可选值:normal(正常),deleted(删除)
    • └ name_alias
    • String
    • 军绿色
    • 属性值别名
    • └ is_parent
    • Boolean
    • true
    • 是否为父类目属性
    • └ sort_order
    • Number
    • 0
    • 排列序号。取值范围:大于零的整数
    • features
    • Feature []
    • 属性值feature
    • └ attr_value
    • String
    • 2342
    • 属性值
    • └ attr_key
    • String
    • 1234
    • 属性键
    • features
    • Feature []
    • 属性的feature列表
    • └ attr_key
    • String
    • 1234
    • 属性键
    • └ attr_value
    • String
    • 2342
    • 属性值
    • └ is_taosir
    • Boolean
    • true
    • 是否度量衡属性项
    • taosir_do
    • ItemTaosirDO
    • 度量衡相关信息
    • └ type
    • Number
    • 0
    • 时间类型:0表示非时间,1表示时间点,2表示时间范围
    • └ precision
    • Number
    • 2
    • 数值小数点精度
    • std_unit_list
    • StdUnit []
    • 卖家可选单位List<单位id,单位名>
    • └ attr_key
    • String
    • 1234
    • 属性键
    • └ attr_value
    • String
    • 2342
    • 属性值
    • expr_el_list
    • ExprEl []
    • 表达式元素list
    • └ type
    • Number
    • 0
    • 0 - 类型为label元素,只用于展示,不用于组装value_name; 1 - 类型为label元素,用于展示,用于组装value_name; 2 - 类型为输入狂元素,主要用于卖家输入数据. 卖家填写完后需要重新设置该元素的文本数据;
    • └ text
    • String
    • 显示文本
    • └ is_show_label
    • Boolean
    • true
    • 是否只用于显示的文本元素
    • └ is_label
    • Boolean
    • false
    • 是否文本元素,用于显示也用于组装value_name,比如:操作符
    • └ is_input
    • Boolean
    • false
    • 是否输入框
    • └ is_material
    • Boolean
    • true
    • 是否是材质 属性项
    • material_do
    • ItemMaterialProp
    • 材质属性信息
    • materials
    • ItemMateriaValueDO []
    • 材质值列表
    • └ need_content_number
    • Boolean
    • true
    • 当前材质值,是否需要填写含量值。比如:棉 是需要填写含量值,而牛皮 是不需要填写含量值的
    • └ name
    • String
    • 棉(纯棉)
    • 材质值名称

    请求示例

    • JAVA
    • .NET
    • PHP
    • CURL
    • Python
    • C/C++
    • NodeJS
    TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
    ItempropsGetRequest req = new ItempropsGetRequest();
    req.setFields("pid,name,must,multi,prop_values");
    req.setCid(44343L);
    req.setPid(3232L);
    req.setParentPid(4834L);
    req.setIsKeyProp(true);
    req.setIsSaleProp(true);
    req.setIsColorProp(true);
    req.setIsEnumProp(true);
    req.setIsInputProp(true);
    req.setIsItemProp(true);
    req.setDatetime(StringUtils.parseDateTime("2010-01-01 00:00:00"));
    req.setChildPath("3932:13221;2113:2345");
    req.setType(1L);
    req.setAttrKeys("");
    ItempropsGetResponse rsp = client.execute(req);
    System.out.println(rsp.getBody());

    响应示例

    • XML示例
    • JSON示例
    <itemprops_get_response>
        <last_modified>2010-01-01 00:00:00</last_modified>
        <item_props>
            <item_prop>
                <pid>20000</pid>
                <parent_pid>10000</parent_pid>
                <parent_vid>24455</parent_vid>
                <name>颜色</name>
                <is_key_prop>true</is_key_prop>
                <is_sale_prop>true</is_sale_prop>
                <is_color_prop>true</is_color_prop>
                <is_enum_prop>true</is_enum_prop>
                <is_input_prop>true</is_input_prop>
                <is_item_prop>true</is_item_prop>
                <must>true</must>
                <multi>true</multi>
                <status>normal</status>
                <child_template>SomeTemplate</child_template>
                <sort_order>1</sort_order>
                <is_allow_alias>true</is_allow_alias>
                <prop_values>
                    <prop_value>
                        <cid>50010538</cid>
                        <pid>1627207</pid>
                        <vid>3232483</vid>
                        <name>军绿色</name>
                        <prop_name>颜色</prop_name>
                        <status>normal</status>
                        <name_alias>军绿色</name_alias>
                        <is_parent>true</is_parent>
                        <sort_order>0</sort_order>
                        <features>
                            <feature>
                                <attr_value>2342</attr_value>
                                <attr_key>1234</attr_key>
                            </feature>
                        </features>
                    </prop_value>
                </prop_values>
                <features>
                    <feature>
                        <attr_key>1234</attr_key>
                        <attr_value>2342</attr_value>
                    </feature>
                </features>
                <is_taosir>true</is_taosir>
                <taosir_do>
                    <type>0</type>
                    <precision>2</precision>
                    <std_unit_list>
                        <std_unit>
                            <attr_key>1234</attr_key>
                            <attr_value>2342</attr_value>
                        </std_unit>
                    </std_unit_list>
                    <expr_el_list>
                        <expr_el>
                            <type>0</type>
                            <text>长</text>
                            <is_show_label>true</is_show_label>
                            <is_label>false</is_label>
                            <is_input>false</is_input>
                        </expr_el>
                    </expr_el_list>
                </taosir_do>
                <is_material>true</is_material>
                <material_do>
                    <materials>
                        <item_materia_value_d_o>
                            <need_content_number>true</need_content_number>
                            <name>棉(纯棉)</name>
                        </item_materia_value_d_o>
                    </materials>
                </material_do>
            </item_prop>
        </item_props>
    </itemprops_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 入参无效 校验传入数据格式,长度等
    isv.permission-ip-whitelist-limit 权限不足 请确认权限
    isv.permission-api-package-empty 权限不足 请确认权限
    isp.top-remote-connection-timeout 服务端异常 重试
    isp.service-unavailable 系统异常 系统异常,请稍后重试,如果长时间异常请提交工单反馈。
    isv.limit-parameter:cid cid请求过于频繁 请降低调用频率,或稍后重试

    API工具

    如何获得此API

    FAQ

    返回
    顶部