VKGS VKGS - 1 year ago 97
PHP Question

Get google trends by date in php

By using this feed


we can get current trends in google.

But am in need to get previous day trends. search terms in current trends will change often, so that i tried to get previous day trending topics on start of the current day.

But i dont aware of the url to get previous day trends?

Any body can get me out this problem? Thanks.

Kit Kit
Answer Source

You could try this from here: http://www.fromzerotoseo.com/scraping-google-hot-trends/

// Scraping New Year’s Eve
$result = getPage(
    '[proxy IP]:[port]',
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/2009032609 Firefox/3.0.8',

if (empty($result['ERR'])) {    
        '(<td class=num>\d+\.</td>.*<td><a href="(.*)">(.*)</a></td>)siU',
        $result['EXE'], $matches);

    // some URL tuning here…
    for ($i = 0; $i < count($matches[1]); $i++) {
        $matches[1][$i] = 'http://www.google.com' . $matches[1][$i];

    // Job's done! 
    // $matches[1] array contains all URLs, and 
    // $matches[2] array contains all anchors
} else {
    // WTF? Captcha or network problems? 
    // ...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download