每个搜索引擎都有自己的api,可以去申请key,并支付一定的费用,我们以google搜索为例
https://developers.google.com/custom-search/v1/overview?hl=zh-cn#api_key
谷歌api每天免费100次api调用
获取key后就可以通过这个网址获取谷歌搜索的结果
https://www.googleapis.com/customsearch/v1?key={YOUR_KEY}&q={SEARCH_WORDS}&cx={YOUR_CX}&start={10}&num={10}
cx 是 Google 可编程搜索引擎(Programmable Search Engine)的 id 标识,申请地址:https://programmablesearchengine.google.com/controlpanel/all?hl=zh-cn
添加一个搜索的网站域名,例如bfw.wiki,那么搜索结果都是这个域名的内容。
网友回复