全世界最好的以查詢為基礎的航班跟蹤和飛行狀態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上將廣告加入白名單快速而簡單,或者請您考慮選擇我們的高級帳戶.
退出