{
  "openapi": "3.0.1",
  "info": {
    "title": "Cheapest Flights Scraper — Trip.com Split Plane Tickets",
    "description": "Finds cheaper flights by pricing a trip two ways on Trip.com: as one ticket, and as two tickets split at a hub (TPE→HKG→PRG). Returns the cheapest of each with total and per-ticket prices, every leg's flights and times, stopover hours, and self-transfer flags. USD by default; $3 per 1,000 results.",
    "version": "0.0",
    "x-build-id": "nZZMHnBIwtnP8OKlZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/data_fate~cheapest-plane-tickets-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-data_fate-cheapest-plane-tickets-scraper",
        "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/data_fate~cheapest-plane-tickets-scraper/runs": {
      "post": {
        "operationId": "runs-sync-data_fate-cheapest-plane-tickets-scraper",
        "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/data_fate~cheapest-plane-tickets-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-data_fate-cheapest-plane-tickets-scraper",
        "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",
        "required": [
          "departureCity",
          "destinationCity"
        ],
        "properties": {
          "departureCity": {
            "title": "Departure City",
            "pattern": "^[A-Za-z]{3}$",
            "minLength": 3,
            "maxLength": 3,
            "type": "string",
            "description": "Three-letter IATA code for where the trip starts — TPE for Taipei, HKG for Hong Kong, SIN for Singapore. Lower case is fine. This is a city, not a terminal: an airport code is widened to the city it serves, so LHR searches all of London and can return a flight from Gatwick or Southend. Where a city has several airports and you only want one of them, filter the results afterwards — the search cannot be narrowed to a single airport."
          },
          "destinationCity": {
            "title": "Destination City",
            "pattern": "^[A-Za-z]{3}$",
            "minLength": 3,
            "maxLength": 3,
            "type": "string",
            "description": "Three-letter IATA code for where the trip ends — PRG for Prague, LON for London, PAR for Paris. Lower case is fine. Widened to the city the same way the departure is, so asking for CDG searches every Paris airport."
          },
          "transitCities": {
            "title": "Split Tickets at These Hub Cities",
            "uniqueItems": true,
            "type": "array",
            "description": "Hub cities to test as the split point of a split-ticket itinerary — the meeting point between two separate tickets — as three-letter IATA codes (lower case is fine). City codes (SEL, TYO, LON) are the safest choice: an airport code works too, but outside the measured ones (ICN, NRT, LHR among them) it matches only flights through that exact airport. Each city multiplies the work, so start with one or two; a city that is already an end of the route is ignored. A city is worth trying when it sits on the way, or when its own market is cheaper — a fare starting in Bangkok or Seoul can undercut the same trip starting at home even after paying to get there. Two tickets mean no through-checked baggage and no protection if the first flight is late, which is what the stopover window below is for.",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z]{3}$"
            }
          },
          "travelDates": {
            "title": "Travel Dates",
            "type": "array",
            "description": "One or more trips. Each is searched separately, and each can be one-way or return. Leave the list empty to search a single round trip about two months out, which is a real search rather than a placeholder.",
            "items": {
              "type": "object",
              "properties": {
                "departureDate": {
                  "title": "Departure Date",
                  "type": "string",
                  "description": "Date of the outbound flight, as YYYY-MM-DD. For a scheduled run, an offset from the day of the run works instead — \"30 days\", \"2 months\" — so the search moves with the schedule rather than aiming at a date that eventually passes.",
                  "editor": "datepicker",
                  "pattern": "^(\\d{4}-\\d{2}-\\d{2}|\\d+\\s*(day|week|month|year)s?)$"
                },
                "returnDate": {
                  "title": "Return Date (leave empty for one-way)",
                  "type": "string",
                  "description": "Date of the return flight, in the same two forms as the outbound date. An offset also counts from the day of the run, not from the departure — a 10-day trip 30 days out is \"30 days\" and \"40 days\". Leave empty to search one-way instead.",
                  "editor": "datepicker",
                  "pattern": "^(\\d{4}-\\d{2}-\\d{2}|\\d+\\s*(day|week|month|year)s?)$"
                }
              },
              "required": [
                "departureDate"
              ]
            }
          },
          "cabinClass": {
            "title": "Cabin Class",
            "enum": [
              "Y",
              "C",
              "F"
            ],
            "type": "string",
            "description": "Cabin class to search: Y = Economy, C = Business, F = First.",
            "default": "Y"
          },
          "numberOfPassengers": {
            "title": "Number of Passengers",
            "minimum": 1,
            "maximum": 9,
            "type": "integer",
            "description": "How many people are travelling. Every fare is priced for the whole party, not per person — a group of three sees the total for three.",
            "default": 1
          },
          "maxStopsPerJourney": {
            "title": "Max Stops per Journey",
            "minimum": 0,
            "maximum": 4,
            "type": "integer",
            "description": "Connections allowed within a single journey. **Set this to 0 for nonstop flights only**, which is what most people mean by a direct flight. Lowering it finds fewer results, since the cheapest fares are usually the ones with the most stops. Applied to each journey of each ticket separately, so a split-ticket trip cannot quietly accumulate four times the limit — left unbounded, one search produced Taipei–Bangkok–Vienna–Prague out and Prague–London–Bangkok–Taipei back, six flights on four airlines.",
            "default": 2
          },
          "airlines": {
            "title": "Filter by Airlines (Optional)",
            "type": "array",
            "description": "Restrict results to specific airlines by IATA code (e.g. CI, BR). Leave empty to search all airlines. Use Airline Match Mode to control how strictly they must match.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "airlineMatchMode": {
            "title": "Airline Match Mode",
            "enum": [
              "all",
              "longest-leg",
              "any"
            ],
            "type": "string",
            "description": "How strictly the airline filter applies; ignored when no airlines are selected. Checked separately for the outbound and the return journey, and only on the ticket carrying the long haul — the carrier flying you to a hub is rarely the one flying onward. \"Longest leg\" (the default) lets a short connecting hop be on another carrier. \"All legs\" is strictest and finds nothing unless your airline flies every segment itself. \"Any leg\" is widest and includes itineraries where only a short hop matches.",
            "default": "longest-leg"
          },
          "minStopoverHours": {
            "title": "Minimum Stopover Hours",
            "minimum": 0,
            "maximum": 168,
            "type": "integer",
            "description": "How long the traveller must have at the transit city between the two separate tickets. This is not an airline connection time: two tickets mean no through-checked baggage and no protection if the first flight is late, so the gap has to cover immigration, baggage reclaim, a fresh check-in that closes an hour before departure, and security again. Four hours is the shortest that is realistic; an overnight is what most people actually do.",
            "default": 4
          },
          "maxStopoverHours": {
            "title": "Maximum Stopover Hours",
            "minimum": 1,
            "maximum": 168,
            "type": "integer",
            "description": "The other end of the same window: the longest gap allowed at the transit city between the two tickets. It also decides how many days of onward departures are searched — one day per 24 hours — because a stopover allowed to last until the day after next has to be looked for there. The search cost depends on the gap between min and max (not max alone), capped at three extra days, so raising the ceiling does not add work when the minimum is high enough to narrow the window. Without this limit a “connection” can turn into days of waiting: gaps of 45 hours were measured before it existed.",
            "default": 36
          },
          "currency": {
            "title": "Currency",
            "enum": [
              "TWD",
              "USD",
              "EUR",
              "JPY",
              "GBP",
              "CNY",
              "HKD",
              "KRW",
              "SGD",
              "AUD",
              "CAD",
              "CHF",
              "NZD",
              "AED",
              "BRL",
              "DKK",
              "IDR",
              "ILS",
              "INR",
              "MOP",
              "MXN",
              "MYR",
              "PHP",
              "PLN",
              "RUB",
              "SAR",
              "SEK",
              "THB",
              "TRY",
              "VND",
              "ZAR"
            ],
            "type": "string",
            "description": "Currency prices are reported in. This is sent with the search, so Trip.com does the conversion. Note that if you schedule runs to track prices over time, a non-local currency adds exchange-rate movement on top of fare movement — a 3% drop may just be the rate. Every result records its currency, so exported data stays readable.",
            "default": "USD"
          },
          "maxResultsPerSearch": {
            "title": "Max Results per Search",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Upper bound on results from each search, where one search is a single route, trip and trip type. A run searches the direct route plus one per transit city, for each trip, so totals multiply — Max Results per Run caps the whole. Raising this does not find cheaper flights: Trip.com returns its cheapest options first, so the lowest price appears even at a low value — it buys more options, not better ones. Expect fewer than you ask for on some searches: a popular direct flight offers a dozen return options while a multi-leg one often has only one or two, and there is no way to build combinations that the airline does not sell.",
            "default": 20
          },
          "maxTotalResults": {
            "title": "Max Results per Run",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Upper bound on results from the whole run, across every route and trip. Cannot be lower than the number of searches — one per trip, plus one per transit city per trip — because every search needs at least one result. This is the limit that governs what a run costs: Max Results per Search is multiplied by the number of searches, so three trips and three transit cities at 100 per search quietly asks for 1,200 results, and this caps that. Whichever of the two limits works out lower decides the per-search budget, and the budget is set before searching rather than trimmed afterwards.",
            "default": 200
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}