用php按日期获取google趋势

用php按日期获取google趋势,php,Php,通过使用此提要 我们可以了解谷歌的最新趋势 但我需要了解前一天的趋势。当前趋势中的搜索词会经常更改,所以我尝试在当天开始时获取前一天的趋势主题。 但我不知道的网址,以获得前一天的趋势 有人能帮我解决这个问题吗?谢谢。您可以在这里尝试: 您可以从这里尝试: 接受的答案不再有效。在找了很多东西之后,我终于找到了一份工作 使用此工具,您可以在一段时间内从google trends中查找图形、区域和相关查询,方法如下: $gs=new GSession($guser, $gpass); $gs->

通过使用此提要

我们可以了解谷歌的最新趋势

但我需要了解前一天的趋势。当前趋势中的搜索词会经常更改,所以我尝试在当天开始时获取前一天的趋势主题。
但我不知道的网址,以获得前一天的趋势


有人能帮我解决这个问题吗?谢谢。

您可以在这里尝试:


您可以从这里尝试:


接受的答案不再有效。在找了很多东西之后,我终于找到了一份工作

使用此工具,您可以在一段时间内从google trends中查找图形、区域和相关查询,方法如下:

$gs=new GSession($guser, $gpass);
$gs->authenticate();
$gt=new GTrends($gs, 'es');
$gt->addTerm('something1')->addTerm('something2')->setTime('2017-04-01 2017-04-19');
$gt->getGraph('csv'));

编辑:图书馆不再免费,它的费用为28欧元。

公认的答案不再有效。在找了很多东西之后,我终于找到了一份工作

使用此工具,您可以在一段时间内从google trends中查找图形、区域和相关查询,方法如下:

$gs=new GSession($guser, $gpass);
$gs->authenticate();
$gt=new GTrends($gs, 'es');
$gt->addTerm('something1')->addTerm('something2')->setTime('2017-04-01 2017-04-19');
$gt->getGraph('csv'));

编辑:该库不再免费,成本为28欧元。

我知道这是一个老话题,但我创建并最近更新了该库:

它支持按地区、随时间变化的兴趣、相关主题和查询进行搜索,并且不需要谷歌帐户即可使用

例如:

$searchFilter = (new GSoares\GoogleTrends\Search\SearchFilter())
    ->withCategory(0) //All categories
    ->withSearchTerm('hair')
    ->withLocation('US')
    ->withinInterval(
        new DateTimeImmutable('now -7 days'),
        new DateTimeImmutable('now')
    )
    ->withLanguage('en-US')
    ->considerWebSearch()
    # ->considerImageSearch() // Consider only image search
    # ->considerNewsSearch() // Consider only news search
    # ->considerYoutubeSearch() // Consider only youtube search
    # ->considerGoogleShoppingSearch() // Consider only Google Shopping search
    ->withTopMetrics()
    ->withRisingMetrics();

$result = (new GSoares\GoogleTrends\Search\RelatedQueriesSearch())
->search($searchFilter)
->jsonSerialize();
响应示例:

{
“搜索URL”:http://www.google.com/trends/...",
“总体结果”:2,
“结果”:[
{  
“术语”:“美发沙龙”,
“排名”:100,
“hasData”:没错,
“搜索URL”:http://trends.google.com/..."
},
{  
“术语”:“短发”,
“排名”:85,
“hasData”:没错,
“搜索URL”:http://trends.google.com/..."
}
]

}
我知道这是一个老话题,但我创建并最近更新了这个库:

它支持按地区、随时间变化的兴趣、相关主题和查询进行搜索,并且不需要谷歌帐户即可使用

例如:

$searchFilter = (new GSoares\GoogleTrends\Search\SearchFilter())
    ->withCategory(0) //All categories
    ->withSearchTerm('hair')
    ->withLocation('US')
    ->withinInterval(
        new DateTimeImmutable('now -7 days'),
        new DateTimeImmutable('now')
    )
    ->withLanguage('en-US')
    ->considerWebSearch()
    # ->considerImageSearch() // Consider only image search
    # ->considerNewsSearch() // Consider only news search
    # ->considerYoutubeSearch() // Consider only youtube search
    # ->considerGoogleShoppingSearch() // Consider only Google Shopping search
    ->withTopMetrics()
    ->withRisingMetrics();

$result = (new GSoares\GoogleTrends\Search\RelatedQueriesSearch())
->search($searchFilter)
->jsonSerialize();
响应示例:

{
“搜索URL”:http://www.google.com/trends/...",
“总体结果”:2,
“结果”:[
{  
“术语”:“美发沙龙”,
“排名”:100,
“hasData”:没错,
“搜索URL”:http://trends.google.com/..."
},
{  
“术语”:“短发”,
“排名”:85,
“hasData”:没错,
“搜索URL”:http://trends.google.com/..."
}
]

}
您始终可以cron一个简单脚本,每隔几个小时刮取n db,并在每次看到一个单词时以增量放置一个计数器。您始终可以cron一个简单脚本,每隔几个小时刮取n db,并在每次看到一个单词时以增量放置一个计数器!。这就是我需要的网址。谢谢克里斯托;)@塞卡-太好了。很高兴我能提供帮助。此解决方案不再有效,请更新您的答案。谢谢,太好了!。这就是我需要的网址。谢谢克里斯托;)@塞卡-太好了。很高兴我能提供帮助。此解决方案不再有效,请更新您的答案。谢谢