# Date Range Search

Version 2 searches only from_date per request and returns its cheapest outbound starting price and departure_token. Use search_metadata.next_departure_date as from_date on a separate paid call to continue through to_date. Each call completes one upstream lookup, retrying temporary failures of that same lookup; failures are not billed.

- **Documentation:** [https://scrappa.co/docs/google-flights-api/google_flights_date_range](https://scrappa.co/docs/google-flights-api/google_flights_date_range)
- **API group:** Google Flights API
- **Endpoint:** `GET https://scrappa.co/api/flights/v2/date-range`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `origin` | string | Yes | Origin airport IATA code |
| `destination` | string | Yes | Destination airport IATA code |
| `from_date` | string | Yes | Start of date range in Y-m-d format |
| `to_date` | string | Yes | End of date range in Y-m-d format |
| `trip_duration` | integer | No | Duration of trip in days (1-30, default: 7) |
| `adults` | integer | No | Number of adult passengers (1-9, default: 1) |
| `children` | integer | No | Number of child passengers (0-9, default: 0) |
| `infants_in_seat` | integer | No | Number of infants in seat (0-9, default: 0) |
| `infants_on_lap` | integer | No | Number of infants on lap (0-9, default: 0) |
| `cabin_class` | string | No | Cabin class: economy, premium_economy, business, or first (default: economy) |
| `exclude_basic` | boolean | No | Exclude basic economy fares when searching in economy class (default: false) |
| `max_stops` | string | No | Maximum stops: any, nonstop, one_or_fewer, or two_or_fewer (default: any) |
| `hl` | string | No | Language code (e.g., en, de, en-US) |
| `gl` | string | No | Country/region code (e.g., us, de, gb) |
| `currency` | string | No | Currency code for prices (e.g., USD, EUR, GBP) |
| `outbound_times` | string | No | Outbound time window as comma-separated hours, e.g. "6,18" for departures between 06:00 and 18:00. Two further values narrow the arrival window. |
| `bags` | integer | No | Carry-on bag count. Only 0 is currently supported. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/flights/v2/date-range?origin=JFK&destination=LAX&from_date=2026-09-01&to_date=2026-09-30"
```

## Example response

```json
{
    "date_price_combinations": [],
    "search_metadata": []
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | origin, destination, from_date, and to_date are required; the date range, trip_duration, passenger counts, cabin_class, max_stops, locale, and currency must be valid when provided. |
| 402 | Insufficient Credits | Your API key is valid, but the account has no free, subscription, or package credits available. |
| 429 | Rate Limited | The request could not be completed because a temporary request limit was reached. |
| 503 | Google Flights Temporarily Unavailable | The Google Flights search could not be completed because its upstream provider was temporarily unavailable. |
| 500 | Google Flights Search Error | Scrappa could not complete the Google Flights search after validation passed. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
