Missing inbound flight data from Flight Search API in Go application

I’m building a travel app in Go and I’m having trouble with a flight search API through RapidAPI. When I make requests for round trip flights, the API response only includes outbound flight information but completely ignores the return flight details.

Here’s the API response I’m getting:

{
  "FlightOffers": [
    {
      "OfferId": 1,
      "BasePrice": 425.0,
      "NonStop": true,
      "DepartingFlight": {
        "AirlineIds": [902],
        "FromId": 71823,
        "ToId": 55432,
        "TakeoffDate": "2019-12-01T00:00:00"
      },
      "SearchDateTime": "2019-11-29T14:24:00"
    }
  ],
  "Airports": [
    {
      "AirportId": 55432,
      "Code": "LAX",
      "FullName": "Los Angeles International",
      "Category": "Airport",
      "City": "Los Angeles",
      "Country": "United States"
    },
    {
      "AirportId": 71823,
      "Code": "ORD",
      "FullName": "Chicago O'Hare International",
      "Category": "Airport",
      "City": "Chicago",
      "Country": "United States"
    }
  ],
  "Airlines": [
    {
      "AirlineId": 902,
      "CompanyName": "United Airlines"
    }
  ]
}

I’m clearly specifying both departure and return dates in my request, but the response only shows the outbound leg. Has anyone dealt with this issue before or knows what might be causing this problem?

Check your request parameters - you’re probably missing the trip type identifier. I ran into this with flight APIs before. Just including return dates isn’t enough. The API needs explicit parameters like “cabinClass” or “adults” count plus the trip type flag. Also check if you’re hitting the right API version - older endpoints don’t handle round trip searches well. Log your complete request to see what’s missing. Another thing - your subscription tier might only support one-way searches, which would explain why return data gets filtered out.

double-check your endpoint! some APIs might have different routes for round trips vs one-way tickets. also verify your return date format - I experienced this issue too and the API kept returning the wrong info, which was super frustrating.

Had the exact same issue with RapidAPI flight endpoints. You need to explicitly set a trip type parameter - most flight APIs default to one-way even when you include return dates. Add something like “tripType”: “roundtrip” or “return” to your request body. Also check if return flight details are in a separate response field. They’re often nested under “ReturningFlight” or “InboundFlight” instead of being with the departing flight data. The API docs should tell you the exact parameter names and response structure for round trips.