Skip to content

Guide

How to get round-trip flight prices in one request

Published September 5, 2026

Short answer: FlightPowers' POST /v1/flights/roundtrip on api.flightpowers.com prices an outbound and return as one paired itinerary in a single call, so you never add two one-way fares together. The response carries total_price and total_price_as_number (not price), plus Google's own price_insights_low/price_insights_high band and verdict on the pair.

The obvious approach is two one-way searches, one per direction, added together. It is wrong in a way that does not show up until someone clicks through and sees a different number.

Airlines price a return as one product. The sum of the cheapest outbound and the cheapest return is not the price of any ticket you can buy, and on some routes it is not even close. Two searches also cost you two requests per date pair, which matters the moment you start scanning a range.

How do you make one request for both dates?

curl -X POST "https://api.flightpowers.com/v1/flights/roundtrip" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $FLIGHTPOWERS_API_KEY" \
  -d '{
    "from_airport": "BER",
    "to_airport": "CDG",
    "departure_date": "2026-10-06",
    "return_date": "2026-10-13",
    "limit": 5,
    "currency": "usd"
  }'

The same call works on the RapidAPI host with x-rapidapi-key and x-rapidapi-host instead. A key comes from the listing, free plan included.

What does a round-trip response contain?

The first itinerary from that exact request, captured 2026-08-26. Prices were live at capture time and will not match yours.

{
  "price_range_in_relation_to_other_periods": "low",
  "price_insights_low": 120,
  "price_insights_high": 220,
  "from_airport": "Berlin (BER)",
  "to_airport": "Paris (CDG)",
  "departure_date": "2026-10-06",
  "return_date": "2026-10-13",
  "total_price": "$112",
  "total_price_as_number": 112,
  "total_duration_seconds": 12900,
  "total_stops": 0,
  "departure_flight_departure_description": "5:05 PM on Tue, Oct 6",
  "departure_flight_arrival_description": "6:55 PM on Tue, Oct 6",
  "departure_flight_airline": "easy | Jet",
  "departure_flight_stops": 0,
  "departure_flight_duration": "1 hr 50 min",
  "return_flight_departure_description": "8:50 AM on Tue, Oct 13",
  "return_flight_arrival_description": "10:35 AM on Tue, Oct 13",
  "return_flight_airline": "easy | Jet",
  "return_flight_stops": 0,
  "return_flight_duration": "1 hr 45 min"
}

One flat object per itinerary. Both legs are already matched, the price is the price of the pair, and buy_link (trimmed above for width) reopens that exact paired itinerary on Google.

The trap that costs an afternoon

A round-trip result carries total_price and total_price_as_number. A one-way result carries price and price_as_number. The two shapes are otherwise similar enough that code written for one-ways runs happily against round-trips and reads undefined for the price.

The insight fields keep their names across both, so the verdict still looks correct while the price is missing. That combination is how the bug survives review. Write the two paths separately.

Per-leg filters are real: max_departure_stops and max_return_stops, separate airline lists per leg, separate time windows. Nonstop out and a morning return, one request.

What does an empty response mean?

A paired search prices a return leg for every outbound candidate, and any of those inner fetches can fail on its own. So an empty array means one of two very different things, and the header tells you which. x-search-status: ok with no rows means Google really had nothing. degraded or partial means the fan-out was blocked or truncated, which is not the same as "this route has no flights" and must never be stored as one.

The capture above is a good example: x-search-status was ok and x-search-results was 5, but x-search-unreadable-pages was 3 and x-search-candidate-recovered was 3. Three pages failed and were retried successfully. A response can be complete and still have had a rough time getting there. The full taxonomy is in handling empty flight search results.

One request per date pair, not two

Paired outbound and return with a combined total, per-leg filters, and Google's price band on the pairing. Free tier on RapidAPI.

Free tier: 10 requests/month. No card to try.