0
down vote
favorite
I am using google QPX api to query the flights available using api search But i am not able to get all airlines only limited data is returned with the api may i know is there any limitation to it. Is google flight search not using this api. Because data returned with google flight search and qpx api is different. Please help.
Google Flights https://www.google.co.in/flights/
QPX API https://qpx-express-demo.itasoftware.com/
Please find the code below
[HttpGet]
public HttpResponseMessage GetFlightdetails()
{
try
{
#region code 2
var request = new RootObject
{
request = new Request
{
passengers = new Passengers
{
adultCount = 1
},
slice = new List<Slouse>
{
new Slouse
{
origin = "HYD",
destination = "DEL",
date = "2015-06-08",
}
},
solutions = 200,
}
};
string requestJson = JsonConvert.SerializeObject(request, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
using (var httpClient = new HttpClient())
{
var content = new StringContent(requestJson, Encoding.UTF8, "application/json");
var response = httpClient.PostAsync("https://www.googleapis.com/qpxExpress/v1/trips/search?key=XXXXX", content).Result;
var res = response.Content.ReadAsStringAsync().Result;
var resp = new HttpResponseMessage()
{
Content = new StringContent(res.ToString())
};
resp.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
return resp;
}
#endregion
}
catch (Exception ex)
{
throw;
}
}
The above code is found from some other source.