BM25 全文搜索,支持 site: 指令、域名过滤、分类筛选。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| q | string | ✅ | 关键词,如 装修;公司;支持 site:域名 指令 |
| page | int | 否 | 页码,默认 1 |
| per_page | int | 否 | 每页条数,默认 6,最大 50 |
| type | string | 否 | 垂直分类:web / image / doc / video / mall / biz / pan |
| domain | string | 否 | 域名过滤(与 site: 同时存在时 site: 优先) |
{
"query": "沂蒙路",
"took": 12,
"total": 83995,
"page": 1,
"pages": 14000,
"results": [{ "title":"...", "url":"...", "domain":"...", "snippet":"...", "score":23.4, "jump_url":"/s/xxx" }],
"related": ["沂蒙精神", "沂蒙老区"],
"related_content": [{"title":"...", "url":"...", "from_kw":"沂蒙精神"}],
"pois": [{ "name":"沂蒙路", "city":"临沂市", "province":"山东省", "kind":"路", "address":"兰山区", "lat":35.078, "lon":118.338 }],
"poi_total": 7,
"ads": {"top":[], "bottom":[]}
}
curl -s "http://search.cybq.com/api/search?q=沂蒙路" \
-H "X-API-Key: 你的Key"
# Python
import requests
r = requests.get("http://search.cybq.com/api/search",
params={"q":"农业", "page":1, "per_page":10},
headers={"X-API-Key":"你的Key"})
data = r.json()
按城市 + 类别分页列出 POI 地点,用于搜索结果侧栏"📍 本地地点"展示。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| city | string | ✅ | 城市名,如 临沂市 |
| kind | string | 否 | POI 类型:路 / 小区 / 商超 / 建筑 / 公司 / 商户 |
| page | int | 否 | 页码,默认 1 |
| per_page | int | 否 | 每页条数,默认 20,最大 50 |
{
"ok": true,
"city": "临沂市",
"kind": "路",
"page": 1,
"per_page": 5,
"total": 747,
"pages": 150,
"items": [
{"name":"安居路", "city":"临沂市", "province":"山东省", "kind":"路", "address":"", "lat":35.080, "lon":118.390},
{"name":"沂河东路", "city":"临沂市", "province":"山东省", "kind":"路", "address":"", "lat":35.020, "lon":118.415}
]
}
curl -s "http://search.cybq.com/api/poi-list?city=临沂市&kind=路&page=1&per_page=10"
# JavaScript
fetch("/api/poi-list?city=临沂市&kind=路&page=1&per_page=10")
.then(r => r.json()).then(console.log)
地名→坐标。支持城市、区县、街道、路、小区、商场。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| q | string | ✅ | 地名,如 临沂市 / 沂蒙路 / 兰山区 |
{ "ok": true, "name":"临沂市", "city":"临沂市", "province":"山东省",
"kind":"城市", "lat":35.06, "lon":118.35 }
curl -s "http://search.cybq.com/api/geocode?q=沂蒙路"
# 地图定位(前端自动调用,定位搜索词坐标)
fetch("/api/geocode?q=" + encodeURIComponent(searchWord))
根据 IP 返回城市(用于未搜关键词时自动定位用户所在城市)。
{ "ok": true, "city":"临沂市", "region":"山东" }
公开热搜词(首页快捷入口),10 分钟缓存。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| limit | int | 否 | 条数,默认 12 |
{ "items": [
{"word":"临沂天气", "heat":86832},
{"word":"农业补贴", "heat":45200}
]}
curl -s "http://search.cybq.com/api/hotwords?limit=10"
地区行业导航页:全国省→市全量内链 + 行业词表(爬虫入口页)。
前端访问:https://search.cybq.com/diqu
返回 HTML 页面,包含所有省份、城市、行业分类的可点击链接。
地点详情页:某城市某地点的行业查询页(如 /p/山东省/临沂市/沂蒙路)。
curl -s "http://search.cybq.com/p/山东省/临沂市/沂蒙路" # 浏览器直接打开: # https://search.cybq.com/p/山东省/临沂市/沂蒙路
城市 POI 总览页:列出该城市所有路/小区/商超/建筑/公司商户。
curl -s "http://search.cybq.com/p/山东省/临沂市" # 浏览器打开: # https://search.cybq.com/p/山东省/临沂市
搜索引擎索引:
| URL | 说明 |
|---|---|
| /sitemap.xml | 首页 + 分类页 |
| /sitemap-words.xml | 词库词 |
| /sitemap-pois.xml | POI 地点 |
| /sitemap-local.xml | 地域专题(省/市/行业) |
| /sitemap-agri.xml | 农业专题 |
| /sitemap-brands.xml | 品牌大全 |
场景:用户在搜索框输入"沂蒙路",获取搜索结果 + POI 列表
步骤 1: 搜索
GET /api/search?q=沂蒙路&page=1&per_page=6
→ 返回 results(网页结果)+ pois(POI 地点)
步骤 2: 侧栏 POI 列表(自动触发)
GET /api/poi-list?city=临沂市&kind=路&page=1&per_page=20
→ 返回 POI 列表 + 分页
步骤 3: 点击某个 POI(如"沂蒙路")
浏览器跳转 → /p/山东省/临沂市/沂蒙路
→ 地点详情页(行业入口 + 地图 + 附近地点)
步骤 4: 地图定位(前端自动)
GET /api/geocode?q=沂蒙路
→ 返回坐标 {lat, lon},地图 marker 定位
| 模式 | 端点 | 用途 | 是否需要 Key |
|---|---|---|---|
| 🔍 全文搜索 | /api/search?q=关键词 | 搜索网页结果 + POI | 可选 |
| 📍 POI 列表 | /api/poi-list?city=市&kind=路 | 分页列出某类 POI | 否 |
| 🗺 地理解码 | /api/geocode?q=地名 | 地名→坐标 | 否 |
| 🌍 IP 定位 | /api/geo-ip | IP→城市 | 否 |
| 🔥 热词 | /api/hotwords?limit=10 | 热搜词列表 | 否 |
| 📚 词库导航 | /api/wordnav | 行业词库 | 否 |
| 🧭 地区行业 | /diqu | 省→市 导航页 | 否 |
| 📍 地点详情 | /p/{省}/{市}/{地点} | POI 详情+行业入口 | 否 |
| 🗺 站点地图 | /sitemap.xml | SEO 索引 | 否 |
| 📄 地点分城 | /api/localregion?city=临沂市 | 城市 POI 统计 | 否 |