# Google Flights

Search Google Flights for one-way, round-trip, and multi-city flights, including prices, stops, airlines, and passenger counts

**Pricing:** $1 / 1k searches

**Endpoint:** `POST /api/v1/agents/google/flights/run`

**Auth:** `Authorization: Bearer mk_live_...`

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `departure` | string | Yes | IATA code of the departure airport (e.g. LAX, JFK). |
| `arrival` | string | Yes | IATA code of the arrival airport (e.g. JFK, SFO). |
| `outboundDate` | date | Yes | Date of departure flight. |
| `returnDate` | date | No | Date of return flight. Leave blank for one-way. |
| `adults` | integer | No | Number of adult passengers. |
| `children` | integer | No | Number of children (ages 2-11). |
| `infants` | integer | No | Number of infants (under 2). |
| `currency` | string | No | Currency for prices. |
| `country` | string | No | Country to search Google Flights from. |
| `language` | string | No | Language for results. |
| `maxPrice` | integer | No | Cap results below this price (in selected currency). |
| `maxStops` | string | No | Maximum number of stops. Leave blank for any. |
| `airlines` | array | No | Airline IATA codes to filter results by (e.g. UA, AA, DL). |
| `excludeBasic` | boolean | No | Filter out Basic Economy fares (no carry-on, no seat selection). |
| `maxPages` | integer | No | Number of result pages to fetch in total. Use 0 for all. |

## Example

```bash
curl -X POST https://api.mindcase.co/api/v1/agents/google/flights/run \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"params":{"departure":"...","arrival":"...","outboundDate":"..."}}'
```

```python
import requests

resp = requests.post(
    "https://api.mindcase.co/api/v1/agents/google/flights/run",
    headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
    json={"params": {
    "departure": "...",
    "arrival": "...",
    "outboundDate": "..."
}},
)
data = resp.json()
```

## Get the results

`run` is async and returns a `job_id`. Poll until `status` is `completed`, then read the rows:

```bash
# 1) check status
curl https://api.mindcase.co/api/v1/jobs/JOB_ID \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"

# 2) when status == completed, fetch the rows
curl https://api.mindcase.co/api/v1/jobs/JOB_ID/results \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"
```

Full API reference (auth, jobs, balance, endpoints): https://mindcase.co/skills.md

## Response columns

| Field | Display name | Type |
|-------|--------------|------|
| `route` | Route | text |
| `departureAirport` | Departure Airport | text |
| `arrivalAirport` | Arrival Airport | text |
| `outboundDate` | Outbound Date | text |
| `returnDate` | Return Date | text |
| `tripType` | Trip Type | text |
| `passengers` | Passengers | text |
| `currency` | Currency | text |
| `price` | Price | currency |
| `priceLevel` | Price Level | text |
| `lowestPrice` | Lowest Price | currency |
| `typicalPriceLow` | Typical Price Low | currency |
| `typicalPriceHigh` | Typical Price High | currency |
| `priceVsTypical` | Price vs Typical | text |
| `departureTime` | Departure Time | text |
| `arrivalTime` | Arrival Time | text |
| `durationMin` | Duration (min) | number |
| `stops` | Stops | number |
| `layoverAirports` | Layover Airports | text |
| `overnight` | Overnight | boolean |
| `oftenDelayed` | Often Delayed | boolean |
| `airlines` | Airlines | text |
| `flightNumbers` | Flight Numbers | text |
| `category` | Category | text |
| `airlineLogo` | Airline Logo | text |
| `carbonKg` | Carbon (kg) | number |
| `carbonVsTypical` | Carbon vs Typical (%) | number |
| `legs` | Legs | object_array |
