php - Google AJAX Search API not returnig results -


i using code below search results. when insert string in google 1 search result when trying result through code returns nothing. can explain why code not working. returns results if enter other search term

 <?php     $string="make them see things view";      $request =  trim("http://ajax.googleapis.com/ajax/services/search/web");       $referrer = trim("http://localhost/");         $version = "1.0";        $getargs = '?v='. $version .'&rsz=small&q="'. urlencode($string).'"' ;        // curl session object       $session = curl_init($request . $getargs);       // set options.       curl_setopt($session, curlopt_httpget, true);       curl_setopt($session, curlopt_header, true);       curl_setopt($session, curlopt_returntransfer, true);       curl_setopt($session, curlopt_referer, $referrer);       //var_dump $response;       $response=null;       // post , close session       $response = curl_exec($session);       curl_close($session);     var_dump ($response);       // http status code response       $status_code = array(); preg_match('/\d\d\d/', $response, $status_code);     print_r($status_code);     ?> 

your code fine. makes api call , gets response.

if make different search, say, "digital cameras", results part of response.

why api returns different results whatever of google's dozens of data centers returns web search question google, or google's documentation, can answer.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -