采集场景
在淘宝首页输入关键词搜索,采集搜索后得到的商品列表页数据。示例中关键词为【连衣裙】,可根据需求进行更换,同时支持自动批量输入多个关键词。返回数据后得到商品ID或者商品url, 请求详情数据接口。
采集字段
采集字段包括关键字文本值,产品标题,店铺名称,产品价格,付款人数,商品链接,店铺名,品牌,发货地等。
采集结果
采集结果可导出为Excel,CSV,HTML,数据库等多种格式。导出为Excel示例:
Taobao.item_get-关键词搜索速卖通商品详情数据
1.请求方式:HTTP POST GET ;请求链接:c0b.cc/nIAWD4
2.请求参数(复制v:Taobaoapi2014 ):
请求参数:num_iid=520813250866
参数说明:num_iid:淘宝商品ID
3.请求代码示例,支持高并发请求(CURL、PHP 、PHPsdk 、Java 、C# 、Python...)
//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://api-gw.19970108018.cn/taobao/item_get_app/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=520813250866";
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;
}
4.响应参数