This API will help you to be in touch with the world of finance, and get the latest updates of financial news from every corner of the globe.
Please note: before continuing to work with our APIs, make sure that you import and install all required libraries. More information about the functions of the Financial News API can be found on our documentation web-page.
Accessing the EODHD API
To access the EODHD API, we need to create an instance of the “APIClient” class and pass our API key to it. In this example, we will use the demo API key provided by EODHD, but in your real application, you should use your registered API key.
api = APIClient("demo") # add your api key here
Please, note that you can also specify the API key in a configuration file or as an environment variable, as described in the library documentation here.
1. Use “DEMO” API key to test our data from a limited set of the tickers without registering:
AAPL.US | TSLA.US | VTI.US | AMZN.US | BTC-USD | EUR-USD
Real-Time Data and All of the APIs (except Bulk) are included without limitations on API calls.
2. Register to get your free API key (limitated by 20 API calls per day) with access to:
End-Of-Day Historical Data with only past year for any ticker and List of tickers per Exchange
3. To unlock your API key we recommend to choose subscription which covers your needs
Retrieving Financial News Data
After we’re done with the API client, we can start requesting financial news data.
news = api.financial_news (s = "balance sheet")
The API response will be a single JSON structure.
Converting JSON Response to DataFrame
To convert JSON to DataFrame it is possible to use:
fn = pd.DataFrame(news)
All data in DataFrame will contain information such as: “date”, “title”, “content”, “link” and “symbols”.
Extended Functions of the Stock Market and Financial News API
So, for a more accurate research, it is possible to use additional parameters of the Financial News API. It is possible to use range of dates from and to, which will help to get information for certain dates. Important to know – t or s arguments are required. It is possible to choose only one of the following arguments at the same time. Offset – the offset of the data. Limit is the number of results that will be returned.
news_extended = api.financial_news (from_date = "2020-12-10", to_date = "2021-04-10", t = "financial results", offset = "200", limit = "100")
The API response is a JSON array containing data for all the requested tickers. You can convert the resulting JSON array to a DataFrame for further analysis:
fn_m = pd.DataFrame(news_extended) print (fn_m)
List of Supported Tags for Financial News
‘balance sheet’, ‘capital employed’, ‘class action’, ‘company announcement’, ‘consensus eps estimate’, ‘consensus estimate’, ‘credit rating’, ‘discounted cash flow’, ‘dividend payments’, ‘earnings estimate’, ‘earnings growth’, ‘earnings per share’, ‘earnings release’, ‘earnings report’, ‘earnings results’, ‘earnings surprise’, ‘estimate revisions’, ‘european regulatory news’, ‘financial results’, ‘fourth quarter’, ‘free cash flow’, ‘future cash flows’, ‘growth rate’, ‘initial public offering’, ‘insider ownership’, ‘insider transactions’, ‘institutional investors’, ‘institutional ownership’, ‘intrinsic value’, ‘market research reports’, ‘net income’, ‘operating income’, ‘present value’, ‘press releases’, ‘price target’, ‘quarterly earnings’, ‘quarterly results’, ‘ratings’, ‘research analysis and reports’, ‘return on equity’, ‘revenue estimates’, ‘revenue growth’, ‘roce’, ‘roe’, ‘share price’, ‘shareholder rights’, ‘shareholder’, ‘shares outstanding’, ‘strong buy’, ‘total revenue’, ‘zacks investment research’, ‘zacks rank’
In conclusion, Financial News API is a great tool, which will help you to make the right decisions about capitalizing on stocks, or simply stay in touch with the financial world.