{
  "openapi": "3.0.1",
  "info": {
    "title": "Cheap Flight Prices API: Airfare Calendar, Aviasales Data",
    "description": "Cheap flight prices and airfare trends from the Aviasales Data API: cheapest tickets for dates, month and week price calendars, non-stop fares, special offers, popular routes and destinations, plus IATA airport, city and airline data. Bring your own key.",
    "version": "0.1",
    "x-build-id": "Wz41zkc8thwmRpiRy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~cheap-flight-prices-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-cheap-flight-prices-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/nabeelbaghoor~cheap-flight-prices-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-cheap-flight-prices-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/nabeelbaghoor~cheap-flight-prices-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-cheap-flight-prices-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to read",
            "enum": [
              "pricesForDates",
              "groupedPrices",
              "latestPrices",
              "monthMatrix",
              "weekMatrix",
              "nearestPlaces",
              "priceRange",
              "specialOffers",
              "popularDirections",
              "cheapPrices",
              "directPrices",
              "calendarPrices",
              "cityDirections",
              "countries",
              "cities",
              "airports",
              "airlines"
            ],
            "type": "string",
            "description": "Each mode calls one documented Aviasales Data API route. The price modes need your Travelpayouts API token; the four reference file modes do not. Prices come from a cache of what Aviasales users searched recently, not from a live search.",
            "default": "pricesForDates"
          },
          "origins": {
            "title": "Origins (IATA codes)",
            "type": "array",
            "description": "IATA city or airport codes to fly from, such as LON, NYC or MAD, one per line. Every origin is paired with every destination, up to 100 routes a run. Popular destinations from a city reads origins only.",
            "items": {
              "type": "string"
            }
          },
          "destinations": {
            "title": "Destinations (IATA codes)",
            "type": "array",
            "description": "IATA city or airport codes to fly to, such as BCN, PAR or HKT, one per line. Optional in several modes (leave it empty for every destination); required for the month, week and day price calendars, nearby airports and grouped prices. Popular directions reads destinations only.",
            "items": {
              "type": "string"
            }
          },
          "departureDate": {
            "title": "Departure date or month",
            "type": "string",
            "description": "Optional. YYYY-MM or YYYY-MM-DD, such as 2026-12 or 2026-12-18. The v1 routes and the nearby airports matrix take a month only. Latest prices also take a year (YYYY) with the period type below."
          },
          "returnDate": {
            "title": "Return date or month",
            "type": "string",
            "description": "Optional. YYYY-MM or YYYY-MM-DD. Leave empty for one way tickets."
          },
          "oneWay": {
            "title": "One way or round trip",
            "enum": [
              "",
              "true",
              "false"
            ],
            "type": "string",
            "description": "Tickets for dates, latest prices, month calendar and price range. The API default is one way.",
            "default": ""
          },
          "direct": {
            "title": "Non-stop only",
            "enum": [
              "",
              "true",
              "false"
            ],
            "type": "string",
            "description": "Tickets for dates, grouped prices and price range. The API default includes tickets with stops.",
            "default": ""
          },
          "sorting": {
            "title": "Sort by",
            "enum": [
              "",
              "price",
              "route",
              "distance_unit_price"
            ],
            "type": "string",
            "description": "Tickets for dates take price or route popularity; latest prices also take price per kilometre.",
            "default": ""
          },
          "uniqueRoutes": {
            "title": "Unique routes only",
            "type": "boolean",
            "description": "Tickets for dates with only an origin set: return one ticket per route (sent as unique=true)."
          },
          "groupBy": {
            "title": "Group by",
            "enum": [
              "",
              "departure_at",
              "month",
              "dates",
              "directions"
            ],
            "type": "string",
            "description": "Grouped prices group by departure day or by month; latest prices group by dates or by destinations.",
            "default": ""
          },
          "periodType": {
            "title": "Period type (latest prices)",
            "enum": [
              "",
              "year",
              "month",
              "day"
            ],
            "type": "string",
            "description": "Latest prices: the period the departure date names. Without it the API returns flights in the current month.",
            "default": ""
          },
          "tripClass": {
            "title": "Cabin class (latest prices)",
            "enum": [
              "",
              "0",
              "1",
              "2"
            ],
            "type": "string",
            "description": "Latest prices only.",
            "default": ""
          },
          "tripDuration": {
            "title": "Trip duration",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Optional. Latest prices: length of stay in days. Month calendar: length of stay in weeks (1 to 52)."
          },
          "minTripDuration": {
            "title": "Minimum trip length (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Optional. Grouped prices: shortest stay between departure and return."
          },
          "maxTripDuration": {
            "title": "Maximum trip length (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Optional. Grouped prices: longest stay between departure and return."
          },
          "showToAffiliates": {
            "title": "Prices found with a partner marker only",
            "enum": [
              "",
              "true",
              "false"
            ],
            "type": "string",
            "description": "Latest prices and the month, week and nearby matrices. The API default (true) returns only prices found through partner markers, which the docs recommend.",
            "default": ""
          },
          "nearbyVariants": {
            "title": "Nearby route variants",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Optional. Nearby airports: how many origin and destination variants to return, 1 to 20 (1 is just the route asked for)."
          },
          "flexibility": {
            "title": "Date flexibility (days)",
            "minimum": 0,
            "maximum": 7,
            "type": "integer",
            "description": "Optional. Nearby airports: widen the dates by up to 7 days either side."
          },
          "calendarType": {
            "title": "Build the calendar on",
            "enum": [
              "",
              "departure_date",
              "return_date"
            ],
            "type": "string",
            "description": "Flight price trends: one row per departure day or per return day.",
            "default": ""
          },
          "stayLength": {
            "title": "Length of stay (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Optional. Flight price trends: length of stay in the destination."
          },
          "minPrice": {
            "title": "Minimum price",
            "minimum": 0,
            "type": "integer",
            "description": "Price range search: the lowest ticket price, in the chosen currency."
          },
          "maxPrice": {
            "title": "Maximum price",
            "minimum": 0,
            "type": "integer",
            "description": "Price range search: the highest ticket price, in the chosen currency."
          },
          "airline": {
            "title": "Airline (IATA code)",
            "type": "string",
            "description": "Optional. Special offers: only offers from this airline, such as BA or IB."
          },
          "currency": {
            "title": "Currency",
            "type": "string",
            "description": "Three letter currency code for prices, such as usd, eur or gbp. The API default is rub.",
            "default": "usd"
          },
          "market": {
            "title": "Market",
            "type": "string",
            "description": "Optional. Two letter data source market, such as us, gb or de. Each Aviasales site keeps its own cache; by default the market follows the origin."
          },
          "locale": {
            "title": "Language of names",
            "type": "string",
            "description": "Optional. Popular directions, special offers and price range: language of city and airline names, such as en or de."
          },
          "marker": {
            "title": "Affiliate marker",
            "type": "string",
            "description": "Optional. Your Travelpayouts partner marker. It is added as marker= to every ticketUrl built from the API's ticket links; the raw link is kept unchanged in the link column."
          },
          "dataLanguage": {
            "title": "Reference data language",
            "enum": [
              "en",
              "ru",
              "de",
              "fr",
              "es",
              "it",
              "pt",
              "tr",
              "th",
              "zh-CN"
            ],
            "type": "string",
            "description": "Countries, cities, airports and airlines modes: the language of the file.",
            "default": "en"
          },
          "iataCodes": {
            "title": "Only these IATA codes",
            "type": "array",
            "description": "Optional. Reference modes: keep only these codes, such as LHR, LON or BA. Filtered in the actor, so only matching rows are charged.",
            "items": {
              "type": "string"
            }
          },
          "countryCodes": {
            "title": "Only these countries",
            "type": "array",
            "description": "Optional. Countries, cities and airports modes: keep only these two letter country codes.",
            "items": {
              "type": "string"
            }
          },
          "flightableOnly": {
            "title": "Only places with scheduled flights",
            "type": "boolean",
            "description": "Cities and airports modes: keep only cities with a flightable airport and airports marked flightable."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "The most rows this run returns and charges for, across all routes.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Pacing for calls to the API. The documented limits are 60 to 600 a minute per route; the default keeps load modest, as the affiliate terms ask.",
            "default": 60
          },
          "apiKey": {
            "title": "Travelpayouts API token",
            "type": "string",
            "description": "Your Aviasales Data API token from the API token section of your Travelpayouts profile. Needed for every price mode, not for the reference files. Stored as a secret, sent only in the X-Access-Token header to api.travelpayouts.com and never logged. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}