Hi, we found, that Google Search API SERP differs from organic results on Google.com. Don't you know how to take true statistics via Google search API? thanks!
It is like 3 times fewer in google API, right ? did you manage to retrieve also result pages cursor? in order to display current search result page and next ones 1, 2, 3.....10 NEXT ! regards, Radu
I have a serps script I've been working on - far from perfect, but it's a start if you know PHP. I'm not kidding. I literally just copied and pasted this, except I deleted my proxies. You'll need to find your own. <pre> SERPS THANG <?php echo "\n"; $proxies = array( //get your own proxies ); function getPage($proxy, $url, $referer, $agent, $header, $timeout) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, $header); curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); curl_setopt($ch, CURLOPT_PROXY, $proxy); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_REFERER, $referer); curl_setopt($ch, CURLOPT_USERAGENT, $agent); $result['EXE'] = curl_exec($ch); $result['INF'] = curl_getinfo($ch); $result['ERR'] = curl_error($ch); curl_close($ch); return $result; } function get_a_href($file){ $h1count = preg_match_all('/(<h3 class="r"><a href=")(.*?)(")/i',$file,$patterns); return $patterns[2]; } $proxy = $proxies[rand(0,sizeof($proxies) - 1)]; echo "from: ".$proxy."\n"; for($i=0; $i<=15; $i++) { $request_url = 'http://www.google.com/search?q='.$_GET['q'].'&start='.$i*10; $result = getPage( $proxy, $request_url, 'http://www.google.com/', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8', 1, 5 ); if (empty($result['ERR'])) { $matches['urls'] = get_a_href($result['EXE']); if(sizeof($matches['urls']) > 0) { foreach($matches['urls'] as $match) { $urls[] = $match; } } else { echo $result['EXE']; } } else { echo $result['ERR'].$proxy; } } if(sizeof($urls) > 0) { $in_results = false; foreach($urls as $key => $url) { if(strpos($url,str_replace(' ','.',$_GET['site'])) > -1) { $in_results = $key + 1; } else { //'FAIL'; } } if($in_results > 0) { echo "You're at postion number: ".$in_results; } else { echo "You're not in the SERPS.\n"; echo $_GET['q']; } } else { echo 'URLS: \n\n'.print_r($urls,true).'\n'; } ?> </pre> PHP:
super, thanks for posting, I will check it for sure. why you need to use proxies ? I have a API key, why you are not using a key to avoid proxies ? (I am curious). All the best!
Google doesn't allow SERPS through the API as far as I know. They run a captcha if you hit the page too much, so proxies spread it out a bit.
Yeah proxies are necessary when using most of their APIs, it's crappy but the work and pho scripts definitely do work - the key languages are php, mysql, Ajax and XML data (for the API callbacks)
Stop spamming with great subject - add something to the conversation or you could easily get banned fast by any reports to dp
I have been trying this from a long time, but collecting SERP results online is next to impossible. I will look into the script....BUT WHAT PROXY YOU ALL ARE TALKING ABOUT....plzz let me know as i need this.