travel
Google Flights API
Flight itineraries with airlines, prices, durations, stops, and carbon estimates.
GET/api/public/v1/google-flights
- price
- $0.005
- atomic
- 5000
- free tier
- 3 calls / agent
- chain
- base mainnet
- asset
- USDC
- scheme
- exact
agent brief
Give origin, destination, and dates, get priced itineraries with legs and durations.
engine: google_flights · results key: best_flights · settlement: USDC / base / exact
use this when you need to
- -Booking-agent price search
- -Travel budget planning
query parameters
| name | type | required | description |
|---|---|---|---|
| network | base | base-sepolia | no · default "base" | Payment network. base-sepolia returns mock data for testing. |
| 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 · default "USD" | Currency code for prices |
call it — curl
bash
# Free tier — first 3 calls per agent identity, no payment header
curl "https://marketplaceforaiagents.com/api/public/v1/google-flights?departure_id=JFK&arrival_id=LHR&outbound_date=2026-09-15"
# Sandbox — signed testnet USDC, mock response, no real spend
curl "https://marketplaceforaiagents.com/api/public/v1/google-flights?departure_id=JFK&arrival_id=LHR&outbound_date=2026-09-15&network=base-sepolia" \
-H "X-PAYMENT: <base64 signed base-sepolia USDC authorization>"
# Production — signed x402 payment header, real data
curl "https://marketplaceforaiagents.com/api/public/v1/google-flights?departure_id=JFK&arrival_id=LHR&outbound_date=2026-09-15" \
-H "X-PAYMENT: <base64 signed USDC authorization>"call it — typescript + x402-fetch
typescript
import { wrapFetchWithPayment } from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
const fetchWithPayment = wrapFetchWithPayment(fetch, account);
const res = await fetchWithPayment(
"https://marketplaceforaiagents.com/api/public/v1/google-flights?departure_id=JFK&arrival_id=LHR&outbound_date=2026-09-15"
);
const data = await res.json();
console.log(data.best_flights);response — 200 ok
application/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."
}
]
}status codes
200data returned, response includes X-PAYMENT-RESPONSE receipt when paid
400missing or invalid required parameters
402free tier exhausted or invalid X-PAYMENT — body contains accepts[] payment requirements
404unknown endpoint slug
429upstream rate limit — retry with backoff
500upstream or settlement error