Skip to main content

alt text

Benzinga Python Client

This is the the official documentation for Benzinga's Python Package. This package Is compatible with Python v3.x+. For extensive instructions, visit Benzinga Docs

Getting Started

The installation process varies depending on your python version and system used. The basic installation instructions are as follows:

pip install benzinga

Alternatively, the package can be installed by using:

pip3 install benzinga

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

from benzinga import financial_data

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

from benzinga 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"

Logging Information

Log=True by default. Purpose of logging is to determine when the call was made (2020-10-21 08:02.29) and get the status of API call within the console (Status Code: 200)

Log (type: bool)

Sample Test Financial Data Module

  1. Initiating the class:
from benzinga import financial_data
api_key = "testkey892834789s9s8abshtuy"
fin = financial_data.Benzinga(api_key)

# logging is by default True in above case, in order to turn off the logging set log to False 

fin = financial_data.Benzinga(api_key, log=False)
  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 benzinga import news_data
api_key = "testkey892834789s9s8abshtuy"
paper = news_data.News(api_key)
  1. A sample test run to get general news. (Returns a JSON Object)
stories = paper.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:
paper.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.

For more Financial Data and News Data methods, please visit Benzinga Cloud.

Additional Links

Release files for benzinga 1.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for benzinga 1.21
File Size Uploaded
benzinga-1.21.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for benzinga 1.21
File Interpreter ABI Platform
benzinga-1.21-py2-none-any.whl Python 2 none any Details

Total release size: 22.2 kB

Release files / benzinga-1.21.tar.gz

Download URL benzinga-1.21.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6191624d3d70b9ec4a799c42bd0f053cf57e41033cb44a12b37c2ac9dbb6ad6c
BLAKE2b-256 checksum
How to use checksums
68ac686942075b9f3bf70937fb9b7eb243633b30393f207bab7ca918b0865f5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.5

Release files / benzinga-1.21-py2-none-any.whl

Download URL benzinga-1.21-py2-none-any.whl
Size 12.2 kB
Tags Python 2
SHA-256 checksum
How to use checksums
e9f9e26096bc359f6fdf34e5fad2d02fc61d2f89265b8e190dfcbfe6bb42aaea
BLAKE2b-256 checksum
How to use checksums
e9c2a25b23d6ab8d2924b0427eac6a93918f9c617b1be68c666c0c5a4266294e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.5

Release history Release notifications | RSS feed

This release

1.21 This release

2 release files

1.20

2 release files

1.19

2 release files

1.18

2 release files

1.17

2 release files

1.16

2 release files

1.15

2 release files

1.14

2 release files

1.13

2 release files

1.12

2 release files

1.11

2 release files

1.2.1

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

0.98

2 release files

0.95

2 release files

0.94

2 release files

0.93

2 release files

0.92

2 release files

0.91

2 release files

0.81

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page