{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Flights Scraper 💰$1/1K — Fares, Calendar & Booking",
    "description": "Google Flights scraper: search by origin, destination and date and get every itinerary with price, airline, duration, stops and times; also price calendar and booking links. $1 per 1,000 flights. Typical run: one route in about 6 seconds. Built for AI agents and MCP: route and date in, JSON out.",
    "version": "0.1",
    "x-build-id": "Dj4QhyfGi5H7c3lmA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lergassy~google-flights-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lergassy-google-flights-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/lergassy~google-flights-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lergassy-google-flights-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/lergassy~google-flights-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lergassy-google-flights-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",
        "properties": {
          "origin": {
            "title": "🛫 Origin airport (IATA)",
            "type": "string",
            "description": "3-letter IATA airport code: JFK, LHR, DPS. City codes for several airports also work where Google supports them (LON, NYC). Common city names (\"London\", \"Kraków\") are turned into the code automatically. Needed for a single route and for exploreAnywhere; leave empty only when you pass routes or multiCityLegs."
          },
          "destination": {
            "title": "🛬 Destination airport (IATA)",
            "type": "string",
            "description": "3-letter IATA airport code, e.g. SIN, BKK, or a city code such as LON. Common city names are turned into the code automatically. Ignored when exploreAnywhere is true."
          },
          "departureDate": {
            "title": "📅 Departure date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "YYYY-MM-DD, today or later and at most about 330 days ahead (airlines load schedules about 11 months out). A past date returns a free notice and no flights. Needed together with origin and destination, unless calendarDays is set. With no route at all the Actor runs a demo search."
          },
          "returnDate": {
            "title": "Return date (optional)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Leave empty for one-way. Format <code>YYYY-MM-DD</code>. Round-trip prices are the total for both directions."
          },
          "adults": {
            "title": "👤 Adults",
            "minimum": 1,
            "maximum": 9,
            "type": "integer",
            "description": "Passengers aged 12 and over (1–9). Prices are the total for all passengers.",
            "default": 1
          },
          "children": {
            "title": "Children (2–11)",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Passengers aged 2 to 11. Google applies child fares where the airline offers them.",
            "default": 0
          },
          "infantsInSeat": {
            "title": "Infants in seat",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Under 2 years old, with their own seat (charged as a child fare on most airlines).",
            "default": 0
          },
          "infantsOnLap": {
            "title": "Infants on lap",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Under 2 years old, travelling on an adult's lap (usually ~10% of the adult fare).",
            "default": 0
          },
          "cabinClass": {
            "title": "💺 Cabin class",
            "enum": [
              "economy",
              "premium_economy",
              "business",
              "first"
            ],
            "type": "string",
            "description": "Economy, premium economy, business or first",
            "default": "economy"
          },
          "maxStops": {
            "title": "🔀 Max stops",
            "enum": [
              "any",
              "0",
              "1",
              "2"
            ],
            "type": "string",
            "description": "Maximum stops, as a string: \"any\" (default), \"0\" = nonstop only, \"1\" = up to one stop, \"2\" = up to two stops.",
            "default": "any"
          },
          "currency": {
            "title": "💱 Currency",
            "type": "string",
            "description": "ISO code for prices: <code>USD</code>, <code>IDR</code>, <code>EUR</code>, <code>SGD</code>, <code>AUD</code>…",
            "default": "USD"
          },
          "market": {
            "title": "🌐 Market (country of sale)",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Two-letter country code of the point of sale, e.g. <code>US</code>, <code>ID</code>, <code>GB</code>, <code>DE</code>, <code>AU</code>. Google returns the fares, sellers and booking links available to buyers in that country — prices differ by market. Leave empty for Google's default."
          },
          "maxResults": {
            "title": "💯 Max flights per route",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Flights to return per search, 1-300 (Google returns up to about 150). Each flight is one billed row. For a quick answer set 10-20 together with sortBy \"price\": the list is sorted first and cut second, so you get the cheapest ones.",
            "default": 100
          },
          "sortBy": {
            "title": "↕️ Sort by",
            "enum": [
              "best",
              "price",
              "duration",
              "departure"
            ],
            "type": "string",
            "description": "\"best\" = Google's own ranking (default), \"price\" = cheapest first, \"duration\" = shortest first, \"departure\" = earliest first. Sorting is applied before maxResults cuts the list.",
            "default": "best"
          },
          "calendarDays": {
            "title": "📆 Price calendar (days)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Lowest fare for each departure date over this many days starting at the departure date — Google's date grid as data. <code>0</code> = off, <code>60</code> = two months, up to <code>365</code>. One request per 90 days. Adds <code>calendar_day</code> items and a <code>calendar.cheapestDates</code> summary to the search item. For round trips the trip length (return minus departure) is kept fixed.",
            "default": 0
          },
          "resolveBookingOptions": {
            "title": "🎫 Booking options (who sells it, at what price, with a link)",
            "type": "boolean",
            "description": "For the top flights of each search, fetch Google's booking options: airline and travel agencies (Trip.com, Expedia, Kiwi…), their prices, fees, and a deep link to book. Round trips need <b>Return flights</b> on — options are fetched for the outbound plus its cheapest return. One extra request per flight — cap it with the field below.",
            "default": false
          },
          "fillMissingPricesFromKayak": {
            "title": "💸 Fill missing prices from KAYAK",
            "type": "boolean",
            "description": "Some airlines keep fares off Google Flights (e.g. Saudia on Saudi domestic routes), so those flights come with no price. Tick this to run our <a href=\"https://apify.com/lergassy/kayak-flights-scraper\">KAYAK Flights Scraper</a> for the same search and copy KAYAK's price onto the same flight. Filled rows carry <code>priceSource: \"kayak\"</code>. Runs only when a flight has no price; KAYAK rows are billed at KAYAK's row price.",
            "default": false
          },
          "kayakWhenGoogleEmpty": {
            "title": "🛟 KAYAK when Google finds nothing",
            "type": "boolean",
            "description": "When Google returns no flights for a route (rare, mostly long-haul pairs), run our KAYAK Flights Scraper for the same search and return its flights, marked dataSource \"kayak\" and billed separately at KAYAK's row price. Set false to get only Google results.",
            "default": true
          },
          "resolveReturnFlights": {
            "title": "🔁 Return flights for round trips",
            "type": "boolean",
            "description": "For the top outbound itineraries of a round trip, fetch Google's list of return flights — each with the total price for both directions — so you get complete outbound + return combinations. One extra request per outbound itinerary.",
            "default": false
          },
          "exploreAnywhere": {
            "title": "🌍 Explore: cheapest destinations from the origin",
            "type": "boolean",
            "description": "Set true to list the cheapest destinations from origin instead of searching a fixed route. origin is required, destination is ignored. Rows: city, country, price, airline, stops, duration and suggested dates. Uses departureDate/returnDate when set, otherwise Google's flexible one-week trips over the coming months.",
            "default": false
          },
          "exploreSuggestedDates": {
            "title": "🗓️ Explore: use Google's suggested dates when your exact dates have no offers",
            "type": "boolean",
            "description": "Only for exploreAnywhere with dates set. When the origin has no Explore offers on your exact dates, return the destinations Google suggests on its own dates instead (rows marked datesSource \"google-suggested\", charged as normal rows; your dates are kept in requestedDepartureDate / requestedReturnDate). Set false to get a free notice and no rows in that case.",
            "default": true
          },
          "routes": {
            "title": "🗺️ More routes (batch)",
            "type": "array",
            "description": "Several routes in one run; origin and destination above can stay empty. Each item: {\"origin\": \"JFK\", \"destination\": \"LHR\", \"departureDate\": \"YYYY-MM-DD\", \"returnDate\": \"YYYY-MM-DD\"}. returnDate is optional; dates must be today or later. Passengers, cabin and filters apply to every route."
          },
          "multiCityLegs": {
            "title": "🧭 Multi-city legs",
            "type": "array",
            "description": "One multi-city trip as two or more legs in travel order: [{\"origin\": \"SIN\", \"destination\": \"BKK\", \"date\": \"YYYY-MM-DD\"}, {\"origin\": \"BKK\", \"destination\": \"HKT\", \"date\": \"YYYY-MM-DD\"}]. Needs more time than a single route: give the run at least 300 s. Google prices the trip leg by leg; the total is shown when Google can sell all legs as one ticket."
          },
          "airlines": {
            "title": "Only these airlines",
            "type": "array",
            "description": "IATA airline codes to keep, e.g. <code>SQ</code>, <code>GA</code>, <code>QZ</code>. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "excludeAirlines": {
            "title": "Exclude airlines",
            "type": "array",
            "description": "IATA airline codes to drop, e.g. <code>TR</code> (Scoot)",
            "items": {
              "type": "string"
            }
          },
          "maxPrice": {
            "title": "Max price",
            "minimum": 1,
            "type": "integer",
            "description": "Drop flights above this price (in the selected currency)"
          },
          "maxDurationMinutes": {
            "title": "Max total duration (minutes)",
            "minimum": 30,
            "type": "integer",
            "description": "Drop itineraries longer than this, e.g. <code>720</code> for 12 hours"
          },
          "maxLayoverMinutes": {
            "title": "Max layover (minutes)",
            "minimum": 30,
            "type": "integer",
            "description": "Drop itineraries with any layover longer than this, e.g. <code>180</code>"
          },
          "departureTimeFrom": {
            "title": "Depart after (HH:MM)",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
            "type": "string",
            "description": "Earliest departure time, local, e.g. <code>06:00</code>"
          },
          "departureTimeTo": {
            "title": "Depart before (HH:MM)",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
            "type": "string",
            "description": "Latest departure time, local, e.g. <code>12:00</code>"
          },
          "arrivalTimeFrom": {
            "title": "Arrive after (HH:MM)",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
            "type": "string",
            "description": "Earliest arrival time, local, e.g. <code>08:00</code>"
          },
          "arrivalTimeTo": {
            "title": "Arrive before (HH:MM)",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
            "type": "string",
            "description": "Latest arrival time, local, e.g. <code>22:00</code>"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language of airport and airline names, e.g. <code>en</code>, <code>id</code>, <code>de</code>",
            "default": "en"
          },
          "calendarOnly": {
            "title": "Calendar only (skip the flight list)",
            "type": "boolean",
            "description": "Return just the price calendar and the search summary — the cheapest way to sweep dates or routes.",
            "default": false
          },
          "includePriceInsights": {
            "title": "Price insights",
            "type": "boolean",
            "description": "Add Google's price level (low / typical / high), typical price range and 60-day price history to the search summary and to every flight",
            "default": true
          },
          "includeSearchSummary": {
            "title": "🧾 Add the search summary row",
            "type": "boolean",
            "description": "Adds one <code>type: \"search\"</code> row per search with how many itineraries Google had, its own lowest price, the price level and the price history. It is not a flight, so it is off by default and the table stays flights only — the same summary is always saved as the run's <b>SEARCH_SUMMARY</b> record in the key-value store.",
            "default": false
          },
          "maxDestinations": {
            "title": "Max destinations (explore)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many destinations to return in Explore mode, cheapest first.",
            "default": 60
          },
          "maxBookingResolutions": {
            "title": "Flights to resolve booking options for",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Per search, counted from the top of the sorted list",
            "default": 10
          },
          "maxReturnResolutions": {
            "title": "Outbound itineraries to resolve returns for",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Per round-trip search, counted from the top of the sorted list",
            "default": 10
          },
          "maxReturnOptions": {
            "title": "Return flights to keep per outbound",
            "minimum": 1,
            "maximum": 150,
            "type": "integer",
            "description": "How many return flights to keep for each outbound itinerary, cheapest first.",
            "default": 20
          },
          "maxMultiCityResolutions": {
            "title": "Multi-city itineraries to resolve",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many first-leg options to follow through all legs (one request per leg each)",
            "default": 5
          },
          "dataSource": {
            "title": "Data source",
            "enum": [
              "auto",
              "api",
              "page"
            ],
            "type": "string",
            "description": "<b>Auto</b>: Google's results API (full list of 100–150 itineraries, needs a residential proxy) with automatic fallback to the results page (first ~40 itineraries, works from any IP). <b>Results API only</b>: more retries on fresh IPs; if Google still refuses, the route falls back to the results page (marked <code>resultsSource: \"page\"</code>) instead of ending as an error. <b>Results page only</b>: never calls the API.",
            "default": "auto"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Google serves the full results API only to residential IPs — keep <b>Residential</b> proxies for complete results (a search transfers ~250 KB, a fraction of a cent). Datacenter proxies still work through the page fallback with the first ~15 itineraries.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "includeRunSummary": {
            "title": "🧾 Add a free summary row at the end of the run",
            "type": "boolean",
            "description": "One extra free row with the run's totals: rows delivered, free rows, what was charged and how much in US dollars. It carries type \"notice\", so a filter on your data rows skips it.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}