Google Trends in R,尝试几次后出错 [英] Google Trends in R, error after few tries
问题描述
我知道之前也曾问过类似的问题,但我没有找到想要的东西.
I know similar questions have been asked before but I did not find what I was looking for.
我正在使用R提取Google趋势数据
I'm using R to pull google trend data
library(gtrendsR)
user <- "XXXXX@gmail.com"
psw <- "xxxxxxxxx"
gconnect(user, psw)
trend <- gtrends(c("abc","xyz","pqr","ist","def"),
start_date = as.Date("2015-11-01"),
end_date = as.Date("2015-12-31"),
#res = "1h",
geo = "US",
cat = "0-18")
trend$trend
使用此方法一次只能搜索5个术语,因此编写了一个函数,该函数将一堆术语作为输入,并在我使用 Sys.sleep( 10),在每次迭代之间,一切运行良好,但是在运行该功能5-6次之后,我开始收到错误消息
We can only search for 5 terms at a time using this method, so wrote a function and which takes a bunch of terms as input and passes them 5 at a time in the above snippet I used Sys.sleep(10) between each iteration , everything was running fine but after running the function for 5-6 times, I started receiving an error that
Error : Not enough search volume. Please change your search terms.
这是针对搜索字词"的情况发生的,对于该搜索字词,该功能之前运行得很好.
And this was happening for the 'search terms' for which the function was running perfectly fine earlier.
从我搜索时发现,谷歌可能已经设置了某种配额,无论是已发送的总请求数"还是否".的请求/持续时间"发送到他们的服务器,从而禁止了一天
From what I found while searching for it is that google might have placed a quota of some sort, either in terms of 'total requests' sent or 'no. of requests/time duration' sent to their server which places a day ban
我想知道配额限制的详细信息-是否.间隔内查询的搜索词数或查询词数
I wanted to know the specifics of the quota limit - Is it in terms of no. of search terms queried or number of search terms queried in an interval
推荐答案
我通过反复试验找出了限制,大约有180-200个查询,每个查询包含4个搜索字词,大约720个字
I figured out the limit using trial and error, it's around 180-200 queries, with each query consisting of 4 search terms, that's about 720 words
如果一天之内超过此限制,它将开始引发上述错误,计数器每24小时重置一次
It starts throwing the above error if you exceed this limit in a day, the counter gets reset every 24hours
这篇关于Google Trends in R,尝试几次后出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!