PHP code example of moveodev / flightstats-api

1. Go to this page and download the library: Download moveodev/flightstats-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

moveodev / flightstats-api example snippets


$client = new moveodev\FlightStatsApi\FlexClient([
    'appId' => 'yourAppId',
    'appKey' => 'yourAppKey',
]);

// Get information about flight AA100 departing on September 5th:
$response = $client->schedules()->getFlightByDepartureDate(
    'AA',
    100
    new DateTime('2017-09-05')
);

$client->flightStatus()->getFlightStatusById(123456, [
    // Optional query parameters
    'extendedOptions' => [
        '

$client->flightStatus()->getFlightStatusByArrivalDate('AA', 100, new DateTime('2017-09-05'), [
    // Optional query parameters
    'utc' => true,
    'extendedOptions' => [
        '

$client->flightStatus()->getFlightStatusByDepartureDate('AA', 100, new DateTime('2017-09-05'), [
    // Optional query parameters
    'utc' => true,
    'extendedOptions' => [
        '

$client->airportStatus()->getAirportStatusByArrivalDate('ALA', new DateTime('2018-10-24'), (new DateTime())->format('H'), [
    // Optional query parameters
    'carrier' => 'KC',
    'numHours' => 3,
    'maxFlights' => 5,
    'utc' => false,
    'extendedOptions' => [
        '

$client->airportStatus()->getAirportStatusByDepartureDate('ALA', new DateTime('2018-10-24'), (new DateTime())->format('H'), [
    // Optional query parameters
    'carrier' => 'KC',
    'numHours' => 3,
    'maxFlights' => 5,
    'utc' => false,
    'extendedOptions' => [
        '

$client->schedules()->getFlightByArrivalDate('AA', 100, new DateTime('2017-09-05'), [
    // Optional query parameters
    'extendedOptions' => [
        '

$client->schedules()->getFlightByDepartureDate('AA', 100, new DateTime('2017-09-05'), [
    // Optional query parameters
    'extendedOptions' => [
        '