5118助手
{{item.ModuleName}}
名称 | 类型 | 必填 | 默认值 | 说明 |
---|---|---|---|---|
keyword | string | 是 | 查询关键词 | |
page_index | int | 否 | 1 | 当前分页 |
page_size | int | 否 | 500 | 每页返回数据的数量(最大返回数量500条) |
isc | int | 否 | 0 | 是否返回高亮html标签(默认不返回) |
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
errcode | string | 0 | 返回的错误代码 |
errmsg | string | 返回的错误说明 | |
total | int | 总数量 | |
page_count | int | 总页数 | |
page_index | int | 1 | 当前分页 |
page_size | int | 500 | 每页返回数据的数量(最大返回数量500条) |
title | string | 竞价标题 | |
intro | string | 竞价文案 | |
urltitle | string | 网站标题 | |
url | string | 网站地址 | |
fullurl | string | 网站完整地址 | |
companyname | string | 企业名称 | |
baidupcweight | string | 5118百度权重 | |
bidCount | string | 竞价发现次数 | |
join_date | string | 最后发现时间 | |
firstfindtime | string | 最早发现时间 |
{ "errcode": "0", "errmsg": "", "data": { "total": 495, "page_count": 1, "page_index": 1, "page_size": 500, "keyword_bidsite": [ { "title": "数据仪表,商业智能BI软件", "intro": "高新技术企业,xxxxxxxxxxxxx始建于1970年,国内著名陶瓷仪器,热分析仪器,实验电炉专业厂.陶瓷实验室仪器,热分析仪器,无机材料实验仪器,实验室电炉等.", "urltitle": null, "url": "sem.xxxxxxx.com", "fullurl": "https://sem.xxxxxx.com/sem/sualxxx?utm_source=ad&utm_medium=bdtg&utm_campaign=bi-dashboard&utm_term=B22784", "companyname": "XXX软件有限公司", "baidupcweight": "0", "bidCount": 2, "join_date": "2023-11-25T22:05:00", "firstfindtime": "2023-07-02T12:03:00" }, { "title": "工厂自动化仪表,授权代理商平台,企业级采购和研发服务", "intro": "1000家品牌授权代理商,提供工厂自动化仪表现货,样品,小量订货,大批量采购服务,供货,品质,价格保障.从概念,选型,方案,替换,BOM,测试等全链条研发服务", "urltitle": "全球领先的研发服务平台-电子元器件,电机,部件,材料,仪器分销商", "url": "www.xxxxx.com", "fullurl": "https://www.xxxxxx.com/Web/Search/keyword/%E5%B7%A5%E5%8E%82%E8%87%AA%E5%8A%A8%E5%8C%96%E4%BB%AA%E8%A1%A8?utm_source=baidu&utm_medium=sem&utm_term=web&utm_campaign=6018&utm_content=C%7B", "companyname": "xxxxxx元件网络有限公司", "baidupcweight": "2", "bidCount": 14, "join_date": "2023-11-23T22:04:00", "firstfindtime": "2020-12-22T22:03:00" } ... ] } }
错误码 | 说明 |
---|---|
100101 | 调用次数不够,请充值 |
100102 | 服务每秒调用量超限 |
100103 | 服务每小时调用量超限 |
100104 | 服务每天调用量超限 |
100111 | 调用字数不够,请充值 |
100201 | url无法解析 |
100202 | 请求缺少apikey |
100203 | 无效的apikey |
100204 | api不存在 |
100205 | api已经关闭 |
100206 | 后端服务响应status非200 |
100207 | 后端服务未正确接入 |
100208 | 请求方式不支持 |
100301 | Api商城 内部错误 |
100302 | 请求后端服务过程中错误 |
100303 | 系统繁忙稍候再试 |
100403 | 您输入的apikey不正确 |
错误码 | 说明 |
---|---|
200101 | 暂无数据 |
200107 | 服务器超时 |
200201 | 传进参数为空 |
200202 | 用户ID为空 |
200203 | 请输入要查询的竞价词 |
2 | 002 | 01 |
---|---|---|
服务器错误(1:为系统级别错误) | 服务模块代码(即数据ID) | 具体错误代码 |
名称 | 价格 | 次数 | 说明 |
---|---|---|---|
试用套餐 | 0.00 | 100 | |
套餐一 | 100.00 | 10000 | |
套餐二 | 500.00 | 100000 | |
套餐三 | 2500.00 | 1000000 |
<?php
$host = "http://apis.5118.com";
$path = "/bidsite";
$method = "POST";
$apikey = "你要调用API的apikey";
$headers = array();
array_push($headers, "Authorization:" . $apikey);
//根据API的要求,定义相对应的Content-Type
array_push($headers, "Content-Type".":"."application/x-www-form-urlencoded; charset=UTF-8");
$querys = "";
$bodys = "keyword=keyword&page_index=page_index&page_size=page_size";
$url = $host . $path;
$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, true);
if (1 == strpos("$".$host, "https://"))
{
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys);
var_dump(curl_exec($curl));
?>
using System.IO;
using System.Text;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
private const String host = "http://apis.5118.com";
private const String path = "/bidsite";
private const String method = "POST";
private const String apikey = "你要调用的接口apikey";
static void Main(string[] args)
{
String querys = "";
String bodys = "keyword=keyword&page_index=page_index&page_size=page_size";
String url = host + path;
HttpWebRequest httpRequest = null;
HttpWebResponse httpResponse = null;
if (0 < querys.Length)
{
url = url + "?" + querys;
}
if (host.Contains("https://"))
{
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
}
else
{
httpRequest = (HttpWebRequest)WebRequest.Create(url);
}
httpRequest.Method = method;
httpRequest.Headers.Add("Authorization", apikey);
//根据API的要求,定义相对应的Content-Type
httpRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
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;
}