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.
The installation process varies depending on your python version and system used. The basic installation instructions are as follows:
Alternatively, the package can be installed by using:
Once you have successfully installed the package, you can either import the Financial Data module, for quantitative financial data:
or you can import the Benzinga News Data module, if you’re looking into financial news:
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”
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.news()
returns a JSON dict, for a better view of the dict, you can call the fin.output()
method on the result. Example: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.
When possible, we highly recommend using updated
parameters, particularly for ingestion of live data (as opposed to historical data). It shrinks the query universe much more efficiently than the other parameters, mitigating latency.
Public Method: Benzinga Bars looks at detailed price values over a period of time.
Arguments
Returns
open
, high
, low
, close
, volume
, time
, dateTime
Public Method: Benzinga Quote looks at many different attributes of the ticker like high, low, close etc
Arguments
Returns
date
, previousClose
, change
, changePercent
, fiftyTwoWeekHigh
, fiftyTwoWeekLow
, currency
, last
, tradingHalted
, volume
, previousCloseDate
Public Method: Benzinga Dividends looks at the relevant dividend information for a company.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet
Dividend date field to sort on (ex
, payable
, record
)
Records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
To filter the div yield by for eg. gt
, gte
, eq
, lte
, lt
. Not tested
Div yield amount fo filter by. 1
for 100% or above.
Returns
the id
, date
, updated
, ticker
, name
, exchange
, frequency
, dividend
, dividend prior
, dividend type
, dividend yield
, ex-dividend date
, payable date
, record date
, importance
Public Method: Benzinga Ratings looks at ratings from different firms
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet.
Ratings date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
Options are: Downgrades
, Maintains
, Reinstates
, Reiterates
, Upgrades
, Assumes
, Initiates Coverage On
, Terminates Coverage On
, Removes
, Suspends
, Firm Dissolved
Returns
id
, date
, time
, ticker
, exchange
, name
, action_pt
, action_company
, rating_current
, pt_current
, rating_prior
, pt_prior
, url
, importance
, updated
, url_calendar
, url_news
, analyst
, analyst_name
Public Method: Benzinga Earnings looks at the quarterly earnings reports for different companies.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet.
Earnings date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
Returns
id
, date
, date confirmed
, time
, ticker
, exchange
, name
, period
, period_year
, eps
, eps_est
, eps_prior
, eps_surprise
, eps_surprise_percent
, revenue
, revenue est
, revenue_prior
, revenue_surprise
, revenue_surprise_percent
, importance
, updated
Public Method: Benzinga Splits looks at the stock splits calendar data
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet.
Splits date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
Returns
id
, updated
, date
, time
, ticker
, exchange
, importance
, ratio
, optionable
, date_ex
, date_recorded
, date_distribution
Public Method: Benzinga Economics looks at different economic events in a country.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet.
Economics date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
3 digit country code
Returns
id
, date
, time
, country
, event_name
, event_period
, period_year
, actual
, actual_t consensus
, consensus_t
, prior
, importance
, updated
, description
Public Method: Benzinga Guidance looks at different attributes like revenue guidance etc.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet.
Guidance date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
3 digit country code
Returns
id
, date
, time
, ticker
, exchange
, name
, period
, period_year
, prelim
, eps_guidance_est
, eps_guidance_max
, eps_guidance_min
, eps_guidance_prior_max
, eps_guidance_prior_min
, revenue_guidance_est
, revenue_guidance_max
, revenue_guidance_min
, revenue_guidance_prior_max
, revenue_guidance_prior_min
, importance
, updated
Public Method: Benzing IPO looks at initial public offering data for companies.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
note: new tickers may not return results right away as we do not automatically link them to the underlying company’s data. To obtain the most recent rows, send queries without this parameter specified.
IPO date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
Returns
id
, date
, time
, ticker
, exchange
, name
, pricing_date
, currency
, price_min
, price_max
, deal_status
, ipo_type
, insider_lockup_days
, insider_lockup_date
, offering_value
, offering_shares
, shares_outstanding
, lead_underwriters
, other_underwriters
, underwriter_quiet_expiration_days
, underwriter_quiet_expiration_date
, notes,
updated`
Public Method: Benzinga Conference calls looks at conference calls.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
Conference call date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
3 digit country code
Returns
id
, date
, time
, ticker
, exchange
, name
, start_time
, phone_num
, international_line
, reservation_num
, access_code
, webcast_url
, importance
, updated
Public Method: Benzinga Fundamentals looks at overall financial data for a company.
Returns
company
, companyProfile
, shareClass
, earningReports
, financialStatements
, operation earning and valuation ratios
, alphaBeta
Public Method: Benzinga Financials looks at overall financial data like for a company.
Arguments
Returns
company
, financials such as balance sheet information, assets and liabilities
Public Method: Benzinga Valuation Ratios looks at overall financial data like for a company.
Returns
different attributes of the valuation ratios
Public Method: Benzinga Earning Ratios
Returns
different attributes of the earning ratios
Public Method: Benzinga Operation Ratios
Returns
different attributes of the operation ratios
Public Method: Benzinga Share Class
Returns
different attributes of the share class
Public Method: Benzinga Earning Reports looks at overall earning reports for a company.
Returns
different attributes of the earning reports
Public Method: Benzinga Alpha Beta
Returns
different attributes of alphabeta
Public Method: Benzinga Company Profile
Returns
different attributes of company profile
Public Method: Benzinga Company
Returns
different attributes of the company
Public Method: Benzinga Asset Classification
Returns
different attributes of the asset classification
Public Method: Summary
Returns
different attributes of the summary
Public Method: Benzinga Logos
Returns
different attributes of the logos
Public Method: Benzinga Options Activity
Arguments
Returns
different attributes for options activity
Public Method: Benzinga News
Arguments
select from full
, abstract
, headline
“YYYY-MM-DD” The date to query for calendar data. Shorthand for date_from
and date_to
if they are the same. Defaults for latest.
“YYYY-MM-DD”
“YYYY-MM-DD”
The last updated unix timestamp (UTC) to pull and sort by.
The last published unix timestamp (UTC) to pull and sort by.
multiple channels separated by comma
Returns
Author
, created
, updated
, title
, teaser
, body
, url
, image
, channels
, stocks
, tags
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.
The installation process varies depending on your python version and system used. The basic installation instructions are as follows:
Alternatively, the package can be installed by using:
Once you have successfully installed the package, you can either import the Financial Data module, for quantitative financial data:
or you can import the Benzinga News Data module, if you’re looking into financial news:
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”
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.news()
returns a JSON dict, for a better view of the dict, you can call the fin.output()
method on the result. Example: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.
When possible, we highly recommend using updated
parameters, particularly for ingestion of live data (as opposed to historical data). It shrinks the query universe much more efficiently than the other parameters, mitigating latency.
Public Method: Benzinga Bars looks at detailed price values over a period of time.
Arguments
Returns
open
, high
, low
, close
, volume
, time
, dateTime
Public Method: Benzinga Quote looks at many different attributes of the ticker like high, low, close etc
Arguments
Returns
date
, previousClose
, change
, changePercent
, fiftyTwoWeekHigh
, fiftyTwoWeekLow
, currency
, last
, tradingHalted
, volume
, previousCloseDate
Public Method: Benzinga Dividends looks at the relevant dividend information for a company.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet
Dividend date field to sort on (ex
, payable
, record
)
Records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
To filter the div yield by for eg. gt
, gte
, eq
, lte
, lt
. Not tested
Div yield amount fo filter by. 1
for 100% or above.
Returns
the id
, date
, updated
, ticker
, name
, exchange
, frequency
, dividend
, dividend prior
, dividend type
, dividend yield
, ex-dividend date
, payable date
, record date
, importance
Public Method: Benzinga Ratings looks at ratings from different firms
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet.
Ratings date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
Options are: Downgrades
, Maintains
, Reinstates
, Reiterates
, Upgrades
, Assumes
, Initiates Coverage On
, Terminates Coverage On
, Removes
, Suspends
, Firm Dissolved
Returns
id
, date
, time
, ticker
, exchange
, name
, action_pt
, action_company
, rating_current
, pt_current
, rating_prior
, pt_prior
, url
, importance
, updated
, url_calendar
, url_news
, analyst
, analyst_name
Public Method: Benzinga Earnings looks at the quarterly earnings reports for different companies.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet.
Earnings date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
Returns
id
, date
, date confirmed
, time
, ticker
, exchange
, name
, period
, period_year
, eps
, eps_est
, eps_prior
, eps_surprise
, eps_surprise_percent
, revenue
, revenue est
, revenue_prior
, revenue_surprise
, revenue_surprise_percent
, importance
, updated
Public Method: Benzinga Splits looks at the stock splits calendar data
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet.
Splits date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
Returns
id
, updated
, date
, time
, ticker
, exchange
, importance
, ratio
, optionable
, date_ex
, date_recorded
, date_distribution
Public Method: Benzinga Economics looks at different economic events in a country.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet.
Economics date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
3 digit country code
Returns
id
, date
, time
, country
, event_name
, event_period
, period_year
, actual
, actual_t consensus
, consensus_t
, prior
, importance
, updated
, description
Public Method: Benzinga Guidance looks at different attributes like revenue guidance etc.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
not tested yet.
Guidance date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
3 digit country code
Returns
id
, date
, time
, ticker
, exchange
, name
, period
, period_year
, prelim
, eps_guidance_est
, eps_guidance_max
, eps_guidance_min
, eps_guidance_prior_max
, eps_guidance_prior_min
, revenue_guidance_est
, revenue_guidance_max
, revenue_guidance_min
, revenue_guidance_prior_max
, revenue_guidance_prior_min
, importance
, updated
Public Method: Benzing IPO looks at initial public offering data for companies.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
note: new tickers may not return results right away as we do not automatically link them to the underlying company’s data. To obtain the most recent rows, send queries without this parameter specified.
IPO date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
Returns
id
, date
, time
, ticker
, exchange
, name
, pricing_date
, currency
, price_min
, price_max
, deal_status
, ipo_type
, insider_lockup_days
, insider_lockup_date
, offering_value
, offering_shares
, shares_outstanding
, lead_underwriters
, other_underwriters
, underwriter_quiet_expiration_days
, underwriter_quiet_expiration_date
, notes,
updated`
Public Method: Benzinga Conference calls looks at conference calls.
Arguments
page offset
limit of results returned
“YYYY-MM-DD”
“YYYY-MM-DD”
“YYYY-MM-DD”
Conference call date field to sort on
records last updated unix time stamp. Forces the sort order to be greater or equal to the time stamp indicated.
3 digit country code
Returns
id
, date
, time
, ticker
, exchange
, name
, start_time
, phone_num
, international_line
, reservation_num
, access_code
, webcast_url
, importance
, updated
Public Method: Benzinga Fundamentals looks at overall financial data for a company.
Returns
company
, companyProfile
, shareClass
, earningReports
, financialStatements
, operation earning and valuation ratios
, alphaBeta
Public Method: Benzinga Financials looks at overall financial data like for a company.
Arguments
Returns
company
, financials such as balance sheet information, assets and liabilities
Public Method: Benzinga Valuation Ratios looks at overall financial data like for a company.
Returns
different attributes of the valuation ratios
Public Method: Benzinga Earning Ratios
Returns
different attributes of the earning ratios
Public Method: Benzinga Operation Ratios
Returns
different attributes of the operation ratios
Public Method: Benzinga Share Class
Returns
different attributes of the share class
Public Method: Benzinga Earning Reports looks at overall earning reports for a company.
Returns
different attributes of the earning reports
Public Method: Benzinga Alpha Beta
Returns
different attributes of alphabeta
Public Method: Benzinga Company Profile
Returns
different attributes of company profile
Public Method: Benzinga Company
Returns
different attributes of the company
Public Method: Benzinga Asset Classification
Returns
different attributes of the asset classification
Public Method: Summary
Returns
different attributes of the summary
Public Method: Benzinga Logos
Returns
different attributes of the logos
Public Method: Benzinga Options Activity
Arguments
Returns
different attributes for options activity
Public Method: Benzinga News
Arguments
select from full
, abstract
, headline
“YYYY-MM-DD” The date to query for calendar data. Shorthand for date_from
and date_to
if they are the same. Defaults for latest.
“YYYY-MM-DD”
“YYYY-MM-DD”
The last updated unix timestamp (UTC) to pull and sort by.
The last published unix timestamp (UTC) to pull and sort by.
multiple channels separated by comma
Returns
Author
, created
, updated
, title
, teaser
, body
, url
, image
, channels
, stocks
, tags