This is for PyTrends! NOT pytrend (that is a sadder unloved brother)
https://trends.google.com/trends/explore?cat=1392&date=today%205-y&geo=AT-9&q=Thailand,Seychellen,Maldiven
https://www.premiumleads.com/en/blog/seo/how-to-get-google-trends-data-with-pytrends-and-python/
429 = google doesn't like you hitting their server so often
The HTTP 429 Too Many Requests response status code indicates the user has sent too many requests in a given amount of time ("rate limiting"). A Retry-After header might be included to this response indicating how long to wait before making a new request.
Marketing question about product X in region Y speaks language Z.
You want to know how many times that X is mentioned is mentioned in regions A, B, C
You want to know how many times that X is mentioned is mentioned in language F, G, H
Generate a graph showing this search trend.
Your client, LittleCo, wants to know if their WidgetWonder is being searched in region A, B, C so they can retarget their ad campaigns.
Generate a graph showing this search trend.
Your client, SuperCo, wants to know how often their industry, BasketWeaving, is being searched in languages F, G and H.
Generate a graph showing this search trend.
Create a dashboard showing search trends over a time series by region.
?
Profit!!!
https://github.com/pleabargain/PyTrends
https://www.google.com/alerts?hl=en-GB#
- 67 = travel
- 179 = hotels and accomodations
- 1074 = beaches and islands
- 696 = luxury goods
- 1005 = ecotourism
- cestovní kancelář = travel agency
https://medium.com/@ismaelaraujo/pytrends-a-python-library-that-you-should-know-24764b384bc2
Google is obfuscating the request! Check out what it does to my "sand dunes" query. It counts the number of chars but exposes nothing else.
https://drive.google.com/file/d/13wUeT3ZHQvngwHiQMOKoPEb5WjIF8Fmm/view?usp=sharing
- create stand alone functions and pass key words via the command line
if len(sys.argv) >= 2:
name = sys.argv[1]
else:
name = 'World'
print ('Hello', name)
-
get a list of all pn e.g.
df = pytrend.trending_searches(pn='czech_republic')
-
fix graphs (still adding multiple search terms (kwlist) to same graph!)
-
create a function that handles the graph generation
-
pass arguments to the function
-
- google_trends -filename.csv
-
fix the output so that kwords is the search term
-
search should use a csv for source e.g. term, country(geo), language chien,FR,FR perro,ES,ES
-
use the sleep param in the module
If you are rate-limited by Google, you should set this parameter to something (i.e. 60) to space off each API call.
- each search term graph has it's own PDF with a branded header and company logo
-
- Not certain this is the way to go.
- added a logger
- added a minute time stamp to the files to make them easier to find!
- 60 second time between searches!
- set a progress bar in terminal
- Set a timer in between running individual searches
https://github.com/GeneralMills/pytrends/blob/master/examples/example.py
This is a fork.
I had to had some more pip install commands to get the script to run.
I got this one
OSError: [WinError 5] Access is denied:
I ran the pip install as admin cmd