Recipe · Flights API
Round-trip search with Apify
Round-trip is a first-class paired-leg search: one object per itinerary with both legs already matched and a combined total, not two one-way lists the agent has to cross-join. The agent reads total_price and presents real bookable combinations.
Pay-per-event on your own Apify account. No monthly plan.
Step 1 · Connect
Run the actor
Pay-per-event through your own Apify account: no monthly plan, and an idle month costs nothing. The input field names and the endpoint values are the actors’ own published input schemas, read from api.apify.com on 2026-09-02. Nothing to subscribe to on RapidAPI for this path.
curl -X POST "https://api.apify.com/v2/acts/mtnrabi~google-flights-real-time-api/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"endpoint":"oneway","from_airport":"LHR","to_airport":"JFK","departure_date":"2026-10-13","currency":"usd"}'Billed per event on your own Apify account. No RapidAPI subscription needed for this path.
Step 2 · The job
The job
The job in plain words. In Apify you express it as the configuration below instead of a prompt.
“I need a round trip New York to Paris, out October 6, back October 13. What are my options?”
Step 3 · Under the hood
The actor input
Paste this into the actor’s Input tab, or send it as the JSON body of a run. Field names come from the actor’s own published input schema.
// actor: mtnrabi~google-flights-real-time-api
{
"endpoint": "roundtrip",
"from_airport": "JFK",
"to_airport": "CDG",
"departure_date": "2026-10-06",
"return_date": "2026-10-13",
"currency": "usd",
"limit": 5
}Step 4 · Read the response
Fields your logic reads
The response is flat JSON. These are the fields this recipe branches on, with what each one means.
total_pricestringThe combined price of the paired round-trip itinerary: one number for both legs, because they were searched together. total_price_as_number is the integer.
total_duration_secondsnumberTravel time across both legs, in seconds, sortable without parsing a display string.
departure_flight_airlinestringOperating carrier on the outbound leg.
return_flight_airlinestringOperating carrier on the return leg, paired to the same itinerary, not cross-joined.
buy_linkstring (URL)A Google Flights deep link that reopens this exact itinerary. Hand it to the user; it just works.
Questions, answered plainly
- Is my key billed to me?
- Not to RapidAPI. This path bills pay-per-event through your own Apify account, so an idle month costs nothing. The RapidAPI subscription and the Apify actor are two separate doors to the same data; you need one, not both.
- Does this need a server of mine?
- No. The actor runs on Apify’s infrastructure, and runs, retries and result storage live in your Apify console alongside your other actors.
- What does it cost?
- On this path, whatever the actor’s own event table charges for the events a run fires. There is no monthly plan and no minimum. The current rates are on the actor listing, which is the only place they are authoritative. If you would rather have a fixed monthly bill and synchronous HTTP, the RapidAPI plans are the other door: see /pricing.
Also works with
Round-trip search, elsewhere in your stack
More recipes
More to build in Apify
One-way flight search
Flights API · search_oneway_flights
Price-insights check
Flights API · search_oneway_flights
Cheapest-date scan
Flights API · search_oneway_flights
Hotel search
Hotels API · search_hotels
Rate-parity check
Hotels API · find_hotel_by_name
Fare-alert cron
Flights API · search_oneway_flights
Get live flight and hotel data
Live Google Flights and Booking.com data as clean JSON. Free tier on RapidAPI, no card to try.
Free tier: 10 requests/month. No card to try.