# Compare Airline Prices on One Route with Google Flights

Searches Google Flights for one-way flights from Los Angeles (LAX) to New York (JFK) and lists every itinerary with its airlines, price, number of stops and total travel time, so you can sort by price and see which airline is cheapest that day.

- Actor: openclawai/google-flights-scraper (Google Flights Scraper), https://datapika.com/actors/google-flights-scraper
- Run on Apify: https://apify.com/openclawai/google-flights-scraper
- Tested: 2026-11-26, 10 rows in 14 seconds, $0.02 at free-plan prices

## Input

```json
{
  "from_airport": "LAX",
  "to_airport": "JFK",
  "date": "2027-02-20",
  "trip": "one-way",
  "max_results": 25
}
```

## Output fields

- `airline_names`: Airline
- `price`: Price
- `currency`: Currency
- `departure`: Departure
- `arrival`: Arrival
- `stops`: Stops
- `duration_min_total`: Duration (min)
- `from_airport`: from_airport
- `to_airport`: to_airport

## Sample rows (personal data masked)

```json
[
  {
    "airline_names": [
      "American"
    ],
    "price": 189,
    "currency": "USD",
    "departure": "2027-02-20T14:00:00",
    "arrival": "2027-02-20T22:25:00",
    "stops": 0,
    "duration_min_total": 325,
    "from_airport": "LAX",
    "to_airport": "JFK"
  },
  {
    "airline_names": [
      "American"
    ],
    "price": 189,
    "currency": "USD",
    "departure": "2027-02-20T16:10:00",
    "arrival": null,
    "stops": 0,
    "duration_min_total": 333,
    "from_airport": "LAX",
    "to_airport": "JFK"
  },
  {
    "airline_names": [
      "American"
    ],
    "price": 189,
    "currency": "USD",
    "departure": "2027-02-20T22:42:00",
    "arrival": "2027-02-21T07:00:00",
    "stops": 0,
    "duration_min_total": 318,
    "from_airport": "LAX",
    "to_airport": "JFK"
  }
]
```

Full sample: https://datapika.com/data/tasks/airline-price-comparison.json

## How to run it

1. **Open the actor on Apify.** Click Copy input, then Run on Apify to open the Google Flights Scraper. Sign in or create a free account, open the JSON tab of the input form and paste the input.
2. **Start the "Compare Airline Prices on One Route with Google Flights" task.** Press Start. Change any input field first if you need a different topic, account or size; the fields are listed above.
3. **Get the results.** Rows arrive in a dataset while the run works. Our test returned 10 rows in 14 seconds.
4. **Use the data.** Download JSON, CSV or Excel, call the run from the API, schedule it, or let an AI agent run it through MCP.

API (replace the token):

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/openclawai~google-flights-scraper/run-sync-get-dataset-items?maxTotalChargeUsd=1" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"from_airport":"LAX","to_airport":"JFK","date":"2027-02-20","trip":"one-way","max_results":25}'
```

## Change it

- from_airport and to_airport take three-letter airport codes such as JFK, LHR or NRT.
- date and return_date take YYYY-MM-DD; set trip to round-trip when you add a return date.
- trip takes one-way, round-trip or multi-city (one leg per search).
- max_results caps the itineraries returned (1 to 200); you pay only for those returned.

## FAQ

### Does it show connecting flights on two airlines?

Yes. airline_names lists every carrier on an itinerary, so mixed-airline connections show both names, and stops gives the number of connections.

### Can I keep only nonstop flights?

There is no nonstop filter in the input. Every row has stops, so filter stops = 0 in the dataset view, a spreadsheet or your code.

### Do I need a Google account or API key?

No. It reads public Google Flights results with no login, cookie or API key. Run it from the Apify Console, the API, or an AI agent through MCP.

### How much does it cost?

You pay per itinerary delivered to your dataset. There is no start fee. The current prices are on the Pricing tab.
