Aircraft API
Aircraft API 支持按注册号搜索飞机,并查询飞机的历史记录。查询结果不保证实时更新。
可以在 Aircraft Demo 中使用默认注册号 B-1086 试一次查询。
请求头
匿名请求无需额外请求头。所有公开接口的匿名请求共享每分钟 60 次的额度。
携带有效的 API 凭据可豁免匿名总限速,申请方式见获取 API 凭据。
X-API-ID: <id>
X-API-Secret: <secret>
搜索飞机
GET https://api.togaphotos.com/aircraft?reg=B-1086
请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
reg | 查询参数 | string | 是 | 注册号关键词,例如 B-1086。去除首尾空白后需要 3 到 32 个字符,仅支持英文字母、数字、点、下划线和连字符。 |
只允许一个 reg 参数,不接受重复参数或其他查询参数。
请求示例
curl "https://api.togaphotos.com/aircraft?reg=B-1086"
响应示例
以下为示例响应,cached_at 为示例时间。
{
"msg": "查询成功",
"data": [
{
"id": 16232,
"reg": "B-1086",
"msn": "167",
"ln": null,
"test_reg": "F-WZHG",
"airline_cn": "中国国际航空",
"airline_en": "Air China",
"airtype": {
"manufacturer_cn": "空中客车",
"manufacturer_en": "Airbus",
"type": "A350",
"sub_type": "A350-941",
"icao_code": "A359\n"
},
"configuration": "A350-941",
"manufacturer": "Airbus",
"program": "A350",
"delivery_date": "2018-08-08",
"first_flight_date": "2018-05-31",
"sequence_no": "1"
}
],
"cached_at": "2026-05-24T07:12:29Z"
}
响应字段
| 字段 | 类型 | 含义 |
|---|---|---|
msg | string | 请求结果说明。 |
data | array | 匹配注册号关键词的飞机列表。 |
cached_at | string | 当前结果的缓存时间,使用 UTC 时区,格式为 ISO 8601。 |
data[] 字段
| 字段 | 类型 | 含义 |
|---|---|---|
id | number | 飞机标识,用于查询历史记录。 |
reg | string | 当前或匹配到的注册号。 |
msn | string | null | Manufacturer Serial Number,制造商序列号。 |
ln | string | null | Line Number,生产线号。 |
test_reg | string | null | 试飞注册号。 |
airline_cn | string | null | 航司或运营方中文名称。 |
airline_en | string | null | 航司或运营方英文名称。 |
airtype.manufacturer_cn | string | null | 制造商中文名称。 |
airtype.manufacturer_en | string | null | 制造商英文名称。 |
airtype.type | string | null | 基础机型。 |
airtype.sub_type | string | null | 具体子型号。 |
airtype.icao_code | string | null | ICAO 机型代码。 |
configuration | string | null | 具体构型或子型号。 |
manufacturer | string | null | 制造商英文名称。 |
program | string | null | 机型项目或系列。 |
delivery_date | string | null | 交付日期,格式通常为 YYYY-MM-DD。 |
first_flight_date | string | null | 首飞日期,格式通常为 YYYY-MM-DD。 |
sequence_no | string | number | null | 同一飞机历史状态中的顺序号。 |
查询飞机历史记录
GET https://api.togaphotos.com/aircraft/34621/records
请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
id | 路径参数 | integer | 是 | 飞机标识,使用搜索结果中的 id,必须是有效正整数。 |
请求不接受查询参数。
请求示例
curl "https://api.togaphotos.com/aircraft/34621/records"
响应示例
以下为示例响应,cached_at 为示例时间。
{
"msg": "查询成功",
"data": {
"id": "34621",
"construction_number": "27294",
"line_number": "629",
"manufacturer": "Boeing",
"program": "757",
"first_flight_date": "1994-07-14",
"first_flight_precision": "day",
"test_registration": null,
"states": [
{
"registration": "N17104",
"sequence_no": 1,
"airline_cn": "美国大陆航空",
"airline_en": "Continental Airline",
"airtype": {
"manufacturer_cn": "波音",
"manufacturer_en": "Boeing",
"type": "B757",
"sub_type": "B757-200(WL)",
"icao_code": "B752\n"
},
"configuration": "757-224(WL)",
"valid_from_date": "1994-07-29",
"valid_from_precision": "day"
}
]
},
"cached_at": "2026-05-24T07:10:42Z"
}
响应字段
| 字段 | 类型 | 含义 |
|---|---|---|
msg | string | 请求结果说明。 |
data | object | 指定飞机的基础信息和历史状态。 |
cached_at | string | 当前结果的缓存时间,使用 UTC 时区,格式为 ISO 8601。 |
data 字段
| 字段 | 类型 | 含义 |
|---|---|---|
id | string | number | 飞机标识。 |
construction_number | string | null | Construction Number,制造编号。 |
line_number | string | null | Line Number,生产线号。 |
manufacturer | string | null | 制造商英文名称。 |
program | string | null | 机型项目或系列。 |
first_flight_date | string | null | 首飞日期,格式通常为 YYYY-MM-DD。 |
first_flight_precision | string | null | 首飞日期精度,例如 day。 |
test_registration | string | null | 试飞注册号。 |
states | array | 飞机的历史状态列表。 |
data.states[] 字段
| 字段 | 类型 | 含义 |
|---|---|---|
registration | string | null | 该历史状态下的注册号。 |
sequence_no | number | string | null | 历史状态顺序号。 |
airline_cn | string | null | 该历史状态下的航司或运营方中文名称。 |
airline_en | string | null | 该历史状态下的航司或运营方英文名称。 |
airtype.manufacturer_cn | string | null | 该历史状态下的制造商中文名称。 |
airtype.manufacturer_en | string | null | 该历史状态下的制造商英文名称。 |
airtype.type | string | null | 该历史状态下的基础机型。 |
airtype.sub_type | string | null | 该历史状态下的具体子型号。 |
airtype.icao_code | string | null | 该历史状态下的 ICAO 机型代码。 |
configuration | string | null | 该历史状态下的具体构型或子型号。 |
valid_from_date | string | null | 该历史状态的生效日期,格式通常为 YYYY-MM-DD。 |
valid_from_precision | string | null | 生效日期精度,例如 day。 |
缓存
成功的查询结果会缓存 24 小时。在缓存有效期内,重复查询可能返回相同的数据和 cached_at。
错误
400:缺少reg、关键词去除首尾空白后长度不在 3 到 32 个字符之间、含不支持的字符、重复提交reg、包含其他查询参数,或历史记录请求中的飞机标识不是有效正整数。401:提交了无效 API 凭据。429:匿名请求的共享额度已用尽,请稍后重试。502:服务暂时无法提供有效响应,请稍后重试。
失败响应不会缓存。