areed1192 / interactive-broker-python-api

A python packaged used to interact with the Interactive Brokers REST API.
MIT License
389 stars 124 forks source link

Fundamentals endpoints coming back empty. #10

Closed Enericoy closed 4 years ago

Enericoy commented 4 years ago

Unsure if this is an error on my end or not, but having used both the IBClient and querying the localhost directly I am getting nothing back when using some of the fundamental endpoints, wondering if they maybe have been removed since this code was published?

For example: https://localhost:5000/v1/api/iserver/fundamentals/{conid}/summary and ib_client.fundamentals_summary both return a summary for a chosen conid as expected.

However: https://localhost:5000/v1/api/fundamentals/financials/{conid}?type=income&annual=true and ib_client.fundamentals_financials come back as "None" or "Resource not found".

Similarly for ib_client.fundamentals_key_ratios, ib_client.fundamentals_esg, ib_client.fundamentals_dividends, ib_client.data_analyst_forecast, nothing is returned.

I have tried removing and adding the "/iserver/" in the paths to see if maybe it is the wrong path but neither came back with anything. I have tried finding the endpoints by looking at the fundamentals data on my IB account and watching the requests, which are called out to "https://ndcdyn.interactivebrokers.com/tws.proxy/fundamentals/financials/{conid }?annual=true&type=income" which matches above without the prefix.

Wondering if this is something others have experienced?

5tomato commented 4 years ago

I have experienced the same thing. I did not find that the above solution resolved the issue.

When logged into the IB account you can copy and paste the "https://ndcdyn.interactivebrokers.com/tws.proxy/fundamentals/financials/{conid}?annual=true&type=income" request into the browser and it will return a json object. This is not the case when logged into the API.

The request: "https://ndcdyn.interactivebrokers.com/portal.proxy/v1/portal/fundamentals/landing/{conid}?widgets=news&lang=en" also works, which is weird, because when watching the requests when you navigate to the news section in the portal, it goes through tws.proxy instead of portal.proxy, which is what sends back the json if you type it into the search bar.

Any update on this?

areed1192 commented 4 years ago

So it appears that Interactive Brokers has ended access to the Fundamentals Endpoint using the API; as such, I'll be removing the endpoints from the library. I might try to see if the logic holds with this URL:

Until then, I'm going to make them "private methods" so people don't get confused. I'm also revamping the process for logging in and will provide an option where you can just let me know if the server is already running or not.

5tomato commented 4 years ago

@areed1192 thanks for checking into this! I emailed the IB team about news endpoints that were not on the Restful API documentation, and they said those kinds of endpoints are available through the TWS API, but not yet through the Restful API.

I noticed that you were also using tipranks' api for news. Have you found the quality of their news to be comparable with IB's?