pytrends: TrendReq timeout example

Syntax

TrendReq(timeout=(connect, read))

TrendReq timeout example

from pytrends.request import TrendReq

# Keywords
kw_list = ["python list", "python tuple"]

# pytrends
pytrends = TrendReq(timeout=(20,25))

# build_payload
pytrends.build_payload(kw_list)

# Print
print(pytrends.interest_over_time())

Output:

            python list  python tuple isPartial
date                                           
2016-10-30           55             5     False
2016-11-06           52             6     False
2016-11-13           54             6     False
2016-11-20           45             4     False
2016-11-27           57             5     False
...                 ...           ...       ...
2021-09-26           81             8     False
2021-10-03           78             7     False
2021-10-10           82             8     False
2021-10-17           89             7     False
2021-10-24           52             2      True

[261 rows x 3 columns]