# Kayak Reference

## Flight URL Pattern

```
https://www.kayak.com/flights/{ORIGIN}-{DEST}/{DEPART}/{RETURN}/{N}adults
```

**Parameters:**
- `ORIGIN` / `DEST` — IATA airport codes (e.g. `LON`, `MAD`, `JFK`, `BCN`)
- `DEPART` / `RETURN` — dates in `YYYY-MM-DD` format
- `N` — number of adults (e.g. `2adults`)

**One-way:**
```
https://www.kayak.com/flights/LON-MAD/2026-07-01/1adults
```

**Return:**
```
https://www.kayak.com/flights/LON-MAD/2026-07-01/2026-07-07/2adults
```

## Hotel URL Pattern

```
https://www.kayak.com/hotels/{destination}/{checkin}/{checkout}/{N}adults
```

**Example:**
```
https://www.kayak.com/hotels/Magaluf,Majorca/2026-07-01/2026-07-07/2adults
```

## Car Hire URL Pattern

```
https://www.kayak.com/cars/{location}/{pickup-datetime}/{dropoff-datetime}
```

## Opening with Proxy

```bash
PROXY_URL=$(tc proxy)
agent-browser close
agent-browser --proxy "$PROXY_URL" open "https://www.kayak.com/flights/LON-MAD/2026-07-01/2026-07-07/2adults"
sleep 5   # Kayak is slow to load results
agent-browser screenshot /workspace/group/kayak_flights.png
```

## Key Selectors

```bash
# Flight result cards
agent-browser snapshot -s "[class*='resultWrapper']"

# Price
agent-browser get text "[class*='price-text']"

# Airline and times
agent-browser get text "[class*='section times']"
```

## Tips

- Kayak often shows a "searching..." state for 3-5 seconds — wait before screenshotting
- CAPTCHA is possible; proxy usually avoids it but retry if blocked
- For multi-city or complex searches, use the UI rather than URL params
