pytrends icon indicating copy to clipboard operation
pytrends copied to clipboard

API returns data but at same time raises 400

Open Kayne88 opened this issue 2 years ago • 1 comments

When I invoke get_historical_interest the api returns the data, but the request itself yields a 400. Here's the code.

pytrend = TrendReq(timeout=(10,25), retries=2, backoff_factor=0.1, tz=0)

kw_list = ["Bitcoin", "BTC"]

historicaldf = pytrend.get_historical_interest(
    kw_list,
    year_start=2022,
    month_start=6,
    day_start=24,
    hour_start=0,
    year_end=2022,
    month_end=6,
    day_end=24,
    hour_end=13,
    cat=0,
    geo='',
    gprop='',
    sleep=10)

Output: The request failed: Google returned a response with code 400

However, the data I receive. What is the issue here?

Kayne88 avatar Jun 24 '22 12:06 Kayne88

I get the same problem. Have you fixed that?

CaoHaiNam avatar Jun 17 '23 11:06 CaoHaiNam