Skip to main content

Overview

The SearchDates class provides methods to search for flight prices across a date range, useful for finding the cheapest dates to fly. It uses Google Flights’ calendar view API to find the best prices for each date.

Class initialization

Initializes the search client for date-based searches. No parameters required.

Methods

Search for flight prices across a date range and search parameters.
DateSearchFilters
required
Search parameters including date range, airports, and preferences
list[DatePrice] | None
List of DatePrice objects containing date and price pairs, or None if no results found
Raises:
  • Exception: If the search fails or returns invalid data
Notes:
  • For date ranges larger than 61 days, the method automatically splits the search into multiple chunks
  • Maximum search horizon is 305 days in the future
Example:

Return types

DatePrice

Each DatePrice object contains:
tuple[datetime] | tuple[datetime, datetime]
For one-way trips: single-element tuple with departure dateFor round-trip: two-element tuple with (departure date, return date)
float
Flight price for the specified date(s)

Constants

Maximum number of days that can be searched in a single API request. Larger date ranges are automatically split into multiple chunks.

Notes

  • The search automatically handles large date ranges by splitting them into 61-day chunks
  • Only dates with available pricing data are returned in the results
  • The search client includes automatic rate limiting (10 req/sec) and retries
  • For round-trip searches, the duration parameter in filters controls the length of the trip