DEVELOPER / PUBLIC API
机场谱公开 API
v1 API 提供只读机场数据与已发布内容摘要,适合研究、工具集成和数据展示。公开字段与网站使用相同的数据服务边界。
API / REFERENCE
端点
获取公开机场列表:
GET https://jichang.gg/api/v1/airports下载 CSV:
GET https://jichang.gg/api/v1/airports.csv获取单个机场详情:
GET https://jichang.gg/api/v1/airports/{slug}获取机场监控历史:
GET https://jichang.gg/api/v1/airports/{slug}/monitoring获取机场评分历史:
GET https://jichang.gg/api/v1/airports/{slug}/scores获取已发布内容摘要:
GET https://jichang.gg/api/v1/newsAPI / REFERENCE
机场列表参数
| 参数 / 状态码 | 默认值 / 错误代码 | 说明 |
|---|---|---|
| category | all | all、stable、budget 或 new |
| page | 1 | 正整数,最大 1000 |
| limit | 25 | 每页数量,最大 100 |
API / REFERENCE
内容列表参数
| 参数 / 状态码 | 默认值 / 错误代码 | 说明 |
|---|---|---|
| category | all | all、platform、industry、risk、data-report 或 guide |
| topic | all | 五个指南主题之一;非 all 时自动限定 category=guide |
| page | 1 | 正整数,最大 1000 |
| limit | 25 | 每页数量,最大 100 |
内容接口拒绝未知或重复参数。若提供具体 topic,category 只能省略、使用 all 或 guide;响应中的 category 会规范为 guide。
API / REFERENCE
请求示例
curl "https://jichang.gg/api/v1/airports?category=stable&limit=10"curl -OJ "https://jichang.gg/api/v1/airports.csv?category=budget"curl "https://jichang.gg/api/v1/airports/example-airport"curl "https://jichang.gg/api/v1/airports/example-airport/monitoring?days=7&limit=168"curl "https://jichang.gg/api/v1/airports/example-airport/scores?days=90&limit=90"curl "https://jichang.gg/api/v1/news?topic=safety&limit=10"API / REFERENCE
响应示例
{
"apiVersion": "1",
"category": "all",
"page": 1,
"limit": 25,
"total": 0,
"totalPages": 0,
"updatedAt": null,
"data": []
}详情端点返回公开评分维度、套餐、覆盖范围、兼容客户端、监控摘要和风险历史:
{
"apiVersion": "1",
"data": {
"slug": "example-airport",
"name": "示例机场",
"status": "online",
"score": {
"overall": 90,
"stability": 95,
"performance": 88,
"priceValue": 86,
"risk": 92,
"trust": 89
},
"plans": [],
"riskEvents": []
}
}内容端点只返回公开摘要,不包含正文、内部 ID、草稿、未来文章或私有来源字段:
{
"apiVersion": "1",
"category": "guide",
"topic": "safety",
"page": 1,
"limit": 10,
"total": 1,
"totalPages": 1,
"updatedAt": "2026-08-19T08:30:00.000Z",
"data": [
{
"slug": "example-guide",
"title": "示例指南",
"summary": "公开内容摘要。",
"category": "guide",
"topic": "safety",
"authorName": "机场谱编辑部",
"publishedAt": "2026-08-19T08:00:00.000Z",
"updatedAt": "2026-08-19T08:00:00.000Z",
"articleUrl": "https://jichang.gg/news/example-guide"
}
]
}监控端点支持最近 1、7 或 30 天,默认返回最近 7 天最多 168 个小时级采样点,最大可请求 720 个点。结果按时间升序排列。
评分历史支持最近 30、90 或 365 天,默认 90 天。不同评分方法版本会拆分为独立序列,避免把方法变更误解为评分波动。
API / REFERENCE
错误响应
| 参数 / 状态码 | 默认值 / 错误代码 | 说明 |
|---|---|---|
| 400 | invalid_query | 查询参数未知、重复、越界或互相冲突 |
| 400 | invalid_airport_slug | 机场 slug 格式无效 |
| 404 | airport_not_found | 机场不存在或未达到公开条件 |
| 429 | rate_limit_exceeded | 超过共享请求配额 |
API / REFERENCE
缓存与使用
成功响应允许边缘缓存 5 分钟,并提供 10 分钟 stale-while-revalidate。当前接口无需 API 密钥,并由 Cloudflare 按客户端执行每分钟 120 次的共享配额。机场 JSON、CSV 与内容请求共同计数,超出后返回429和Retry-After: 60。
X-RateLimit-Policy描述当前策略;X-RateLimit-Enforced说明该请求是否经过限流绑定。客户端应合理控制请求频率,并保留机场谱来源链接。
CSV 导出使用 UTF-8 BOM 和标准双引号转义,最多返回 1000 条公开记录。响应头X-Export-Truncated会说明结果是否因上限截断。