pytrends
pytrends copied to clipboard
Allow list to be passed as geo
This allows passing multiple regions to be requested for the same keyword. This fixes #352.
@sv1990 are you okay rebasing this and reconfiguring a bit to match the new testing system?
Hi @emlazzarin, I'll look into it later
I think I messed up the rebase. The actual diff can be seen here.
Should I maybe open a new pull request in the hope that github doesn't think anymore that I changed 34 files?
I think I fixed it
I had to change the values in the unrelated test test_interest_by_region_city_resolution
so that all tests are now passing for me locally
LGTM, thanks @sv1990 !
Hi there! I think I still can't pas a list into geo, see below:
pytrends = TrendReq() pytrends.build_payload(kw_list=['pizza'], geo=['US-NY', 'US-IL']) df = pytrends.interest_over_time()
Traceback (most recent call last):
File "C:\Users\alexandery\AppData\Local\Temp\ipykernel_37688\2385922720.py", line 2, in
File "C:\Users\alexandery\AppData\Roaming\Python\Python39\site-packages\pytrends\request.py", line 189, in build_payload self._tokens()
File "C:\Users\alexandery\AppData\Roaming\Python\Python39\site-packages\pytrends\request.py", line 195, in _tokens widget_dicts = self._get_data(
File "C:\Users\alexandery\AppData\Roaming\Python\Python39\site-packages\pytrends\request.py", line 160, in _get_data raise exceptions.ResponseError.from_response(response)
ResponseError: The request failed: Google returned a response with code 400
Any suggestions would be welcome! Thanks a lot
@AlexYarkin I just checked and the feature still works for me, if you can provide a minimal reproducible example please open a new issue referencing this PR.