we looking build our own flight search software. not have ability book flights, search. in order build need have data first , running algorithms on data before user searches.
basically need data feed of available flights , prices download. there such thing. far found api's need include search criteria. want able download flight info.
thank you
i working on similar project. need google qpx express api.
this [link][1] provides detailed description of api.
a sample code search 1 way flight likes this:
$results = array(); include_once 'apis/google-api-php-client-master/src/google/autoload.php'; $apikey = "xxxxxxxx"; #your google api key $appname = "x0x0x0"; #the name of app on google developers console const solutions = 2; $client = new google_client(); $client->setapplicationname($appname); $client->setdeveloperkey($apikey); // initating $qpxexpressservice = new google_service_qpxexpress($client); $trips = $qpxexpressservice->trips; // passengers $passenger = new google_service_qpxexpress_passengercounts(); $passenger->setadultcount($pass); // slices / trips $slice = new google_service_qpxexpress_sliceinput(); $slice->setdestination($destinationcode); $slice->setorigin($origincode); $slice->setdate($time); $request = new google_service_qpxexpress_tripoptionsrequest(); // $request->setsolutions(solutions); $request->setpassengers($passenger); $request->setslice(array($slice)); $searchrequest = new google_service_qpxexpress_tripssearchrequest(); $searchrequest->setrequest($request); // search $results = $qpxexpressservice->trips->search($searchrequest); }catch(google_exception $e){
$results = $e->getmessage(); }
this small chunk of code has worked me.
Comments
Post a Comment