pytrends: related_queries() example

Syntax

pytrends.related_queries()

related_queries() example

from pytrends.request import TrendReq

# Keywords
kw_list = ["python list"]

# pytrends
pytrends = TrendReq()

# build_payload
pytrends.build_payload(kw_list)

# related_queries
queries = pytrends.related_queries()

# Print
print(queries)

Output:

{'python list': {'top':                       query  value
0            list in python    100
1       python list in list    100
2                python for     22
3           python for list     22
4           python list get     21
5     string to list python     19
6            list to string     18
7              python array     18
8        python list remove     17
9         index list python     16
10             python index     15
11        python dictionary     15
12              python find     14
13         python list find     14
14          list add python     14
15         sort list python     12
16              python sort     12
17  python list append list     12
18              list append     12
19       list append python     12
20            append python     12
21            python append     12
22        python if in list     12
23          python function     12
24       python create list     11, 'rising':                                                 query  value
0   list indices must be integers or slices, not t...    950
1                                        google colab    850
2                              python online compiler    550
3                            list to dataframe python    500
4    list indices must be integers or slices, not str    400
5                                            leetcode    350
6                                          hackerrank    250
7          python count number of occurrences in list    200
8         difference between list and tuple in python    180
9                                      python list 削除    170
10                        list comprehension python 3    170
11                                     python list 結合    150
12                              linked list in python    130
13                           what is a list in python     80
14               find index of element in list python     80
15                    how to reverse a list in python     80
16                     python random sample from list     80
17                       python flatten list of lists     70
18                       how to append list in python     70
19                    python index of element in list     60
20                                 concat list python     60
21                                 linked list python     50
22                              nested list in python     50
23                       how to sort a list in python     50
24                             python list difference     50}}