Open lypticDNA opened 5 years ago
If you look in the code, you can see that interest_by_region
is only implemented for the US:
I think this is a Google limitation, but I'm not sure - I didn't implement it.
Do you think you could modify this code to try regional searches with geo='GB'
and see if it works? I'm happy to merge a PR.
Thanks for the comment and recommendation. I tested this and found that it still outputs at country level for GB. You could be correct in stating this may be a Google limitation. I will continue to test the functionality to see if I can identify a solution.
Google trends provides a breakdown by city
In the interim, it would be helpful to warn users that DMA/CITY/REGION are only implemented for the US at present.
For example, I got a 500 error when using pytrend.interest_by_region(resolution='REGION')
without specifying pytrend.build_payload(..., geo='US')
. pytrend.interest_by_region(resolution='region')
also gives data per country. See this notebook.
To the general point, I think city and region are available outside the US, though DMA may not be.
Hi, I am currently building a suite of tools that harness the 'pytrends' scripts and found that the only one that does not appear to work as intended is the 'interest_by_region'.
Below is the part of the script that calls the data, prints it on screen and writes it to a CSV. I have changed the 'resolution' and the data pulled does not change.
As you can see below, this is the output I am getting.
Is this a bug or potential issue with the way Google allows the data to be read?