pythonyahoo-finance

cannot download fb data in yahoo finance API


Cannot download FB data in yahoo finance API

As FB renamed as META I no longer find its on yahoo finance API data.

Anyone can able to download the data before its renaming.

I am using yfinance but as we know FB symbol is delisted and renamed as META so it seem FB data is no longer found on yahoo.

 start_date = "2000-01-01"
 end_date = "2020-12-31"


 txt = os.path.join("data", "stock"+ ".txt")

 stock_list = [line.strip() for line in open(txt, "r")]

 data = yf.download(stock_list, start=startdate, end=enddate, 
 interval="1d", auto_adjust=False, prepost=False, ignore_tz= False)

Solution

  • I search Google for historic price of Facebook and I get answer (generated by AI)

    Facebook, now known as Meta Platforms, was not publicly traded in the year 2000. 
    The company was founded in 2004 and went public via an IPO on May 18, 2012, 
    with a share price of $38. Before 2012, there was no publicly available 
    Facebook stock price.
    

    I checked also Facebook in Wikipedia and there is:

    In 2012, Facebook went public with one of the largest IPOs in tech history.
    

    and:

    In 2021, Facebook rebranded as Meta, 
    

    So answer is: there is no data before 2012-05-18.

    And yfinance gives data from 2012-05-18 to present.
    So it gives data for old FB when you use name META.

    If you try to use older date then it will fill other date with NaN
    (but still there should be data from 2012-05-18 to present)