Python Forum

Full Version: Pytrends related querie & suggestion limitations
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey! So I learned that Pytrends has its limits regarding keywords that you can search and filter for. I also learned that you can bypass that with multi thread and combining the results.

It also appears that the limit for "top" and "rising" related queries is 25 and for suggestions it's 5? I wonder if there is a way to get more out of a request, similar to the multi thread solution for keywords, when using a filter.

That's the script I'm using:

from pytrends.request import TrendReq

pytrends = TrendReq()

# Set search parameters
keyword = 'baby'
category = 18 # Shopping category

# Get related queries and suggestions
pytrends.build_payload(kw_list=[keyword], cat=category)
related_queries = pytrends.related_queries()
suggestions = pytrends.suggestions(keyword)

# Extract top and rising related queries
top_related = related_queries[keyword]['top']
rising_related = related_queries[keyword]['rising']

# Print top related queries
print("Top related queries for", keyword, "in shopping category:")
for query in top_related['query']:
    print(query)

# Print rising related queries
print("\nRising related queries for", keyword, "in shopping category:")
for query in rising_related['query']:
    print(query)

# Print keyword suggestions
print("\nKeyword suggestions for", keyword + ":")
for suggestion in suggestions:
    print(suggestion['title'])
As always thanks for your time, help and maybe even your answer!

With kind regards
Chris