Google Flights API for AI Agents
Search Google Flights for flight itineraries and current fares.
How do agents request this data?
Send departure_id, arrival_id, outbound_date to /v1/flights with a FastAF API key, or use /x402/v1/flights with an x402 client. Preserve source links and timestamps with results.
How much does a request cost?
Each successful request costs 5 credits or $0.005 via x402. Start with 500 free credits every month after email verification; optional prepaid credits are available.
How do you make a real request?
This example calls Google Flights API using its documented input. Save the API key from the signup email, confirm your email and set FASTAF_API_KEY in your server environment.
curl --fail-with-body -H "Authorization: Bearer $FASTAF_API_KEY" 'https://api.fastaf.co/v1/flights?departure_id=JFK&arrival_id=LHR&outbound_date=2027-01-15&type=2'# pip install fastaf-sdk
import os
from fastaf import FastAF
with FastAF(os.environ["FASTAF_API_KEY"]) as client:
data = client.request("flights", {"departure_id":"JFK","arrival_id":"LHR","outbound_date":"2027-01-15","type":"2"})
print(data)Search Google Flights for flight itineraries and current fares. JSON response; source fields may vary.
The example costs 5 credits after the trial. Alternatively, this endpoint costs $0.005 per successful x402 call at the default configuration; FastAF x402 calls start at $0.003. These are separate billing modes.
For x402, request the same parameters under /x402/v1/flights without an API key, validate the live PAYMENT-REQUIRED challenge, then sign and retry with a payment-aware client. A bare curl request returns HTTP 402 and does not pay; unsupported higher-cost options require API-key billing.
Frequently asked questions
What inputs are required?
departure_id, arrival_id, outbound_date.
Are failed requests charged?
No. Failed requests are not charged.
Can I use MCP?
Yes. FastAF exposes a dedicated MCP tool for this endpoint.
Do I need prepaid credits?
Prepaid credits are optional. Verified accounts receive 500 free credits every month; x402 supports pay per call from $0.003.
How much does the example cost?
The API-key example uses 5 credits per successful call after the trial. This endpoint has a default x402 price of $0.005 per successful call in USDC on Base; the live payment challenge is authoritative.
Does the SDK automatically pay an HTTP 402?
No. The API-key SDK does not sign wallet payments; x402 requires an explicitly configured payment-aware client and a funded wallet.