以下是行业内了解到的一些情况,本帖只展示部分代码,可以提供:淘宝、1688、拼多多、京东、苏宁、易贝、速卖通、抖音 Tik Tok 阿里巴巴等 30 多个电商平台接口
公共参数:
请求参数: shop_id=433655136&page=1&sort=
参数说明:
shop_id:shop_id page: 页码
sort: 排序 [new,bid,sale]
(new 新品,bid: 价格,sale: 销量,bid 加_前缀为从大到小排序)
需要更多 API 调试请移步注册 API 账号
响应参数:
请求示例:
//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.onebound.cn/taobao/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&shop_id=433655136&page=1&sort=";
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;
}