Benzinga / benzinga-python-client

Python client library for benzinga news and financial data
https://cloud.benzinga.com
MIT License
23 stars 12 forks source link
datascience finance financialdata fintech media news

Benzinga Logo

Benzinga's Python Client Library's Documentation

Benzinga's Python client library focuses on financial data methods, that can be used for quantitative analysis, and on news data from Benzinga, that can help give meaningful insights that complement quantitative data.

Table of Contents

Getting Started

The basic installation instructions are as follows (Recommended):

pip install git+ssh://git@github.com/Benzinga/benzinga-python-client.git

Once you have successfully installed the package, you can either import the Financial Data module, for quantitative financial data:

from benzingaorg import financial_data

or you can import the Benzinga News Data module, if you're looking into financial news:

from benzingaorg import news_data

Your Key

Api Key To initiate a class, an API key is used, for authentication purposes. Contact us if you don't yet have a key, we will take care of you!

Sample API Key (type: str) : "testkey892834789s9s8abshtuy"

Sample Test Financial Data Module

  1. Initiating the class:
from benzingaorg import financial data
api_key = "testkey892834789s9s8abshtuy"
fin = financial_data.Benzinga(api_key)
  1. A sample test run to get ratings on a stock. (Returns a JSON object):
stock_ratings = fin.ratings()
  1. Since fin.ratings() returns a JSON dict, for a better view of the dict, you can call the fin.output() method on the result. Example:
fin.output(stock_ratings)

Sample Test News Data Module

  1. Initiating the class:
from benzingaorg import news_data
api_key = "testkey892834789s9s8abshtuy"
news = news_data.News(api_key)
  1. A sample test run to get general news. (Returns a JSON Object)
stories = news.news()
  1. Since fin.news() returns a JSON dict, for a better view of the dict, you can call the fin.output() method on the result. Example:
news.output(stories)

It is important to note that for both the Financial Data Module and the News Data Module, there are many Optional parameters for the methods. Below is a detailed listing of possible methods for the Financial Data Module and the news Data Module, their method call names, arguments, and what they return.

Financial Data Methods:

Price History

fin.price_history()

Public Method: Benzinga Price History returns daily candles for a specific date range for a company.

Auto-Complete

fin.auto_complete()

Public Method: Benzinga Auto-Complete returns the relevant information related to a company ticker.

Security

fin.security()

Public Method: Benzinga Security returns the information regarding the security.

Chart

fin.chart()

Public Method: Benzinga Chart looks at detailed price values over a period of time.

Quote

fin.quote()

Public Method: Benzinga Quote looks at many different attributes of the ticker like high, low, close etc

Instruments

fin.instruments()

Public Method: Benzinga Instruments looks at all of the screener data with price statistics, based on different attributes.

Dividends

fin.dividends()

Public Method: Benzinga Dividends looks at the relevant dividend information for a company.

Ratings

fin.ratings()

Public Method: Benzinga Ratings looks at ratings from different firms

Earnings

fin.earnings()

Public Method: Benzinga Earnings looks at the quarterly earnings reports for different companies.

Splits

fin.splits()

Public Method: Benzinga Splits looks at the stock splits calendar data

Economics

fin.economics()

Public Method: Benzinga Economics looks at different economic events in a country.

Guidance

fin.guidance()

Public Method: Benzinga Guidance looks at different attributes like revenue guidance etc.

IPO

fin.ipo()

Public Method: Benzing IPO looks at initial public offering data for companies.

Retail

fin.retail()

Public Method: Benzinga Retail looks at retail data.

Conference Calls

fin.conference_calls()

Public Method: Benzinga Conference calls looks at conference calls.

Fundamentals

fin.fundamentals()

Public Method: Benzinga Fundamentals looks at overall financial data for a company.

Financials

fin.financials()

Public Method: Benzinga Financials looks at overall financial data like for a company.

Valuation Ratios

fin.valuation_ratios()

Public Method: Benzinga Valuation Ratios looks at overall financial data like for a company.

Earning Ratios

fin.earning_ratios()

Public Method: Benzinga Earning Ratios

Operation Ratios

fin.operation_ratios()

Public Method: Benzinga Operation Ratios

Share Class

fin.share_class()

Public Method: Benzinga Share Class

Earning Reports

fin.earning_reports()

Public Method: Benzinga Earning Reports looks at overall earning reports for a company.

Alpha Beta

fin.alpha_beta()

Public Method: Benzinga Alpha Beta

Company Profile

fin.company_profile()

Public Method: Benzinga Company Profile

Company

fin.company()

Public Method: Benzinga Company

Share Class Profile History

fin.share_class()

Public Method: Benzinga Share Class Profile History

Asset Classification

fin.asset_classification()

Public Method: Benzinga Asset Classification

Summary

fin.summary()

Public Method: Summary

Logos

fin.logos()

Public Method: Benzinga Logos

Movers

fin.movers()

Public Method: Movers Data on Gainers and Losers

Ticker Detail

fin.ticker_detail()

Public Method: Benzinga Ticker detail provides key statistics, peers, and percentile information on the company.

Options Activity

fin.options_activity()

Public Method: Benzinga Options Activity

News Data:

fin.news()

News

Public Method: Benzinga News

Top News

news.top_news()

Public Method: Benzinga Top News

Channels

news.channels()

Public Method: Benzinga Channels only focuses on Channel IDs. The below arguments will have no impact on what is returned. It is just for reference.

Quantified News

news.quantified_news()

Public Method: Benzinga Quantified News

Additional Links