‹ 首页

开放 API 文档

调用前需先登录后申请 API Key。调用时在请求头携带 Authorization: Bearer 你的密钥,或 URL 参数 ?key=你的密钥,所有接口统一返回 JSON。

帖子列表 GET /api/posts

分页获取最新帖子

参数:page=页码, board=板块ID, size=每页条数

curl "http://chonglangshequ.cn/api/posts" -H "Authorization: Bearer 你的密钥"
帖子详情 GET /api/post

获取帖子内容与回帖

参数:id=帖子ID, page=楼层页码

curl "http://chonglangshequ.cn/api/post" -H "Authorization: Bearer 你的密钥"
板块列表 GET /api/boards

获取全部分区(含二级板块)

参数:无

curl "http://chonglangshequ.cn/api/boards" -H "Authorization: Bearer 你的密钥"
回帖列表 GET /api/replies

获取指定帖子的回帖

参数:post_id=帖子ID

curl "http://chonglangshequ.cn/api/replies" -H "Authorization: Bearer 你的密钥"
用户信息 GET /api/user

获取用户公开资料

参数:id=用户ID

curl "http://chonglangshequ.cn/api/user" -H "Authorization: Bearer 你的密钥"
热帖排行 GET /api/hot

获取热门/最新/精华帖子

参数:type=hot/recent/featured, size=条数

curl "http://chonglangshequ.cn/api/hot" -H "Authorization: Bearer 你的密钥"
帖子搜索 GET /api/search

按关键词搜索帖子标题与内容

参数:q=关键词, page=页码

curl "http://chonglangshequ.cn/api/search" -H "Authorization: Bearer 你的密钥"

当前 1 人在线 · 今日发帖 0 · 今日回帖 0 · 成员 3