Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insiders & holders = 404 error #1904

Closed
EthanW33 opened this issue Apr 10, 2024 · 5 comments
Closed

insiders & holders = 404 error #1904

EthanW33 opened this issue Apr 10, 2024 · 5 comments

Comments

@EthanW33
Copy link

Describe bug

404 Client Error: Not Found for url: https://query2.finance.yahoo.com/v10/finance/quoteSummary/?modules=institutionOwnership%2CfundOwnership%2CmajorDirectHolders%2CmajorHoldersBreakdown%2CinsiderTransactions%2CinsiderHolders%2CnetSharePurchaseActivity&corsDomain=finance.yahoo.com&symbol=AAPL&formatted=false&crumb=IeRNDRnDmnU

Unable to access insider purchases due to empty dataframe:
Insider Trades:
Empty DataFrame
Columns: []
Index: []

Simple code that reproduces your problem

import yfinance as yf

def get_insider_trades(symbol):
try:
# Create a Ticker object
ticker = yf.Ticker(symbol)

    # Get insider trades data
    insider_trades = ticker.get_insider_transactions()
    
    return insider_trades
except Exception as e:
    print("An error occurred:", e)
    return None

def main():
symbol = "AAPL" # Example symbol
insider_trades = get_insider_trades(symbol)

if insider_trades is not None:
    print("Insider Trades:")
    print(insider_trades)
else:
    print("Failed to retrieve insider trades.")

if name == "main":
main()

Debug log

N/A

Bad data proof

No response

yfinance version

Latest

Python version

No response

Operating system

No response

@farbodbahari
Copy link

Screenshot 2024-04-14 5 51 25 PM

none of the 3 following methods works anymore. Using version '0.2.37'
get_insider_purchases()
get_major_holders()
get_mutualfund_holders()

@ValueRaider
Copy link
Collaborator

ValueRaider commented Apr 15, 2024

Has Yahoo changed the API? Firefox -> Yahoo webpage -> F12 -> Network tab -> F5 -> inspect

Holders webpage doesn't appear to use API directly.

@ValueRaider ValueRaider changed the title 404 Insider Empty Dataframe insiders & holders = 404 error Apr 15, 2024
@ValueRaider ValueRaider pinned this issue Apr 15, 2024
@melgazar9
Copy link

Hey just adding to this thread. The following are broken:

  • insider_purchases
  • insider_roster_holders
  • insider_transactions
  • institutional_holders
  • major_holders
  • mutualfund_holders

@ValueRaider
Copy link
Collaborator

ValueRaider commented Apr 15, 2024

@bot-unit @JuliaLWang8 Can you advise on what the new API/fields might be, how to figure it out? (tagging because of #1728 (comment))

I figured out a fix - ticker symbol needs to be appended to base URL, not added as a parameter:

https://query2.finance.yahoo.com/v10/finance/quoteSummary/AAPL

I'll leave as a nice task for #1084

@hectoorperezz
Copy link

Is it possible to use this method ".institutional_holders" in any version?

It would be essential for what I am working on currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants