全世界最好的基于查询的航班跟踪和飞行状态API

AeroAPI(原FlightXML)可为开发人员提供定制访问,借助上百万航班状态输入为任何使用REST/JSON的应用程序提供数据。

开始执行查询,让您的应用程序起飞。 比较层级

主要功能

  • 易于集成,灵活,可扩展
  • 基于REST的现代标准
  • 兼容所有编程语言
  • 全面的开发人员文档和交互式门户
  • 提供99.5%的正常运行时间保证
  • 可定制的航空数据,以满足您独特的应用需求
  • Current and historical flight data
  • 实时、可配置航班事件提醒
  • 预测性ETA,基于ForesightTM

按需查询航班数据

AeroAPI是一个简单、基于查询的API,供软件开发人员用于访问FlightAware的各种航班数据。用户可以获取当前或历史数据。AeroAPI是一个RESTful API,可提供准确、可付诸行动的航空数据。通过纳入ForesightTM,客户还可以使用作为美国半数以上预测性航班ETA的基础的数据。

调用AeroAPI,根据一系列属性组合对航班进行查询,包括

  • 航班或注册号
  • 始发地和/或目的地机场
  • 机型
  • 从低到高的高度范围
  • 从低到高的地速范围

通过AeroAPI检索航班数据,包括:

  • Flight or tail number
  • Aircraft type
  • Origin and/or destination airport
  • 收到最后一个位置的时间
  • 经度、纬度、地速和高度
  • ForesightTM——FlightAware的预测性ETA
  • Historical flight status and tracks New!
  • 如此等等

通过API获取以机场为中心的数据,包括:

  • Scheduled flights
  • 已出发航班
  • 航路飞行航班
  • 已到达航班

AeroAPI代码片段

import requests

apiKey = input("API Key: ")
apiUrl = "https://aeroapi.flightaware.com/aeroapi/"

airport = 'KSFO'
payload = {'max_pages': 2}
auth_header = {'x-apikey':apiKey}

response = requests.get(apiUrl + f"airports/{airport}/flights",
    params=payload, headers=auth_header)

if response.status_code == 200:
    print(response.json())
else:
    print("Error executing request")
String YOUR_API_KEY = "API_KEY_HERE";
String apiUrl = "https://aeroapi.flightaware.com/aeroapi/";

String airport = "KSFO";

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
	.uri(URI.create(apiUrl + "airports/" + airport + "/flights"))
	.headers("x-apikey", YOUR_API_KEY)
	.build();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());

if (response.statusCode() == 200) {
	System.out.println("responseBody: " + response.body());
}
<?php
$apiKey = "YOUR_API_KEY";
$fxmlUrl = "https://aeroapi.flightaware.com/aeroapi/";

$ident = 'SWA45';
$queryParams = array(
	'max_pages' => 2
);
$url = $fxmlUrl . 'flights/' . $ident . '?' . http_build_query($queryParams);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('x-apikey: ' . $apiKey));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

if ($result = curl_exec($ch)) {
	curl_close($ch);
	echo $result;
}
?>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace AeroApi4Sample
{
    public class FlightsResult
    {
        public List<Flight> Flights { get; set; }
    }

    public class Flight
    {
        public string Ident { get; set; }

        [JsonPropertyName("fa_flight_id")]
        public string FaFlightId { get; set; }

        [JsonPropertyName("scheduled_out")]
        public DateTime ScheduledOut { get; set; }
        
        [JsonPropertyName("actual_out")]
        public DateTime? ActualOut { get; set; }
    }

    public class Program
    {
        static void Main( string[] args )
        {
            Console.Write( "API Key: " );
            var strApiKey = Console.ReadLine();

            Console.Write( "Ident to look up (e.g., UAL47): " );
            var strIdentToLookUp = Console.ReadLine();

            var flights = GetFlights( strApiKey, strIdentToLookUp ).Result;
            
            if( flights == null )
            {
                return;
            }

            var nextFlightToDepart = flights.Where( 
                f => f.ActualOut == null 
                ).OrderBy( f => f.ScheduledOut ).First();

            Console.WriteLine( 
                string.Format( 
                    "Next departure of {0} is {1} at {2}", 
                    strIdentToLookUp,
                    nextFlightToDepart.FaFlightId, 
                    nextFlightToDepart.ScheduledOut 
                    ) 
                );
        }

        private static async Task<List<Flight>> GetFlights( string strApiKey, string strIdent )
        {
            using( var client = new HttpClient() )
            {
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(
                    new MediaTypeWithQualityHeaderValue( "application/json" )
                    );
                client.DefaultRequestHeaders.Add( 
                    "x-apikey", 
                    strApiKey 
                    );

                FlightsResult flightResult = null;
                var response = await client.GetAsync(
                    "https://aeroapi.flightaware.com/aeroapi/flights/" + strIdent
                    );
                var contentStream = await response.Content.ReadAsStreamAsync();

                if( response.IsSuccessStatusCode )
                {
                    flightResult = await JsonSerializer.DeserializeAsync<FlightsResult>(
                        contentStream, 
                        new JsonSerializerOptions 
                        {
                            PropertyNameCaseInsensitive = true
                        }
                        );
                }
                else
                {
                    Console.Error.WriteLine( "API call failed: " + response );
                    return null;
                }

                return flightResult.Flights;
            }
        }
    }
}

此处可以查看更多详细的AeroAPI示例。

AeroAPI查询费

单个查询可能返回一对多的结果,这取决于调用的类型和提供的输入参数。出于定价的目的,“结果集”定义为每条记录15个结果。按结果集定价。

Note: The max_pages input parameter can be used to limit/control how many result sets will be returned, with one page being equivalent to one result set.

现在就开始查询! 比较层级

Volume Discounting

All Premium and Standard tier accounts are eligible for volume discounting. The first $1000 of usage per month is always billed at list price, followed by each incremental level of usage being discounted at a more generous level. For monthly usage above $64,000 the discount is set at 94% off, which will enable you to continue to grow your applications and take full advantage of new features with minimal variance in total monthly cost.

Please contact FlightAware for more information regarding additional discounting available with 3 or 4 year term commitments.

被世界各地的组织选用

常见问题

如果API对一个查询返回了多个结果,这种情况如何收费?

通常一个查询只收费一次。不过,对于可能返回多页结果的查询(定义为最多15个结果),则将按返回的总页数收费(按单次查询费乘以返回的页数计算)。您可以控制API为一个查询返回的最大页数。有关如何设置“max_pages”参数的详细信息,请参阅API文档。

如何查看我的AeroAPI的帐单状态?

现有客户可访问AeroAPI门户,查看应计费用。

第4版有什么新功能?

第4版的航班查询和推送提醒可提供更详细的结果,以便您可以通过更少的调用获得相同或更多的信息。我们对API进行了重新设计,以提供更易于使用的RESTful接口。我们全新的交互式门户网站可帮助您了解并体验该API,无需编写任何代码。我们现在还提供99.5%的正常运行时间保证。

我使用的是AeroAPI的第2版或第3版,这些产品未来有何计划?

现有客户可继续使用AeroAPI的第2版和第3版,直至2023年10月31日,同时价格保持不变。新注册用户将不能选择这些旧版产品。我们鼓励旧版AeroAPI客户尽早计划并采用新版AeroAPI,以免因旧版产品在2023年淘汰而受到影响。此外,使用新版AeroAPI的客户可以使用AeroAPI未来的更新,无需改用新的产品。

我使用的是AeroAPI的第2版或第3版,如何转换到第4版?

您现在就可以开始使用新版本的AeroAPI,只需点此在线注册。作为现有AeroAPI客户,选择新版标准或高级订阅可免除前三个月的每月最低费用,以帮助您上手使用。

文档

FlightAware的飞行状态、航班跟踪和航空数据API可以通过REST访问,而且可以使用任何编程语言访问。

Support

请访问我们的常见问题解答,查找一般问题的答案,或者进入我们的论坛获取更多深入信息。

登录

还没有帐户吗? 现在就注册(免费),设置诸多自定义功能、航班提醒等等!
您知道FlightAware航班跟踪是由广告支持吗?
通过允许展示来自FlightAware.com的广告,您可以帮助我们使FlightAware保持免费。我们努力使我们的广告保持相关性,同时不显突兀,以创造一流的体验。在FlightAware上将广告加入白名单快捷而简单,或者请您考虑选择我们的高级帐户.
退出