Skip to content

Edge: Too Many Requests, response code = 429 #2297

Description

@nishelby

Mod edit: only reply if yf.__version__ prints latest version. Ignore PIP Conda etc


As many have experienced the 429 error when using yf download. I have upgraded to the latest yfinance v 0.2.54 (Successfully installed yfinance-0.2.54) and I am still getting the too many requests. How do I resolve this? Thank you for your help,

2025-02-19 19:43:19,840:INFO:Processing Symbol
2025-02-19 19:43:19,842:DEBUG:Entering download()
2025-02-19 19:43:19,842:DEBUG:Disabling multithreading because DEBUG logging enabled
2025-02-19 19:43:19,842:DEBUG: Entering history()
2025-02-19 19:43:19,844:DEBUG:('CREATE TABLE IF NOT EXISTS "_kv" ("key" VARCHAR(255) NOT NULL PRIMARY KEY, "value" VARCHAR(255)) WITHOUT ROWID', [])
2025-02-19 19:43:19,844:DEBUG:('SELECT "t1"."key", "t1"."value" FROM "_kv" AS "t1" WHERE ("t1"."key" = ?) LIMIT ? OFFSET ?', ['SYMBOL', 1, 0])
2025-02-19 19:43:19,845:DEBUG: Entering _fetch_ticker_tz()
2025-02-19 19:43:19,845:DEBUG: Entering get()
2025-02-19 19:43:19,845:DEBUG:url=https://query2.finance.yahoo.com/v8/finance/chart/SYMBOL
2025-02-19 19:43:19,846:DEBUG:params=frozendict.frozendict({'range': '1d', 'interval': '1d'})
2025-02-19 19:43:19,846:DEBUG: Entering _get_cookie_and_crumb()
2025-02-19 19:43:19,846:DEBUG:cookie_mode = 'basic'
2025-02-19 19:43:19,846:DEBUG: Entering _get_cookie_and_crumb_basic()
2025-02-19 19:43:19,848:DEBUG:('CREATE TABLE IF NOT EXISTS "_cookieschema" ("strategy" VARCHAR(255) NOT NULL PRIMARY KEY, "fetch_date" DATETIME NOT NULL, "cookie_bytes" BLOB NOT NULL) WITHOUT ROWID', [])
2025-02-19 19:43:19,848:DEBUG:('SELECT "t1"."strategy", "t1"."fetch_date", "t1"."cookie_bytes" FROM "_cookieschema" AS "t1" WHERE ("t1"."strategy" = ?) LIMIT ? OFFSET ?', ['basic', 1, 0])
2025-02-19 19:43:19,849:DEBUG:loaded persistent cookie
2025-02-19 19:43:19,849:DEBUG:reusing cookie
2025-02-19 19:43:19,850:DEBUG:Starting new HTTPS connection (1): query1.finance.yahoo.com:443
2025-02-19 19:43:20,026:DEBUG:https://query1.finance.yahoo.com:443 "GET /v1/test/getcrumb HTTP/1.1" 429 23
2025-02-19 19:43:20,029:DEBUG:crumb = 'Edge: Too Many Requests'
2025-02-19 19:43:20,029:DEBUG: Exiting _get_cookie_and_crumb_basic()
2025-02-19 19:43:20,030:DEBUG: Exiting _get_cookie_and_crumb()
2025-02-19 19:43:20,031:DEBUG:Starting new HTTPS connection (1): query2.finance.yahoo.com:443
2025-02-19 19:43:20,180:DEBUG:https://query2.finance.yahoo.com:443 "GET /v8/finance/chart/SYMBOL?range=1d&interval=1d&crumb=Edge%3A+Too+Many+Requests HTTP/1.1" 429 23
2025-02-19 19:43:20,181:DEBUG:response code=429
2025-02-19 19:43:20,181:DEBUG:toggling cookie strategy basic -> csrf
2025-02-19 19:43:20,182:DEBUG: Entering _get_cookie_and_crumb()
2025-02-19 19:43:20,182:DEBUG:cookie_mode = 'csrf'
2025-02-19 19:43:20,182:DEBUG: Entering _get_crumb_csrf()
2025-02-19 19:43:20,183:DEBUG:('SELECT "t1"."strategy", "t1"."fetch_date", "t1"."cookie_bytes" FROM "_cookieschema" AS "t1" WHERE ("t1"."strategy" = ?) LIMIT ? OFFSET ?', ['csrf', 1, 0])
2025-02-19 19:43:20,184:DEBUG:Starting new HTTPS connection (1): guce.yahoo.com:443
2025-02-19 19:43:20,454:DEBUG:https://guce.yahoo.com:443 "GET /consent HTTP/1.1" 302 0
2025-02-19 19:43:20,456:DEBUG:Starting new HTTPS connection (1): www.yahoo.com:443
2025-02-19 19:43:21,980:DEBUG:https://www.yahoo.com:443 "GET /?guccounter=1 HTTP/1.1" 200 None
2025-02-19 19:43:22,177:DEBUG:Failed to find "csrfToken" in response
2025-02-19 19:43:22,177:DEBUG: Exiting _get_crumb_csrf()
2025-02-19 19:43:22,177:DEBUG:toggling cookie strategy csrf -> basic
2025-02-19 19:43:22,178:DEBUG: Entering _get_cookie_and_crumb_basic()
2025-02-19 19:43:22,178:DEBUG:('SELECT "t1"."strategy", "t1"."fetch_date", "t1"."cookie_bytes" FROM "_cookieschema" AS "t1" WHERE ("t1"."strategy" = ?) LIMIT ? OFFSET ?', ['basic', 1, 0])
2025-02-19 19:43:22,179:DEBUG:loaded persistent cookie
2025-02-19 19:43:22,179:DEBUG:reusing cookie

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions