getRouteDailyStatistics method
- AirportCodesByEnum codeType,
- String code, {
- DateTime? dateLocal,
Airport routes and daily flight destinations TIER 3
What are the most popular routes from an airport? or Where I can fly from an airport? or How many daily flights to different destinations from an airport? The data will only be available for airports which have at least schedules information available. If the airport is also covered with live or ADS-B coverage, the quality will improve greatly as it will be based on real data rather than on static scheduled data. To check if an airport is tracked and on which level, use /health/services/airports/{icao}/feeds endpoint. You can also use /health/services/feeds/{service}/airports to get the list of covered airports. At the moment airports having both ICAO and IATA code and flight schedules are present available only. Returns: List of routes and daily flights amount departing from an airport.
Parameters:
-
AirportCodesByEnum codeType (required): Type of code to search airport by (
iataoricao) -
String code (required): If
codeTypeis: *icao, then this field must be a 4-character ICAO-code of the airport (e.g.: EHAM, KLAX, UUEE, etc.); *iata, then this field must be a 3-character IATA-code of the airport (e.g.: AMS, SFO, LAX, etc.). Full, stripped and any case formats are acceptable. -
DateTime dateLocal: Local date at the airport (default = null). If specified, returns statistics based on 7 days prior to the date specified. Otherwise, returns statistics based on 7 days prior to the current local date at the airport.
Implementation
Future<DailyRouteStatContract?> getRouteDailyStatistics(
AirportCodesByEnum codeType,
String code, {
DateTime? dateLocal,
}) async {
final response = await getRouteDailyStatisticsWithHttpInfo(
codeType,
code,
dateLocal: dateLocal,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty &&
response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(
await _decodeBodyBytes(response),
'DailyRouteStatContract',
) as DailyRouteStatContract;
}
return null;
}