360综合搜索是一个开放式的搜索引擎,可以无需经过奇虎公司同意而免费使用任何接口。
目前整理出的接口文档如下
1.搜索接口
firedebug可见 搜索 form 为
<form id="search-form" target="_top" action="http://so.360.cn/s">
<div class="others-params webpage-somulti types-webpage" style="display:none">
<input type="hidden" value="utf-8" name="ie">
<input type="hidden" value="hao_phome" name="src">
<input type="hidden" value="1" name="_re">
</div>
<div class="input-bg">
<b class="shadowtop"></b>
<b class="shadowleft"></b>
<input id="search-kw" class="input-txt" type="text" x-webkit-speech="" autocomplete="off" name="q">
</div>
<input id="search-btn" type="submit" value="搜索一下">
</form>
参数如下:
$ie='utf-8'
$src='hao_phome'
$_re='1'
$q= 要搜索的关键字
2.获取页面后
<ul class="result">
<li class="res-list">
<style>
<div id="mohe-ilike" class="g-mohe">
<h3 class="title">
<a target="_blank" href="http://www.woxihuan.com/search/article?kw=%E7%BE%8E%E5%A5%B3">
<em>美女</em>
_来自我喜欢网的图片
</a>
</h3>
<div class="cont">
<p class="url">www.woxihuan.com/search/article?kw=%E...</p>
</div>
</li>
<li class="res-list">
<style>
#mohe-image .img{margin-right:5px;border:1px solid #EAEAEA;height: 90px;overflow: hidden;}#mohe-image .pic{height:90px;}
</style>
<div id="mohe-image" class="g-mohe">
<h3 class="title">
<a target="_blank" href="http://image.jike.com/so?q=%E7%BE%8E%E5%A5%B3&fm=360onebox">
<em>美女</em>
_图片搜索结果
</a>
</h3>
<div class="cont">
<script src="http://s7.qhimg.com/s-onebox/;js;picAdjust/ef9495af.js">
</div>
</li>
<li class="res-list">
<li class="res-list">
<li class="res-list">
<li class="res-list">
<li class="res-list">
<li class="res-list">
<li class="res-list">
<li class="res-list">
</ul>
<div id="page">
</div>
取出所有class 为 res-title 的 div,然后取出href 即可得到搜索得到的地址
3.关键字补充
关键字补充以get方式传递参数,例如得到关键字美的关键字补充:
http://sug.so.360.cn/suggest?word=%E7%BE%8E&encodein=utf-8&encodeout=utf-8&callback=so.suggest
直接将word= 后面的参数替换成您想要得到的补充的关键字即可
相信有了这个简单的几个api,您就可以像360综合搜索一样搭建自己的搜索引擎