I’m working on a personal project using the flight search API through RapidAPI with Go language. When I make requests for round trip flights, I only get data for the outbound flight but nothing about the return journey.
Here’s an example of my API call structure:
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func searchFlights() {
client := &http.Client{}
endpoint := "flight-search-api/browse/quotes/v1.0/US/USD/en-US/LAX-sky/LAS-sky/2024-03-15"
req, _ := http.NewRequest("GET", endpoint, nil)
req.Header.Add("X-RapidAPI-Key", "your-api-key")
params := req.URL.Query()
params.Add("returndate", "2024-03-20")
req.URL.RawQuery = params.Encode()
resp, err := client.Do(req)
if err != nil {
panic(err)
}
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
The response I get back includes quotes, places, carriers and currency info, but I can only see outbound leg details in the quote objects. There’s no inbound leg information even though I’m specifying a return date parameter.
Has anyone encountered this issue before? Am I missing something in my request format or is there a different endpoint I should be using for round trip searches?
I ran into this exact same behavior when building a travel comparison tool last year. The browse quotes endpoint is really designed for price discovery and market research rather than complete booking flows. What you’re seeing is expected - it aggregates pricing data but doesn’t necessarily return full itinerary details for roundtrips. The returndate parameter influences the pricing calculation but doesn’t guarantee inbound leg data in the response structure. You’ll want to switch to the live pricing search endpoint which handles roundtrip requests properly and returns complete itinerary objects with both outbound and inbound segments. Just be aware that live pricing has higher rate limits and costs more per request compared to browse quotes.
The browse quotes endpoint you’re using is fundamentally limited for roundtrip searches. I discovered this working with several flight APIs - browse endpoints typically aggregate cached data and won’t give you structured return flight information even when the returndate parameter affects pricing calculations. Your code structure looks correct, but you’re hitting an API design limitation rather than a coding issue. Consider implementing two separate one-way searches as a workaround if you need to stick with browse quotes for budget reasons. The pricing won’t be identical to true roundtrip fares, but you’ll get complete leg data for both directions. Alternatively, migrate to the live search endpoint which handles proper roundtrip requests but comes with stricter usage limits.
had same problem last month with skyscanner api. the issue is that browse quotes endpoint only shows one-way pricing even when you add returndate param. you need to use the live pricing endpoint instead for proper roundtrip data - it actually returns both legs in the itinerary object.