Use case

Proxies for yfinance: the setting moved, and what 429 means

Set a proxy in yfinance 1.7.0 with yf.config.network.proxy or your own session, pick a proxy that relays TLS, and see why YFRateLimitError can persist.

HProxy Team··Updated September 19, 2026·6 min read
HProxy.Use case

Free proxies won't hold up here.

Shared datacenter IPs get flagged and dropped fast. When it has to hold, gaming, streaming, accounts, you need mobile and residential IPs that read as a real device, from $0.44/GB, pay as you go.

Proxies for Web Scraping

yfinance has moved its proxy setting twice, and most guides on the web are one or two generations behind. In 1.7.0 there is exactly one place for it, the per-call argument is gone, and the example page that shows that argument still ships with the release. The other half of the story is what a proxy actually changes when Yahoo answers "Too Many Requests", which is less than proxy sellers suggest. We read every setting on this page in yfinance 1.7.0, released on 26 August 2026.

Why would yfinance need a proxy?

Because Yahoo refuses some addresses more readily than others, and cloud ranges are the usual example. Our own test of 19 September 2026 put the same plain requests through a hosting address and a residential one: four of thirteen sites answered differently. That test did not touch Yahoo, so read it as a sign that the address is one of the things being judged. The full table is on our OpenClaw page.

Where the proxy goes now

import yfinance as yf

yf.config.network.proxy = "http://USERNAME:PASSWORD@GATEWAY_HOST:GATEWAY_PORT"
yf.config.network.retries = 2

print(yf.Ticker("MSFT").history(period="5d"))

A string is expanded to both schemes. A dictionary is passed through untouched, so {"http": ..., "https": ...} works when you want them different. The value is read again before every request, which makes rotation easy: assign another line before the next call and it takes effect.

WhereIn 1.7.0
yf.config.network.proxythe current setting, used for every fetch
yf.set_config(proxy=...)still works, warns, sets the same value
proxies on a session you passkept, as long as the global setting stays unset
proxy= on history() and friendsremoved, raises a TypeError

The argument that no longer exists

The word proxy does not appear in base.py, ticker.py or multi.py any more, and history() accepts no unknown keywords. A guide that tells you to write msft.history(..., proxy=...) is describing a version from before 2025, and the shipped example page says the same thing.

What Yahoo actually judges

yfinance does not send plain Python requests. It depends on curl_cffi to imitate a browser's TLS handshake, and its own code explains why: plain requests "cannot replicate the JA3/JA4 fingerprint and HTTP/2 settings that curl_cffi provides, so Yahoo Finance may rate-limit or block this client".

That has a direct consequence for your proxy. A SOCKS5 proxy relays the connection, and an ordinary http:// proxy opens a tunnel and lets the client do its own TLS, so both keep the fingerprint yfinance worked to produce. A proxy that terminates TLS to inspect traffic sends its own handshake instead. One user reported exactly that: through a TLS-inspecting proxy a single request came back 429, while the same code through a SOCKS5 proxy worked.

So the rule for this library is not residential against datacenter first. It is relay against inspect.

Will a proxy clear YFRateLimitError?

Sometimes, and the honest answer is smaller than the search results suggest. Any 429 from Yahoo becomes YFRateLimitError("Too Many Requests. Rate limited. Try after a while."), whether it came from the data request or from fetching the crumb that goes with it. The large wave of 2025 ran to 141 comments on one issue, and it opened with a line worth remembering: the reporter had already tried different addresses. What fixed it was work inside the library.

Version 1.7.0 carries more of that work. It stopped overwriting the proxy on a session you supplied, it stopped treating a timeout from fc.yahoo.com as fatal, and a rate-limited crumb fetch now continues without a crumb rather than ending the request. If you run anything older behind a proxy, upgrade before you buy addresses.

Which proxy type fits yfinance?

Residential, when the hosting address is the thing being refused. A rotating line suits a sweep over many symbols, where each call stands alone. A sticky line suits a longer run in one process, because the cookie and crumb are minted once and reused; if you see repeated crumb fetches after switching to a rotating line, that is the signal to hold one address.

HProxy residential gateways work either way here. Lines are http by default and socks5 on request, and both relay the connection, so yfinance keeps its own TLS handshake. A Residential Premium plan can allow your server's address instead, up to 150 per plan, so no login travels in your code at all. Rotating ports change the address, a sticky port holds one, and a sticky address can still change early if its device leaves the network. The residential proxies page lists the plans, and the plan API generates lines and manages allowed addresses from code.

What breaks when the proxy is on

  • TypeError on history(). You passed proxy=. Set it globally instead.
  • The proxy seems ignored on an older version. Before 1.7.0 the library overwrote the proxies of a session you passed on every request.
  • Caching sessions (e.g. requests_cache) are not supported. Pass a plain curl_cffi or requests session, or none at all.
  • Requests hang, then fail, through a corporate proxy. Older versions treated a timeout from Yahoo's cookie host as fatal. 1.7.0 logs a warning and continues.
  • 407 Proxy Authentication Required. The password is wrong, or the line belongs to another plan. Our 407 guide walks through it.
  • A rotating line seems to do nothing. Repeated identical calls are served from an in-process cache of the last 64 responses and never reach the network.
  • Everything still returns 429. Check the version, then the shape of the proxy, then the address. In that order.

What this page does not cover

We read yfinance 1.7.0 as text and did not run it, and we sent no requests to Yahoo Finance, so nothing here measures its limits. The TLS point comes from the library's own code and from a user report, not from our own capture. Whether a plain http:// gateway performs as well as SOCKS5 here follows from how tunnelling works, and we did not test it against Yahoo. yfinance ships often, so we will read these settings again by 19 October 2026.

Where to go from here

Proxies for google-maps-scraper covers another data collector whose proxy handling hides in a library. HTTP vs SOCKS5 explains the two line types behind the relay rule above, and sticky vs rotating sessions explains the choice for a long run.

Sources

  • The config module and its documentation page, the deprecated set_config helper, the data layer (proxy normalisation, the per-request sync, the 429 path and the response cache), the HTTP backend note on curl_cffi, the dependency list, and the shipped proxy example page. ranaroussi/yfinance, release 1.7.0, 26 August 2026.
  • Pull request 2953 (SOCKS5 robustness, merged 26 August 2026) and issues 2729, 2512, 2518 and 2422. yfinance issue tracker, 2025 to 2026.
  • HTTP and HTTPS proxies, and what each does with an HTTPS destination. urllib3 2.8.0 documentation.
  • Plans, IP whitelist and sticky sessions; errors; the proxy API. HProxy documentation, hproxy.com/docs, 19 September 2026.
  • Our own test of 19 September 2026: plain GET requests to 13 sites and 3 controls, two runs from our server and two through a residential line of our own house plan. Raw output is kept in the research folder of our OpenClaw page.

Frequently asked questions

How do I set a proxy in yfinance?
Set it once, globally: yf.config.network.proxy = "http://USER:PASS@HOST:PORT". A string is used for both http and https, and a dictionary works if you want them different. The value is read again before every request, so you can change it between calls.
Does the proxy argument still work in history()?
No. The per-call argument was removed, and history() has no such parameter, so the call raises a TypeError. The project still ships an example page that shows it, which is why old guides keep repeating it.
Will a proxy fix YFRateLimitError?
Sometimes. A different address helps when the address is the reason, such as a cloud range. The large wave of 2025 persisted across addresses and was fixed inside the library instead, so upgrade first and change address second.
Should I use SOCKS5 or HTTP with yfinance?
Either, as long as it relays the connection. yfinance imitates a browser's TLS handshake, and a proxy that opens TLS itself replaces that fingerprint. One user got a 429 on a single request through a TLS-inspecting proxy, and no error through SOCKS5.
Can I rotate a pool of proxies?
Yes, in your own code. Because the setting is read before every request, assigning a different line to yf.config.network.proxy between calls changes the address for the next one. Repeated identical requests come from an in-process cache and never leave your machine.

Proxies that don't die mid-job

Residential, ISP, datacenter and mobile, verified by the same engine that runs tens of millions of checks. They read as a real device and hold up under load. Pay as you go, and your balance never expires. $0.44/GB is the 2,000 GB+ rate; a single gigabyte is $0.50/GB, with no minimum order.

129M+ proxy checks run · 100+ countries · HTTP / HTTPS / SOCKS · re-checked every few minutes · no signup

HProxy.

Honest guides and comparisons on proxies, scraping and staying unblocked, from the team that runs the network.

RSS feed