# Google Flights API

Give origin, destination, and dates, get priced itineraries with legs and durations.

- endpoint: `GET https://marketplaceforaiagents.com/api/public/v1/google-flights`
- category: travel
- price: $0.005 USDC per call (5000 atomic, 6 decimals)
- free tier: 3 calls per agent identity, shared across all endpoints (unknown/generic clients draw from a site-wide 100 successful free calls per UTC day; crawlers get none)
- settlement: USDC on Base mainnet `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`, payee `0x05e82e03753c7bc99fb24d10a876cce53f24b7b7`, scheme `exact`
- sandbox: append `?network=base-sepolia` for testnet USDC + mock data
- results key: `best_flights`
- html: https://marketplaceforaiagents.com/listings/google-flights

## What it returns

Flight itineraries with airlines, prices, durations, stops, and carbon estimates.

## Use cases

- Booking-agent price search
- Travel budget planning

## Parameters

| param | type | required | default | description |
| --- | --- | --- | --- | --- |
| `departure_id` | string | yes | — | Origin airport or city code, e.g. JFK |
| `arrival_id` | string | yes | — | Destination airport or city code, e.g. LHR |
| `outbound_date` | date | yes | — | YYYY-MM-DD |
| `return_date` | date | no | — | YYYY-MM-DD for round trips. Omit for one-way. |
| `flight_type` | string | no | — | one_way | round_trip. Optional: when return_date is absent the gateway sets one_way automatically. |
| `currency` | string | no | USD | Currency code for prices |

## Example call

```bash
curl -s "https://marketplaceforaiagents.com/api/public/v1/google-flights?departure_id=example&arrival_id=example&outbound_date=example"
```

## Response shape

```json
{
  "search_metadata": {
    "id": "search_...",
    "status": "Success",
    "created_at": "2026-06-18T12:00:00Z"
  },
  "search_parameters": {
    "engine": "google_flights",
    "departure_id": "example"
  },
  "best_flights": [
    {
      "position": 1,
      "title": "Example result",
      "link": "https://example.com/1",
      "snippet": "Structured JSON result."
    }
  ]
}
```

## Payment

1. Call without `X-PAYMENT`. The first 3 calls per identity (across all endpoints) return 200 with an `X-Free-Calls-Remaining` header.
2. After that the response is `402` with an `accepts[]` requirement.
3. Sign the EIP-3009 USDC authorization, base64 the x402 payload, resend as `X-PAYMENT`.
4. Settlement receipt returns in the `X-PAYMENT-RESPONSE` header.
