跳到主要内容

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"
}

响应字段

字段类型含义
msgstring请求结果说明。
dataarray匹配注册号关键词的飞机列表。
cached_atstring当前结果的缓存时间,使用 UTC 时区,格式为 ISO 8601。

data[] 字段

字段类型含义
idnumber飞机标识,用于查询历史记录。
regstring当前或匹配到的注册号。
msnstring | nullManufacturer Serial Number,制造商序列号。
lnstring | nullLine Number,生产线号。
test_regstring | null试飞注册号。
airline_cnstring | null航司或运营方中文名称。
airline_enstring | null航司或运营方英文名称。
airtype.manufacturer_cnstring | null制造商中文名称。
airtype.manufacturer_enstring | null制造商英文名称。
airtype.typestring | null基础机型。
airtype.sub_typestring | null具体子型号。
airtype.icao_codestring | nullICAO 机型代码。
configurationstring | null具体构型或子型号。
manufacturerstring | null制造商英文名称。
programstring | null机型项目或系列。
delivery_datestring | null交付日期,格式通常为 YYYY-MM-DD
first_flight_datestring | null首飞日期,格式通常为 YYYY-MM-DD
sequence_nostring | 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"
}

响应字段

字段类型含义
msgstring请求结果说明。
dataobject指定飞机的基础信息和历史状态。
cached_atstring当前结果的缓存时间,使用 UTC 时区,格式为 ISO 8601。

data 字段

字段类型含义
idstring | number飞机标识。
construction_numberstring | nullConstruction Number,制造编号。
line_numberstring | nullLine Number,生产线号。
manufacturerstring | null制造商英文名称。
programstring | null机型项目或系列。
first_flight_datestring | null首飞日期,格式通常为 YYYY-MM-DD
first_flight_precisionstring | null首飞日期精度,例如 day
test_registrationstring | null试飞注册号。
statesarray飞机的历史状态列表。

data.states[] 字段

字段类型含义
registrationstring | null该历史状态下的注册号。
sequence_nonumber | string | null历史状态顺序号。
airline_cnstring | null该历史状态下的航司或运营方中文名称。
airline_enstring | null该历史状态下的航司或运营方英文名称。
airtype.manufacturer_cnstring | null该历史状态下的制造商中文名称。
airtype.manufacturer_enstring | null该历史状态下的制造商英文名称。
airtype.typestring | null该历史状态下的基础机型。
airtype.sub_typestring | null该历史状态下的具体子型号。
airtype.icao_codestring | null该历史状态下的 ICAO 机型代码。
configurationstring | null该历史状态下的具体构型或子型号。
valid_from_datestring | null该历史状态的生效日期,格式通常为 YYYY-MM-DD
valid_from_precisionstring | null生效日期精度,例如 day

缓存

成功的查询结果会缓存 24 小时。在缓存有效期内,重复查询可能返回相同的数据和 cached_at

错误

  • 400:缺少 reg、关键词去除首尾空白后长度不在 3 到 32 个字符之间、含不支持的字符、重复提交 reg、包含其他查询参数,或历史记录请求中的飞机标识不是有效正整数。
  • 401:提交了无效 API 凭据。
  • 429:匿名请求的共享额度已用尽,请稍后重试。
  • 502:服务暂时无法提供有效响应,请稍后重试。

失败响应不会缓存。