{
  "openapi": "3.0.1",
  "info": {
    "title": "Flight Most Booked Destinations",
    "description": "\nBefore using this API, we recommend you read our **[Authorization Guide](https://developers.amadeus.com/self-service/apis-docs/guides/authorization-262)** for more information on how to generate an access token.\n\nPlease also be aware that our test environment is based on a subset of the production, this API in test only returns a few selected cities. You can find the list in our **[data collection](https://github.com/amadeus4dev/data-collection)**.",
    "version": "1.1.1"
  },
  "servers": [
    {
      "url": "https://test.api.amadeus.com/v1"
    }
  ],
  "paths": {
    "/travel/analytics/air-traffic/booked": {
      "get": {
        "tags": [
          "air-traffic"
        ],
        "summary": "Returns a list of air traffic reports.",
        "operationId": "getAirTraffic",
        "parameters": [
          {
            "name": "originCityCode",
            "in": "query",
            "description": "Code for the origin city following IATA standard ([IATA table codes](http://www.iata.org/publications/Pages/code-search.aspx)). - e.g. BOS for Boston",
            "required": true,
            "schema": {
              "pattern": "[A-Za-z]{3}",
              "type": "string"
            },
            "example": "MAD"
          },
          {
            "name": "period",
            "in": "query",
            "description": "period when consumers are traveling.\n* It can be a month only. \n* ISO format must be used - e.g. 2015-05. \n* Period ranges are not supported. \n* Only periods from 2011-01 up to previous month are valid. \n* Future dates are not supported.\n",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2017-08"
          },
          {
            "name": "max",
            "in": "query",
            "description": "maximum number of destinations in the response. Default value is 10 and maximum value is 50.",
            "schema": {
              "type": "number",
              "format": "integer",
              "default": 10
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "list of attributes desired in the response or list of attributes to remove from the response (with \"-\" before fields) \n* The attributes names must contain the whole path (except resource name) e.g. travelers",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page[limit]",
            "in": "query",
            "description": "maximum items in one page",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "page[offset]",
            "in": "query",
            "description": "start index of the requested page",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "defines on which attribute the sorting will be done:\n* analytics.flights.score - sort destinations by flights score (decreasing)\n* analytics.travelers.score - sort destination by traveler's score (decreasing)\n",
            "schema": {
              "type": "string",
              "default": "analytics.travelers.score",
              "enum": [
                "analytics.flights.score",
                "analytics.travelers.score"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Operation",
            "content": {
              "application/vnd.amadeus+json": {
                "schema": {
                  "title": "Success",
                  "required": [
                    "data"
                  ],
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Air_Traffic"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/Collection_Meta"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Issue"
                      }
                    }
                  },
                  "example": {
                    "data": [
                      {
                        "analytics": {
                          "flights": {
                            "score": 100
                          },
                          "travelers": {
                            "score": 100
                          }
                        },
                        "destination": "PAR",
                        "subType": "BOOKED",
                        "type": "air-traffic"
                      },
                      {
                        "analytics": {
                          "flights": {
                            "score": 61
                          },
                          "travelers": {
                            "score": 80
                          }
                        },
                        "destination": "TCI",
                        "subType": "BOOKED",
                        "type": "air-traffic"
                      },
                      {
                        "analytics": {
                          "flights": {
                            "score": 93
                          },
                          "travelers": {
                            "score": 65
                          }
                        },
                        "destination": "LON",
                        "subType": "BOOKED",
                        "type": "air-traffic"
                      },
                      {
                        "analytics": {
                          "flights": {
                            "score": 91
                          },
                          "travelers": {
                            "score": 61
                          }
                        },
                        "destination": "BCN",
                        "subType": "BOOKED",
                        "type": "air-traffic"
                      },
                      {
                        "analytics": {
                          "flights": {
                            "score": 61
                          },
                          "travelers": {
                            "score": 51
                          }
                        },
                        "destination": "NYC",
                        "subType": "BOOKED",
                        "type": "air-traffic"
                      },
                      {
                        "analytics": {
                          "flights": {
                            "score": 41
                          },
                          "travelers": {
                            "score": 39
                          }
                        },
                        "destination": "BRU",
                        "subType": "BOOKED",
                        "type": "air-traffic"
                      },
                      {
                        "analytics": {
                          "flights": {
                            "score": 48
                          },
                          "travelers": {
                            "score": 37
                          }
                        },
                        "destination": "UIO",
                        "subType": "BOOKED",
                        "type": "air-traffic"
                      },
                      {
                        "analytics": {
                          "flights": {
                            "score": 15
                          },
                          "travelers": {
                            "score": 19
                          }
                        },
                        "destination": "SDQ",
                        "subType": "BOOKED",
                        "type": "air-traffic"
                      },
                      {
                        "analytics": {
                          "flights": {
                            "score": 22
                          },
                          "travelers": {
                            "score": 11
                          }
                        },
                        "destination": "DXB",
                        "subType": "BOOKED",
                        "type": "air-traffic"
                      },
                      {
                        "analytics": {
                          "flights": {
                            "score": 18
                          },
                          "travelers": {
                            "score": 8
                          }
                        },
                        "destination": "OPO",
                        "subType": "BOOKED",
                        "type": "air-traffic"
                      }
                    ],
                    "meta": {
                      "count": 10,
                      "links": {
                        "self": "https://test.api.amadeus.com/v1/travel/analytics/air-traffic/booked?originCityCode=MAD&page%5Blimit%5D=10&page%5Boffset%5D=0&period=2017-08"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "code    | title                                 \n------- | ------------------------------------- \n477     | INVALID FORMAT\n572     | INVALID OPTION\n2781    | INVALID LENGTH\n4926    | INVALID DATA RECEIVED                               \n32171   | MANDATORY DATA MISSING \t     \n",
            "content": {
              "application/vnd.amadeus+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error_400"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected Error",
            "content": {
              "application/vnd.amadeus+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error_500"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Air_Traffic": {
        "type": "object",
        "properties": {
          "analytics": {
            "$ref": "#/components/schemas/Analytics"
          },
          "destination": {
            "type": "string",
            "description": "IATA code of the destination city - [IATA table codes](http://www.iata.org/publications/Pages/code-search.aspx)",
            "example": "WAS"
          },
          "subType": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "example": "air-traffic"
          }
        }
      },
      "Analytics": {
        "type": "object",
        "properties": {
          "flights": {
            "$ref": "#/components/schemas/Flights"
          },
          "travelers": {
            "$ref": "#/components/schemas/Travelers"
          }
        }
      },
      "Collection_Meta": {
        "title": "Collection_Meta",
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "example": 1
          },
          "links": {
            "title": "CollectionLinks",
            "type": "object",
            "properties": {
              "first": {
                "type": "string",
                "format": "uri",
                "example": "https://test.api.amadeus.com/v1/area/resources?..."
              },
              "last": {
                "type": "string",
                "format": "uri",
                "example": "https://test.api.amadeus.com/v1/area/resources?..."
              },
              "next": {
                "type": "string",
                "format": "uri",
                "example": "https://test.api.amadeus.com/v1/area/resources?..."
              },
              "previous": {
                "type": "string",
                "format": "uri",
                "example": "https://test.api.amadeus.com/v1/area/resources?..."
              },
              "self": {
                "type": "string",
                "format": "uri",
                "example": "https://test.api.amadeus.com/v1/area/resources?..."
              },
              "up": {
                "type": "string",
                "format": "uri",
                "example": "https://test.api.amadeus.com/v1/area/resources?..."
              }
            },
            "example": {
              "self": "https://test.api.amadeus.com/v1/area/resources?param=value"
            }
          }
        }
      },
      "Error_400": {
        "required": [
          "errors"
        ],
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Issue"
            }
          }
        },
        "example": {
          "errors": [
            {
              "code": 477,
              "detail": "invalid query parameter format",
              "source": {
                "example": "CDG",
                "parameter": "airport"
              },
              "status": 400,
              "title": "INVALID FORMAT"
            }
          ]
        }
      },
      "Error_500": {
        "required": [
          "errors"
        ],
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Issue"
            }
          }
        },
        "example": {
          "errors": [
            {
              "code": 141,
              "status": 500,
              "title": "SYSTEM ERROR HAS OCCURRED"
            }
          ]
        }
      },
      "Flights": {
        "type": "object",
        "properties": {
          "score": {
            "type": "number",
            "description": "Approximate score for ranking purposes calculated based on number of flights from / to the airport or city",
            "format": "integer",
            "example": 56
          }
        }
      },
      "Issue": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "an application-specific error code",
            "format": "int64"
          },
          "detail": {
            "type": "string",
            "description": "explanation of the error"
          },
          "source": {
            "title": "Issue_Source",
            "type": "object",
            "properties": {
              "example": {
                "type": "string",
                "description": "a string indicating an example of the right value"
              },
              "parameter": {
                "type": "string",
                "description": "a string indicating which URI query parameter caused the issue"
              },
              "pointer": {
                "type": "string",
                "description": "a JSON Pointer [RFC6901] to the associated entity in the request document"
              }
            },
            "description": "an object containing references to the source of the error"
          },
          "status": {
            "type": "integer",
            "description": "the HTTP status code applicable to this error"
          },
          "title": {
            "type": "string",
            "description": "a short summary of the error"
          }
        }
      },
      "Travelers": {
        "type": "object",
        "properties": {
          "score": {
            "type": "number",
            "description": "Approximate score for ranking purposes calculated based on number of travelers in the location.",
            "format": "integer",
            "example": 68
          }
        }
      }
    },
    "responses": {
      "400": {
        "description": "code    | title                                 \n------- | ------------------------------------- \n477     | INVALID FORMAT\n572     | INVALID OPTION\n2781    | INVALID LENGTH\n4926    | INVALID DATA RECEIVED                               \n32171   | MANDATORY DATA MISSING \t     \n",
        "content": {
          "application/vnd.amadeus+json": {
            "schema": {
              "$ref": "#/components/schemas/Error_400"
            }
          }
        }
      },
      "500": {
        "description": "Unexpected Error",
        "content": {
          "application/vnd.amadeus+json": {
            "schema": {
              "$ref": "#/components/schemas/Error_500"
            }
          }
        }
      },
      "air-traffic": {
        "description": "Successful Operation",
        "content": {
          "application/vnd.amadeus+json": {
            "schema": {
              "title": "Success",
              "required": [
                "data"
              ],
              "type": "object",
              "properties": {
                "data": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Air_Traffic"
                  }
                },
                "meta": {
                  "$ref": "#/components/schemas/Collection_Meta"
                },
                "warnings": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Issue"
                  }
                }
              },
              "example": {
                "data": [
                  {
                    "analytics": {
                      "flights": {
                        "score": 100
                      },
                      "travelers": {
                        "score": 100
                      }
                    },
                    "destination": "PAR",
                    "subType": "BOOKED",
                    "type": "air-traffic"
                  },
                  {
                    "analytics": {
                      "flights": {
                        "score": 61
                      },
                      "travelers": {
                        "score": 80
                      }
                    },
                    "destination": "TCI",
                    "subType": "BOOKED",
                    "type": "air-traffic"
                  },
                  {
                    "analytics": {
                      "flights": {
                        "score": 93
                      },
                      "travelers": {
                        "score": 65
                      }
                    },
                    "destination": "LON",
                    "subType": "BOOKED",
                    "type": "air-traffic"
                  },
                  {
                    "analytics": {
                      "flights": {
                        "score": 91
                      },
                      "travelers": {
                        "score": 61
                      }
                    },
                    "destination": "BCN",
                    "subType": "BOOKED",
                    "type": "air-traffic"
                  },
                  {
                    "analytics": {
                      "flights": {
                        "score": 61
                      },
                      "travelers": {
                        "score": 51
                      }
                    },
                    "destination": "NYC",
                    "subType": "BOOKED",
                    "type": "air-traffic"
                  },
                  {
                    "analytics": {
                      "flights": {
                        "score": 41
                      },
                      "travelers": {
                        "score": 39
                      }
                    },
                    "destination": "BRU",
                    "subType": "BOOKED",
                    "type": "air-traffic"
                  },
                  {
                    "analytics": {
                      "flights": {
                        "score": 48
                      },
                      "travelers": {
                        "score": 37
                      }
                    },
                    "destination": "UIO",
                    "subType": "BOOKED",
                    "type": "air-traffic"
                  },
                  {
                    "analytics": {
                      "flights": {
                        "score": 15
                      },
                      "travelers": {
                        "score": 19
                      }
                    },
                    "destination": "SDQ",
                    "subType": "BOOKED",
                    "type": "air-traffic"
                  },
                  {
                    "analytics": {
                      "flights": {
                        "score": 22
                      },
                      "travelers": {
                        "score": 11
                      }
                    },
                    "destination": "DXB",
                    "subType": "BOOKED",
                    "type": "air-traffic"
                  },
                  {
                    "analytics": {
                      "flights": {
                        "score": 18
                      },
                      "travelers": {
                        "score": 8
                      }
                    },
                    "destination": "OPO",
                    "subType": "BOOKED",
                    "type": "air-traffic"
                  }
                ],
                "meta": {
                  "count": 10,
                  "links": {
                    "self": "https://test.api.amadeus.com/v1/travel/analytics/air-traffic/booked?originCityCode=MAD&page%5Blimit%5D=10&page%5Boffset%5D=0&period=2017-08"
                  }
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "fields": {
        "name": "fields",
        "in": "query",
        "description": "list of attributes desired in the response or list of attributes to remove from the response (with \"-\" before fields) \n* The attributes names must contain the whole path (except resource name) e.g. travelers",
        "schema": {
          "type": "string"
        }
      },
      "pageLimit": {
        "name": "page[limit]",
        "in": "query",
        "description": "maximum items in one page",
        "schema": {
          "type": "integer",
          "default": 10
        }
      },
      "pageOffset": {
        "name": "page[offset]",
        "in": "query",
        "description": "start index of the requested page",
        "schema": {
          "type": "integer",
          "default": 0
        }
      },
      "sort": {
        "name": "sort",
        "in": "query",
        "description": "defines on which attribute the sorting will be done:\n* analytics.flights.score - sort destinations by flights score (decreasing)\n* analytics.travelers.score - sort destination by traveler's score (decreasing)\n",
        "schema": {
          "type": "string",
          "default": "analytics.travelers.score",
          "enum": [
            "analytics.flights.score",
            "analytics.travelers.score"
          ]
        }
      }
    }
  }
}