[Python] getting Google returned a response with code 400 error in pytrend

Discussão em 'Python' iniciado por Stack, Fevereiro 7, 2025.

  1. Stack

    Stack Membro Participativo

    I want to get yesterday or todays data from pytrend but every time i use this code i keep getting
    The request failed: Google returned a response with code 400. with the data and sometimes timeout or rate limit exceed error

    my code

    from pytrends.request import TrendReq
    pytrend = TrendReq()
    kw_list = ['pizza']
    data = pytrend.get_historical_interest(kw_list,
    year_start=2021,
    month_start=12,
    day_start=28,
    hour_start=0,

    year_end=2021,
    month_end=12,
    day_end=28,
    hour_end=23)
    print(data)

    Continue reading...

Compartilhe esta Página