全网电商搜索联想词 淘宝,天猫,京东,一淘..等...搜索下拉联想词 接口标识: EcThinkWord 接口状态: 正常 模块状态: 正常 数据来源: 官方 计费模式: 按次 免KEY调用: 不允许 所属分类: 电商专区 开通 (开通后可享无并发限制, 及KEY相关功能设置)
接口地址:
返回格式:
请求方式:
请求示例:
联想词 淘宝搜索联想词 天猫搜索联想词 搜索联想词 电商平台搜索关键词 电商
请求参数:
返回参数:
返回示例:
API响应码:
系统响应码:
#1: 10开头 为系统级响应码 、11开头 为API模块级响应码。后面数字代表具体位置
代码示例:
C#
//using System.IO; //using System.Text; //using System.Net; //using System.Net.Security; //using System.Security.Cryptography.X509Certificates; private const String apiurl = "https://u.api.enetapi.com/api/v2/"; //统一请求URL无需修改 private const String alias = "EcThinkWord/taobao"; //接口唯一标识/模块 private const String key = "KEY"; //自己的KEY private const String method = "GET"; static void Main(string[] args) { String params = "&word=尿不湿"; //参数 String bodys = ""; String url = apiurl + alias; HttpWebRequest httpRequest = null; HttpWebResponse httpResponse = null; if (0 < params.Length) { url = url + "?key="+ key + params; } if (apiurl.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; }
PHP
<?php $apiurl = "https://u.api.enetapi.com/api/v2/"; //统一请求URL无需修改 $alias = "EcThinkWord/taobao"; //接口唯一标识/模块 $key = "KEY"; //自己的KEY $method = "GET"; $headers = array(); $params = "&word=尿不湿"; //参数 $bodys = ""; $url = $apiurl . $alias . "?key=" .$key. $params; $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, false); if (1 == strpos("$".$apiurl, "https://")) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); } print_r(curl_exec($curl)); ?>
Python
import urllib, urllib2, sys import ssl apiurl = 'https://u.api.enetapi.com/api/v2/' //统一请求URL无需修改 alias = 'EcThinkWord/taobao' //接口唯一标识/模块 key = 'KEY' //自己的KEY params = '&word=尿不湿' //参数 method = 'GET' bodys = {} url = apiurl + alias + '?key=' + key + params request = urllib2.Request(url) ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE response = urllib2.urlopen(request, context=ctx) content = response.read() if (content): print(content)
ObjectC
NSString *apiurl = @"https://u.api.enetapi.com/api/v2/"; //统一请求URL无需修改 NSString *alias = @"EcThinkWord/taobao"; //接口唯一标识/模块 NSString *key = @"?KEY"; //自己的KEY NSString *params = @"&word=尿不湿"; //参数 NSString *method = @"GET"; NSString *url = [NSString stringWithFormat:@"%@%@%@", apiurl, alias ,key , params]; NSString *bodys = @""; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString: url] cachePolicy:1 timeoutInterval: 5]; request.HTTPMethod = method; NSURLSession *requestSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; NSURLSessionDataTask *task = [requestSession dataTaskWithRequest:request completionHandler:^(NSData * _Nullable body , NSURLResponse * _Nullable response, NSError * _Nullable error) { NSLog(@"Response object: %@" , response); NSString *bodyString = [[NSString alloc] initWithData:body encoding:NSUTF8StringEncoding]; //打印body NSLog(@"Response body: %@" , bodyString); }]; [task resume];
CURL
curl -i -k --get --include 'https://u.api.enetapi.com/api/v2/EcThinkWord/taobao?word=尿不湿&key=自己的KEY'