{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Flights Scraper - Fares, Routes & Price Tracking",
    "description": "Scrape Google Flights for live fares, airlines, layovers, durations, baggage and CO2 emissions on any route. One-way & round-trip, all cabins, multi-passenger. Track prices and pull only new flights or price drops. No browser, no API key.",
    "version": "0.1",
    "x-build-id": "gva6naI5mhMsDS28y"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~google-flights-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-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/scrapesage~google-flights-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-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/scrapesage~google-flights-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-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 (IATA code)",
            "type": "string",
            "description": "Origin airport or city code, e.g. <code>JFK</code>, <code>LHR</code>, <code>NYC</code> (city), <code>LON</code> (city). 3-letter IATA codes only. Used with <b>Destination</b> + <b>Depart date</b> for a single search."
          },
          "destination": {
            "title": "Destination (IATA code)",
            "type": "string",
            "description": "Destination airport or city code, e.g. <code>LAX</code>, <code>CDG</code>, <code>TYO</code>. 3-letter IATA codes only."
          },
          "departDate": {
            "title": "Depart date",
            "type": "string",
            "description": "Outbound date in <code>YYYY-MM-DD</code> format. Must be a future date."
          },
          "returnDate": {
            "title": "Return date (round trip)",
            "type": "string",
            "description": "Optional return date in <code>YYYY-MM-DD</code> format. Set this (or pick <b>Round trip</b>) to also scrape the return leg. Each leg is searched as a reliable one-way query and tagged <code>leg: outbound / return</code>."
          },
          "tripType": {
            "title": "Trip type",
            "enum": [
              "one_way",
              "round_trip"
            ],
            "type": "string",
            "description": "<b>One way</b> = outbound only. <b>Round trip</b> = scrape both legs (requires a return date).",
            "default": "one_way"
          },
          "routes": {
            "title": "Routes (bulk)",
            "type": "array",
            "description": "Scrape many routes/dates in one run. One route per line as <code>ORIGIN-DESTINATION-DEPART[-RETURN]</code>, e.g. <code>JFK-LAX-2026-09-15</code> (one way) or <code>SFO-LHR-2026-10-01-2026-10-12</code> (round trip). Perfect for watching a set of routes on a schedule.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs (paste Google Flights links)",
            "type": "array",
            "description": "Paste Google Flights result URLs directly (<code>google.com/travel/flights...</code>). Best for one-way links — round-trip/multi-city links load results client-side and may return an empty page, so use the structured route fields above for those.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "cabinClass": {
            "title": "Cabin class",
            "enum": [
              "economy",
              "premium",
              "business",
              "first"
            ],
            "type": "string",
            "description": "Seating class to price.",
            "default": "economy"
          },
          "stops": {
            "title": "Max stops",
            "enum": [
              "any",
              "nonstop",
              "one_or_fewer",
              "two_or_fewer"
            ],
            "type": "string",
            "description": "Filter by number of stops.",
            "default": "any"
          },
          "adults": {
            "title": "Adults",
            "minimum": 1,
            "maximum": 9,
            "type": "integer",
            "description": "Number of adult passengers (12+).",
            "default": 1
          },
          "children": {
            "title": "Children",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Number of children (2–11).",
            "default": 0
          },
          "infantsInSeat": {
            "title": "Infants in seat",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Infants in their own seat.",
            "default": 0
          },
          "infantsOnLap": {
            "title": "Infants on lap",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Infants on lap.",
            "default": 0
          },
          "currency": {
            "title": "Currency",
            "type": "string",
            "description": "Currency for prices (3-letter ISO code). Common: USD, EUR, GBP, CAD, AUD, INR, JPY, MXN, BRL, CHF.",
            "default": "USD"
          },
          "market": {
            "title": "Market (country)",
            "type": "string",
            "description": "Google country market (2-letter code, e.g. <code>us</code>, <code>gb</code>, <code>de</code>). Affects which fares/agents are shown. Result text stays in English for reliable parsing.",
            "default": "us"
          },
          "maxResultsPerRoute": {
            "title": "Max flights per search",
            "minimum": 0,
            "type": "integer",
            "description": "Cap flights returned per route/leg (0 = all flights Google shows, typically 20–60). Lower it to control cost when monitoring many routes.",
            "default": 0
          },
          "onlyBestFlights": {
            "title": "Only the best flights",
            "type": "boolean",
            "description": "Return only Google's top/'best' flights (the highlighted few with the best price/duration balance) and skip the long 'other flights' list.",
            "default": false
          },
          "includePriceInsights": {
            "title": "Add price-insight summary per search",
            "type": "boolean",
            "description": "Emit one extra record per route/leg (type = \"priceInsight\") with cheapest / median / highest price, Google's price level (low/typical/high), the usual price range and a booking tip.",
            "default": true
          },
          "monitorMode": {
            "title": "Monitoring mode — only price changes & new flights",
            "type": "boolean",
            "description": "Remember every flight (route + airline + times + stops + PRICE) across runs in a named key-value store, and emit ONLY records not seen before. Because price is part of the signature, a fare change re-surfaces — turning a scheduled run into a price-drop watcher. Pairs with Apify Schedules.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Names the memory used by monitoring mode. Use a distinct key per saved watch so different route sets keep separate state.",
            "default": "default"
          },
          "deduplicateResults": {
            "title": "Deduplicate within a run",
            "type": "boolean",
            "description": "Skip identical flight options already emitted in this run (recommended).",
            "default": true
          },
          "maxRetries": {
            "title": "Max retries per search",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "How many times to retry a search (each with a fresh proxy IP) before giving up.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Google Flights serves clean results to Apify datacenter proxy, so the default is datacenter (fast + cheap). Switch to RESIDENTIAL if you hit blocks on heavy runs.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}