淘宝/天猫搜索同款的商品 API 接口返回值说明

发布时间 2023-04-11 17:27:27作者: API测试开发Cris

前言

 

通过根据店铺商品来提取平台同款现有的商品或者潜在的竞争对手的产品进行比较分析。我们可以查询到市面上有没有和自己产品类似的竞品。同时快速了解到这块领域当前是处于什么阶段?蓝海?还是红海?并且快速了解到竞品的产品模式,用户的群体,运营的模式,是否可以借鉴采纳与改进优化。也可以了解到自己与竞品之间的区别、差距,自身的优势与劣势,产品的市场份额以及竞争力,有助于及时调整产品和运营的策略,还可以了解到客户的评价,反馈,进一步了解用户的需求,引导产品及服务改良或创新,也可以关注竞品的最新动向,有助于发现新的增长点,有助于及时调整产品和运营策略。

 

 

item_search_samestyle-搜索同款的商品

 

公共参数

 

名称 类型 必须 描述

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版本

请求参数测试

 

请求参数:sample_id=-448629073&num_iid=547985308669&page=1&sort=&page_size=

 

参数说明:sample_id:商品风格标识ID

num_iid:商品ID

 

响应参数

 

Version: Date:

 

名称 类型 必须 示例值 描述

title

 

String 0 法式复古山本超仙chic仙女赫本网红初春很仙法国小众裙子两件套装 商品标题

pic_url

 

String 0 //http://img.alicdn.com/bao/uploaded/i3/3083218865/O1CN012FMDaiwxkenJGaM_!!0-item_pic.jpg 宝贝图片

promotion_price

 

Float 0 178.00 优惠价

price

 

Float 0 178.00 价格

sales

 

Int 0 890 销量

num_iid

 

Bigint 0 577437133060 宝贝ID

sample_id

 

String 0 商品风格标识ID

seller_nick

 

String 0 初穆旗舰店 掌柜昵称

post_fee

 

Float 0 10.00 物流费用

area

 

String 0 山东 店铺所在地

detail_url

 

String 0 //http://detail.tmall.com/item.htm?id=586794298909&ns=1&abbucket=0 宝贝链接

 

请求示例

 

//using System.Net.Security;
//using System.Security.Cryptography.X509Certificates;
private const String method = "GET";
static void Main(string[] args)
{
    String bodys = "";
    // 请求示例 url 默认请求参数已经做URL编码
    String url = "https://v-x:1887028846/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&sample_id=-448629073&num_iid=547985308669&page=1&sort=&page_size=";
    HttpWebRequest httpRequest = null;
    HttpWebResponse httpResponse = null; 
    if (url.Contains("https://"))
    {
        ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
        httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
    }
    else
    {
        httpRequest = (HttpWebRequest)WebRequest.Create(url);
    }
    httpRequest.Method = method;
    if (0 < bodys.Length)
    {
        byte[] data = Encoding.UTF8.GetBytes(bodys);
        using (Stream stream = httpRequest.GetRequestStream())
        {
        stream.Write(data, 0, data.Length);
        }
    }
    try
    {
        httpResponse = (HttpWebResponse)httpRequest.GetResponse();
    }
    catch (WebException ex)
    {
        httpResponse = (HttpWebResponse)ex.Response;
    }
    Console.WriteLine(httpResponse.StatusCode);
    Console.WriteLine(httpResponse.Method);
    Console.WriteLine(httpResponse.Headers);
    Stream st = httpResponse.GetResponseStream();
    StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
    Console.WriteLine(reader.ReadToEnd());
    Console.WriteLine("\n");
}
public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
    return true;
}

 

文章内容有限,欢迎私信沟通交流。​​​​