google-trends-api icon indicating copy to clipboard operation
google-trends-api copied to clipboard

unexpected token c in json at position 0

Open spookyvert opened this issue 5 years ago • 9 comments

I tried running it once and it worked! after that i get unexpected token c in json at position 0 everytime

spookyvert avatar Oct 20 '18 06:10 spookyvert

hopped on my VPN & it started working

when i disconnect it doesnt?

spookyvert avatar Oct 20 '18 06:10 spookyvert

@spookyvert Are you still having this issue? What query are you running?

pat310 avatar Dec 02 '18 17:12 pat310

Hello, I've had that issue and a couple others like it. It seems to be due to encountering the rate limit.

FelisPhasma avatar Dec 29 '18 01:12 FelisPhasma

I also have the same issue and haven't figured out the solution yet. Any suggestions would be greatly appreciated.

hawknguyen189 avatar Mar 29 '19 22:03 hawknguyen189

it's a rate limit issue. This library won't really be able to solve it besides communicating the errors more clearly.

hayksaakian avatar Apr 06 '19 05:04 hayksaakian

Thanks @hayksaakian. Since these errors happen so frequently it might be good to have a specific case to catch them and report it back to the user. What do you think?

pat310 avatar Apr 06 '19 12:04 pat310

Does anyone know any numbers or have an estimate of what the rate limit is or a quota limit?

As far as I can tell, running a request every second used to be the fastest rate to query without running into any throttling. After I receive a ''too many requests" error, the fastest reliable request speed seems to be once per minute.

I was wondering if any one else has played around with the rate limit and any rates they may have observed.

nakasoori avatar Apr 12 '19 05:04 nakasoori

@nakasoori I could fire off a bunch of requests fairly quickly but eventually I would get rate limited. With about thousands of requests, as I needed to perform, I did 1 request per minute, which experimentally seems to be the rate limit over time. (It also lines up with a suggestion I found elsewhere online)

FelisPhasma avatar Apr 16 '19 02:04 FelisPhasma

Thanks @FelisPhasma . I noticed that limit too. On the python version of this library, someone tested that there is a rate limit of 1400 requests per every 4 hours and a limit of 1 request per minute once the 4 hour limit is reached.

In my case, ideally I want to run a request every second and so I started working on using rotating proxy servers once a limit is reached. It seems that Google not only limits one's IP address, but limits a range of IP addresses altogether. Currently I am trying to find a way to ensure distinguished enough IP addresses while also optimizing the query speed as best as possible. If anyone has an ideas, I would very much appreciate it!

nakasoori avatar Apr 16 '19 06:04 nakasoori