Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3317474
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:35:30+00:00 2026-05-17T22:35:30+00:00

i want to do a website wich is having search functionality. in this i

  • 0

i want to do a website wich is having search functionality. in this i have to do search flights,hotels etc.., some one suggested me to use kayak api for this. i searched every thing for this. but i didn’t get any idea. anyone could suggest me how to use this api in my site.

thanks.


i ust tried like this. here i was stucked.

  <? ob_start(); session_start();  
$hostname="http://www.kayak.com";
    $token="mCHpMz2L_a_OrEkz3FSiDg";//"mCHpMz2L_a_OrEkz3FSiDg";
    $sessionid="";  $searchid="";   
$searchtype="";      $lastcount=""; 
class ksearchphpExample  {

         public function ksearchJavaExample($args){     
/*print_r($args);    echo
count($args);exit;*/        if(count($args)
< 4 || count($args) > 5) {
            echo("USAGE:\n".
                "ksearchJavaExample f ORIGIN_AIPORT DESTINATION_AIRPORT
DEPART_DATE [RETURN_DATE]\n".
                "ksearchjavaExample h \"city, RC, CC\" CHECKIN_DATE CHECKOUT_DATE\n" );
            exit();         }
                $searchtype='h'; //$args[0].charAt(0);
            $sessionid= getsession();       echo("Session ID:\t".$sessionid );
                if($searchtype == 'f' ){            $searchid= start_flight_search("n",
$args[1],$args[2],$args[3],$args[4] );
        }
                if( $searchtype == 'h'){            $searchid=
start_hotel_search($args[1],$args[2],$args[3]);
        }       echo("Search ID:\t".$searchid);
        while (pollResults()) {
            echo("waiting for more...");        }   }

 private function getsession(){

        echo("Token:\t\t".$token  );        $xml
= simplexml_load_file($hostname."/k/ident/apisession?token=".$token
);

echo $xml->getName() . "<br />";

foreach($xml->children() as $child)  
{   echo $child->getName() . ": " .
$child . "<br />";   }
        $response=get($hostname+"/k/ident/apisession?token=".$token
);
            $root=xmlRoot($response);       $sessionid=$root.getElementsByTagName("sid");
        if( $sessionid.getLength() == 0){
            echo("BAD TOKEN: ".$response);
            exit(1);        }       return
$sessionid.item(0).getFirstChild().getNodeValue();
    }

 //private function fetch($urlstring){
//        $content = ""; //    //         try {
//          $url  = new URL($urlstring);  
//          InputStream is =
url.openStream(); //           
BufferedReader d = new
BufferedReader(new
InputStreamReader(is)); //         
String s; //             //         while
(null != (s = d.readLine())) { //       
content = content + s + "\n"; //         
} //            is.close(); //          
//        } catch ( Exception e ) {
System.out.println(e.getMessage() ); }
//        return content; //        } //    
//  public static void main(String[]
args) { //      ksearchJavaExample ks =
new ksearchJavaExample(args);        // }

  } $kps=new ksearchphpExample();
$arg= array
('h','hyderabad,india','03/11/2010','05/11/2010');
echo $kps->ksearchJavaExample($arg);  
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:35:31+00:00Added an answer on May 17, 2026 at 10:35 pm

    http://www.kayak.com/labs/api/search/

    Seems like you need to get a developer key. Once you’ve got that, you can POST their server for data, and parse the XML they return (note that their searches take 30-60 seconds to complete, so you have to request a search, catch the Search ID, then check back for the results using the Search ID). Check out the API spec.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i only use the hide() and the show() method on my website. But some
on a website i want to do this: (simplified) myHandlers = new Array(); for(var
I Want to website with ShellExec: ShellExec('open', 'http://www.domain.com/test.htm' + ErrorCode, '', '', SW_SHOWNORMAL, ewNoWait,
On my website i want to open a div in jQuery and show the
actually i just want to show main address of my site like http://localhost/website/ and
I am in the process of resecuring my registration on my website and want
i m making an iphone app that displays data from a website on a
I have a library that is meant to be used by many websites. The
I am new to DashCode, upto now I used to design websites with JavaScript,
I am using ckeditor to save my texts... (asp.net mvc) In the database the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.