# Search flights (v1)

Get flights for a route and dates with total price, segments, layovers, emissions and price insights. Round trips return outbound flights; pass a `departure_token` to get their return flights.

- Platform: Google Flights
- Request: `GET https://api.toolzerhub.com/v1/google-flights/search`
- Auth: `x-api-key` header
- Cost: 1 credit per successful request. Failed requests are not billed.
- Page: https://docs.toolzerhub.com/reference/google-flights/search/get-google-flights-search

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `origin` | query | no | string | Departure airport IATA code, or several comma separated. |
| `destination` | query | no | string | Arrival airport IATA code, or several comma separated. |
| `departure_date` | query | no | string | Outbound date. |
| `return_date` | query | no | string | Return date. Makes the search a round trip: results are outbound flights with round-trip prices, each with a departure_token. |
| `departure_token` | query | no | string | departure_token of a round-trip outbound flight. Returns the return flights for it; the route and date inputs are then ignored. |
| `adults` | query | no | integer |  Default: 1. |
| `children` | query | no | integer |  Default: 0. |
| `infants_in_seat` | query | no | integer |  Default: 0. |
| `infants_on_lap` | query | no | integer | At most one per adult. Default: 0. |
| `cabin` | query | no | enum: economy, premium_economy, business, first |  Default: economy. |
| `stops` | query | no | enum: any, nonstop, one_stop, two_stops | Most stops allowed: one_stop means one stop or fewer, two_stops two or fewer. Default: any. |
| `currency` | query | no | string | ISO 4217 currency for prices. Default: USD. |

## Example request

```bash
curl "https://api.toolzerhub.com/v1/google-flights/search" \
  -H "x-api-key: $TOOLZERHUB_API_KEY"
```

Success responses are wrapped as `{ "data": ... }`. Errors return `{ "error": { "code", "status", "message", "retryable", "details" } }`. See https://docs.toolzerhub.com/docs/responses-and-errors.
