openapi: 3.0.3
servers:
  - url: "https://aviation-edge.com/v2/public"
tags:
  - name: Future Schedules API

paths:
  /flightsFuture:
    get:
      tags:
        - Future Schedules API
      description: "Future Schedules Data"
      operationId: getFutureSchedules
      parameters:
        - $ref: "#/components/parameters/iatacodeParam"
        - $ref: "#/components/parameters/typeParam"
        - $ref: "#/components/parameters/dateParam"
        - $ref: "#/components/parameters/airline_iataParam"
        - $ref: "#/components/parameters/airline_icaoParam"
        - $ref: "#/components/parameters/flight_numParam"

      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FutureSchedulesResponse"

      security:
        - api_key: []

components:
  parameters:
    dateParam:
      name: date
      required: true
      description: "Future date in YYYY-MM-DD format <p> <i>Example:</i> https://aviation-edge.com/v2/public/flightsFuture?key=[API_KEY]&type=departure&iataCode=BER&<b><font color=#eb9532>date</b></font>=2024-09-13"
      in: query
      schema:
        type: string

    iatacodeParam:
      name: iataCode
      required: true
      description: "Airport IATA code <p> <i>Example:</i> https://aviation-edge.com/v2/public/flightsFuture?key=[API_KEY]&type=departure&<b><font color=#eb9532>iataCode</b></font>=BER&date=2024-05-03"
      in: query
      schema:
        type: string

    typeParam:
      name: type
      required: true
      description: 'Either "departure" or "arrival" as both within the same query is not possible <p> <i>Example:</i> https://aviation-edge.com/v2/public/flightsFuture?key=[API_KEY]&<b><font color=#eb9532>type</b></font>=departure&iataCode=BER&date=2025-04-14'
      in: query
      schema:
        type: string

    datefromParam:
      name: date_from
      description: "The start of the date range for which you search for flights "
      in: query
      schema:
        type: string

    datetoParam:
      name: date_from
      description: "The end of the date range for which you search for flights "
      in: query
      schema:
        type: string

    statusParam:
      name: status
      description: "Flight status designated as (started, en-route, landed, unknown) For outputs limit the value"
      in: query
      schema:
        type: string

    dep_iataCodeParam:
      name: dep_iataCode
      description: 'Filter of departure airport if "arrival" for "&type=" was chosen, based on the airport IATA code <p> <i>Example:</i> https://aviation-edge.com/v2/public/flightsFuture?key=[API_KEY]&type=arrival&iataCode=BER&date=2024-05-03&<b><font color=#eb9532>dep_iataCode</b></font>=DXB '
      in: query
      schema:
        type: string

    dep_icaoCodeParam:
      name: dep_icaoCode
      description: 'Filter of departure airport if "arrival" for "&type=" was chosen, based on the airport ICAO code <p> <i>Example:</i> https://aviation-edge.com/v2/public/flightsFuture?key=[API_KEY]&type=arrival&iataCode=BER&date=2024-05-03&<b><font color=#eb9532>dep_icaoCode</b></font>=YSSY'
      in: query
      schema:
        type: string

    departure_terminalParam:
      name: departure_terminal
      description: "The terminal at which the departure is"
      in: query
      schema:
        type: string

    departure_delayParam:
      name: departure_delay
      description: "Departure delay measured in minutes "
      in: query
      schema:
        type: string

    departure_sch_timeParam:
      name: departure_sch_time
      description: "Scheduled departure of flight "
      in: query
      schema:
        type: string

    departure_est_timeParam:
      name: departure_est_time
      description: "Estimated time of departure of a fligth "
      in: query
      schema:
        type: string

    departure_act_timeParam:
      name: departure_act_time
      description: "The actual time of departure of a flight"
      in: query
      schema:
        type: string

    departure_est_runwayParam:
      name: departure_est_runway
      description: "Estimated time of departure at runaway "
      in: query
      schema:
        type: string

    departure_act_runwayParam:
      name: departure_act_runway
      description: "The actual time of departure at runaway "
      in: query
      schema:
        type: string

    arr_iataCodeParam:
      name: arr_iataCode
      description: ' Filter of arrival airport if "departure" for "&type=" was chosen, based on the airport IATA code <p> <i>Example:</i> https://aviation-edge.com/v2/public/flightsFuture?key=[API_KEY]&type=departure&iataCode=BER&date=2025-04-14&<b><font color=#eb9532>arr_iataCode</b></font>=SFO'
      in: query
      schema:
        type: string

    arr_icaoCodeParam:
      name: arr_icaoCode
      description: 'Filter of arrival airport if "departure" for "&type=" was chosen, based on the airport ICAO code <p> <i>Example:</i> https://aviation-edge.com/v2/public/flightsFuture?key=[API_KEY]&type=departure&iataCode=BER&date=2025-04-14&<b><font color=#eb9532>arr_icaoCode</b></font>=KSFO'
      in: query
      schema:
        type: string

    arrival_terminalParam:
      name: arrival_terminal
      description: "The terminal at which the arrival is "
      in: query
      schema:
        type: string

    arrival_delayParam:
      name: arrival_delay
      description: "Arrival delay measured in minutes"
      in: query
      schema:
        type: string

    arrival_sch_timeParam:
      name: arrival_sch_time
      description: "Scheduled arrival of flight "
      in: query
      schema:
        type: string

    arrival_est_timeParam:
      name: arrival_est_time
      description: "Estimated time of arrival of a flight"
      in: query
      schema:
        type: string

    arrival_act_timeParam:
      name: arrival_act_time
      description: "The actual time of arrival of a flight "
      in: query
      schema:
        type: string

    arrival_est_runwayParam:
      name: arrival_est_runway
      description: "Estimated time of arrival at runaway"
      in: query
      schema:
        type: string

    arrival_act_runwayParam:
      name: arrival_act_runway
      description: "The actual time of arrival at runaway"
      in: query
      schema:
        type: string

    airline_nameParam:
      name: airline_name
      description: "The name of the airline "
      in: query
      schema:
        type: string

    airline_iataParam:
      name: airline_iata
      description: "Option to filter airline based on airline IATA code <p> <i>Example:</i> https://aviation-edge.com/v2/public/flightsFuture?key=[API_KEY]&type=departure&iataCode=BER&date=2025-04-14&<b><font color=#eb9532>airline_iata</b></font>=LH"
      in: query
      schema:
        type: string

    airline_icaoParam:
      name: airline_icao
      description: "Option to filter airline based on airline ICAO code <p> <i>Example:</i> https://aviation-edge.com/v2/public/flightsFuture?key=[API_KEY]&type=departure&iataCode=BER&date=2025-04-14&<b><font color=#eb9532>airline_icao</b></font>=DLH"
      in: query
      schema:
        type: string

    flight_numParam:
      name: flight_num
      description: "Option to filter a specific flight based on its flight number <p> <i>Example:</i> https://aviation-edge.com/v2/public/flightsFuture?key=[API_KEY]&type=departure&iataCode=BER&date=2025-04-14&<b><font color=#eb9532>flight_num</b></font>=AM6258"
      in: query
      schema:
        type: string

    flight_iataParam:
      name: flight_iata
      description: "IATA code of the flight "
      in: query
      schema:
        type: string

    flight_icaoParam:
      name: flight_icao
      description: "ICAO code of the flight "
      in: query
      schema:
        type: string

  schemas:
    FutureSchedulesResponse:
      type: object
      properties:
        weekday:
          type: string
          example: "3"
        departure:
          type: object
          properties:
            iataCode:
              type: string
              example: "ber"
            icaoCode:
              type: string
              example: "eddb"
            terminal:
              type: string
              example: "1"
            gate:
              type: string
              example: "a07"
            scheduledTime:
              type: string
              example: "06:00"
        arrival:
          type: object
          properties:
            iataCode:
              type: string
              example: "ams"
            icaoCode:
              type: string
              example: "eham"
            terminal:
              type: string
              example: ""
            gate:
              type: string
              example: ""
            scheduledTime:
              type: string
              example: "07:25"
        aircraft:
          type: object
          properties:
            modelCode:
              type: string
              example: "b738"
            modelText:
              type: string
              example: "boeing 737-8k2"
        airline:
          type: object
          properties:
            name:
              type: string
              example: ""
            iataCode:
              type: string
              example: "am"
            icaoCode:
              type: string
              example: "am"
        flight:
          type: object
          properties:
            number:
              type: string
              example: "6258"
            iataNumber:
              type: string
              example: "am6258"
            icaoNumber:
              type: string
              example: "am6258"
        codeshared:
          type: object
          properties:
            airline:
              type: object
              properties:
                name:
                  type: string
                  example: "klm"
                iataCode:
                  type: string
                  example: "kl"
                icaoCode:
                  type: string
                  example: "klm"
            flight:
              type: object
              properties:
                number:
                  type: string
                  example: "1818"
                iataNumber:
                  type: string
                  example: "kl1818"
                icaoNumber:
                  type: string
                  example: "klm1818"

  securitySchemes:
    api_key:
      type: apiKey
      name: key
      in: query
