版本:v1
基础URL:https://8w.bgjq.top/api/v1/public
所有API接口需要使用 API Key 进行认证。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| api_key | string | 是 | API密钥,在请求URL中添加 |
curl "https://8w.bgjq.top/api/v1/public/users?api_key=your_api_key"
GET /users
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| page | integer | 1 | 页码 |
| page_size | integer | 20 | 每页数量(最大100) |
| role | string | - | 按角色筛选 |
| country_id | integer | - | 按国家ID筛选 |
| fields | string | - | 返回字段(逗号分隔) |
| 字段 | 说明 |
|---|---|
| id | 用户ID |
| username | 用户名 |
| game_id | 游戏ID |
| country | 所属国家(含id和name) |
| role | 角色 |
| jhtuid | 简幻通UID |
| level | 等级 |
| created_at | 注册时间 |
# 获取用户列表
curl "https://8w.bgjq.top/api/v1/public/users?api_key=your_api_key"
# 分页查询
curl "https://8w.bgjq.top/api/v1/public/users?api_key=your_api_key&page=1&page_size=10"
# 按角色筛选
curl "https://8w.bgjq.top/api/v1/public/users?api_key=your_api_key&role=secretary_general"
# 指定返回字段
curl "https://8w.bgjq.top/api/v1/public/users?api_key=your_api_key&fields=id,username,role"
{
"success": true,
"message": "成功",
"data": {
"list": [
{
"id": 1,
"username": "admin",
"game_id": "Admin",
"role": "secretary_general",
"country": {
"id": 1,
"name": "国家名称"
},
"created_at": "2026-01-01 00:00:00"
}
],
"pagination": {
"page": 1,
"page_size": 20,
"total": 100,
"total_pages": 5
}
}
}
GET /users/{id}
| 参数 | 类型 | 说明 |
|---|---|---|
| id | integer | 用户ID |
curl "https://8w.bgjq.top/api/v1/public/users/1?api_key=your_api_key"
GET /countries
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| page | integer | 1 | 页码 |
| page_size | integer | 20 | 每页数量(最大100) |
| all | boolean | false | 是否返回全部国家(不含此参数只返回活跃国家) |
| fields | string | - | 返回字段(逗号分隔) |
| 字段 | 说明 |
|---|---|
| id | 国家ID |
| name | 国家名称 |
| declaration | 国家宣言 |
| government_type | 政体 |
| population | 人口 |
| territory_chunks | 领地Chunks |
| flag_url | 旗帜URL |
| is_active | 是否活跃 |
| joined_at | 加入时间 |
| member_count | 成员数量 |
# 获取活跃国家列表
curl "https://8w.bgjq.top/api/v1/public/countries?api_key=your_api_key"
# 获取全部国家
curl "https://8w.bgjq.top/api/v1/public/countries?api_key=your_api_key&all=true"
GET /countries/{id}
GET /stats
无查询参数,返回社区整体统计数据。
| 字段 | 说明 |
|---|---|
| total_users | 用户总数 |
| total_countries | 活跃国家数 |
| total_countries_all | 国家总数(含已退出) |
| users_by_role | 按角色统计的用户数 |
| total_news | 新闻总数 |
| total_proposals | 提案总数 |
| proposals_by_status | 按状态统计的提案数 |
| total_conventions | 公约总数 |
| total_cases | 案件总数 |
| cases_by_status | 按状态统计的案件数 |
| active_trades | 活跃交易数 |
| online_players | 当前在线玩家数 |
| total_diplomatic_relations | 外交关系总数 |
| diplomatic_relations_by_type | 按类型统计的外教关系 |
curl "https://8w.bgjq.top/api/v1/public/stats?api_key=your_api_key"
| 角色 | 说明 |
|---|---|
| secretary_general | 秘书长 |
| permanent_member | 常任理事国 |
| diplomat | 邦国外交官 |
| observer | 观察员 |
| peacekeeper | 维和部队 |
{
"error": "错误信息"
}
| 状态码 | 说明 |
|---|---|
| 400 | 请求参数错误 |
| 401 | 认证失败(API Key无效) |
| 403 | 权限不足 |
| 404 | 资源不存在 |
| 405 | 请求方法不支持 |
| 429 | 调用频率超限 |
| 500 | 服务器内部错误 |
访问 API管理后台 创建和管理API密钥。
users - 用户数据接口权限countries - 国家数据接口权限stats - 统计数据接口权限