接口简介
- 分类信息搜索
接口请求说明
请求方式
GET https://站点接口域名/openapi/fenlei/search-categories (获取当前搜索关键词相关的分类列表和数量)
GET https://站点接口域名/openapi/fenlei/search (通过分类ID和KW获取该分类下的相关信息列表)
search-categories请求参数
参数名 | 类型 | 是否必须 | 说明 |
---|---|---|---|
kw | str | ✅ | 搜索的关键词 |
time | int | ✅ | 时间筛选 (筛选的开始时间戳)如 :1天内(当前时间戳-86400*1) |
search请求参数
参数名 | 类型 | 是否必须 | 说明 |
---|---|---|---|
cursor | int | ✅ | 首次请求无需,再次请求取上次返回值 |
limit | int | ✅ | 每页返回数据条数,默认5最大20,配合cursor使用 |
last_status | int | ✅ | 首次请求无需,再次请求取上次返回值 |
kw | str | ✅ | 搜索的关键词 |
cid | int | ✅ | 分类ID |
time | int | ✅ | 时间筛选 (筛选的开始时间戳)如 :1天内(当前时间戳-86400*1) |
请求示例
# GET请求
curl -X GET 'https://站点接口域名/openapi/fenlei/search?kw=我&cursor=0&cid=3&limit=5&last_status=1&time=1608514922' \
-H 'Authorization: Bearer 5d39164d1f281' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
接口响应说明
search-categories响应示例
{
"code": 0,
"text": "",
"data": {
"search_categories": [
{
"id": 25,
"name": "经典单图",
"logo": "https://qiance.qianfanyun.com/1558592260918500.jpg",
"total": 1,
"parent_id": 0,
"parent_name": ""
},
{
"id": 139,
"name": "二手房",
"logo": "",
"total": 1,
"parent_id": 138,
"parent_name": "价格突出"
},
{
"id": 327,
"name": "求租求购",
"logo": "https://qiance.qianfanyun.com/1590022887613005.jpg",
"total": 1,
"parent_id": 0,
"parent_name": ""
},
{
"id": 392,
"name": "二手集市",
"logo": "https://qiance.qianfanyun.com/1606465817434967.jpg",
"total": 1,
"parent_id": 0,
"parent_name": ""
}
],
"totals": 4,
"kw": "我"
},
"time": 1608014193
}
data响应结果说明
字段名 | 类型 | 说明 |
---|---|---|
search_categories | array | 跟关键词搜索相关的分类列表 |
kw | str | 关键词 |
category_id | int | 当前分类ID |
totals | int | 当前搜索关键词总信息数量 |
search_categories响应结果说明
字段名 | 类型 | 说明 |
---|---|---|
id | int | 分类ID |
name | str | 分类名 |
logo | str | 分类LOGO |
total | int | 该分类下的相关搜索数量 |
parent_id | str | 主分类ID |
parent_name | str | 主分类名 |
search响应示例
{
"code": 0,
"text": "",
"data": {
"category_id": "25",
"kw": "我",
"data_list": [
{
"data": {
"info_id": 20879,
"category_id": 25,
"user_id": 1728,
"group_id": 1038,
"apply_num": 0,
"pass_at": 1605597176,
"theme_template": 6,
"views": "165浏览",
"title": "我改了标题了,你猜下原来标题是啥吧",
"is_pay": 1,
"top": 1,
"top_expire": 1605597158,
"done": 2,
"operate_time": "11-18",
"on_sale": 1,
"unsale_at": "1970-01-01 08:00:00",
"status": 1,
"privacy_status": 0,
"expire_at": "1613464038",
"package": null,
"refresh_at": "11-18",
"updated_at": "2020-12-13 05:22:31",
"created_at": "2020-11-17 15:12:38",
"user": {
"uid": "1728",
"user_id": "1728",
"avatar": "http://bbs1.qianfanyun.com/uc_server/avatar.php?uid=1728&size=big",
"gender": "2",
"is_vip": 0,
"badges": [
"https://qiance.qianfanyun.com/static/group/badges/8.png"
],
"username": "wyx呵呵",
"signature": "",
"is_followed": 0,
"direct": "qianfanyidong://user/?uid=1728",
"tags": {
"is_join_meet": "0",
"groups": [
{
"text": "LV7",
"bgcolor": "#ffcaed"
},
{
"text": "师长",
"bgcolor": "#ffb2e5"
}
]
}
},
"redpackage": null,
"top_effective": false,
"allow_share_reward": false,
"have_package": false,
"direct": "qianfanyidong://classifydetail?url=https://站点接口域名/wap-view/fenlei_plugin/view-info/20879&infoid=20879",
"link": "https://站点接口域名/wap-view/fenlei/view-info/20879",
"newestLogs": [],
"publish_order": null,
"refresh_type": null,
"refresh_time": 1605688038,
"varInList": {
"images": {
"name": "添加图片",
"val": [
{
"url": "http://站点接口域名/images/default_img.png",
"big_url": "http://站点接口域名/images/default_img.png?imageslim|imageView2/1/w/226/h/174|watermark/3/image/aHR0cHM6Ly9xaWFuY2UucWlhbmZhbnl1bi5jb20vd2F0ZXJfaW1nXzIwMjAwODE0Xzk0NS5qcGc=/dissolve/100/gravity/SouthEast/dx/10/dy/65/text/QHd5eOWRteWRtQ==/fontsize/400/dissolve/100/gravity/SouthEast/fill/I2M5ZjJiMA==/font/5b6u6L2v6ZuF6buR/dx/10/dy/35/text/SUQ6MTcyOA==/fontsize/400/dissolve/100/gravity/SouthEast/fill/I2M5ZjJiMA==/font/5b6u6L2v6ZuF6buR/dx/10/dy/10",
"width": 226,
"height": 174
}
]
},
"title": {
"name": "标题",
"val": "我改了标题了,你猜下原来标题是啥吧"
},
"tags": {
"name": "标签",
"val": [
"五险一金"
]
}
},
"company": null,
"share": {
"image": "http://站点接口域名/images/default_img.png",
"title": "[经典单图]我改了标题了,你猜下原来标题是啥吧",
"content": "",
"url": "https://站点接口域名/wap-view/fenlei_plugin/view-info/20879?share_user_id=101&share=ios",
"direct": ""
},
"wxMiniProgram": null,
"allow_top": 2,
"category": {
"id": 25,
"name": "",
"logo": "https://qiance.qianfanyun.com/1558592260918500.jpg",
"allow_info_modify": 1,
"info_order": "1"
},
"group": {
"id": 1038,
"name": "10审核无支",
"color": "#a3a1e6"
},
"group_auth": false,
"group_tag": "10审核无支"
},
"line": 2,
"type": 316
}
],
"last_status": "1",
"cursor": 1605688038
},
"time": 1608014018
}
data响应结果说明
字段名 | 类型 | 说明 |
---|---|---|
data_list | array | 信息列表 |
cursor | int | 下次请求时需携带的参数 |
lastStatus | int | 下次请求时需携带的参数 |
kw | str | 关键词 |
category_id | int | 当前分类ID |
data_list响应结果说明
字段名 | 类型 | 说明 |
---|---|---|
info_id | int | 信息ID |
title | str | 信息标题 |
views | str | 浏览量 |
top | int | 置顶类型 3全局 2分类 1不置顶 |
refresh_at | str | 上次刷新时间 |
refresh_time | str | 上次刷新时间戳 |
user | array | 作者信息 |
varInList | array | 信息 |
user响应结果说明
字段名 | 类型 | 说明 |
---|---|---|
user_id | int | 用户ID |
avatar | str | 用户头像 |
gender | int | 性别 1男 2女 |
username | str | 用户名 |
signature | str | 用户签名 |
is_followed | int | 是否关注 |
tags | array | 用户标签 |
varInList响应结果说明
字段名 | 类型 | 说明 |
---|---|---|
images | array | 图片 |
title | array | 标题 |
tags | array | 标签 |
detail | array | 详细描述 |
images响应结果说明
字段名 | 类型 | 说明 |
---|---|---|
url | str | 图片链接 |
big_url | str | 图片链接 带水印 |
width | int | 宽 |
height | str | 高 |
文档更新时间: 2020-12-23 17:16 作者:谢帆