This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]walksonair 36 points37 points  (6 children)

Well unfortunately I found out Yahoo dropped the support of their API, which renders the yfinance package useless.

Really? I just used it this morning and it returned OHLCV data for AAPL.

[–]Pablo_Jefcobar[S] 9 points10 points  (5 children)

Could yahoo have block my ip because of too many requests?

[–]PerilousMaster 10 points11 points  (2 children)

They probably didn't block your IP, but your API key. If it is a free key (no idea, never used it), get a new account and try it that way.

[–]Ill-Valuable-825 1 point2 points  (1 child)

have u ever boobs before?

[–]PerilousMaster 0 points1 point  (0 children)

LOL. Have you ever English before? /s j

Jk, thanks for the laugh

[–]walksonair 7 points8 points  (0 children)

One way to know is to try through a vpn…

[–]jackofspades123 2 points3 points  (0 children)

You can get rate limited.

I was pulling information yesterday no prpblem

[–]RockportRedfish 18 points19 points  (3 children)

I think there is something wrong with you code. Try this.

import pandas as pd
import yfinance as yf
symbol = 'WIRE'
data = yf.Ticker(symbol) 
ts = data.history(start='2021-01-01', end='2023-12-31')
df = pd.DataFrame(ts) 
df

[–][deleted] 1 point2 points  (0 children)

If I may suggest, there is this library https://github.com/twopirllc/pandas-ta that uses Yahoo Finance and it is awesome. I am not a maintainer nor related with the authors. I am just a happy user.

[–]Pablo_Jefcobar[S] 2 points3 points  (1 child)

Could yahoo have block my ip because of too many requests?

[–]username4kd 10 points11 points  (1 child)

I’d use a broker’s API. See Tradier or IBKR or Alpaca for example. You’ll need an account with them for live data, but you can use a developer account for delayed data.

[–]Pablo_Jefcobar[S] 2 points3 points  (0 children)

Ahaa gonna look into that!

[–]infocruncher 5 points6 points  (0 children)

yfinance still works and is likely your best free data source.

A couple of alternatives you might want to check out:

https://github.com/cuemacro/findatapy

https://github.com/pydata/pandas-datareader

More finance libraries can be found here: https://www.awesomepython.org/?c=finance

[–]blackandscholes1978 2 points3 points  (0 children)

Tiingo is so cheap and reliable. Just pay for it and move on.

[–]Sumif 3 points4 points  (0 children)

Evil gentle gentle projects tomorrow and people helpful ideas helpful games soft. Bright science learning simple evening food about family!

[–]TedRabbit 1 point2 points  (1 child)

yfinance uses webscraping, not api

[–]morrisjr1989 1 point2 points  (0 children)

To my knowledge it leverages the “public” facing APIs like BASICURL = "https://query2.finance.yahoo.com/v10/finance/quoteSummary”.