Registry / data / benzinga

benzinga

JSON →
library1.21pypypi✓ verified 84d ago

Python client library for Benzinga Data API (financial data). Current version 1.21. Active development on GitHub.

pip install benzinga
INSTALL
IMPORT
SIG · BENZINGA
B
benzinga
datapythonv1.21
Install
3.1s avg
Import
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.21 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 23.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.1s · import 0.000s · 24MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

benzinga
import benzinga
Top-level import. No submodule required for basic usage.
NewsClient
from benzinga.news import NewsClient
from benzinga import NewsClient
NewsClient is in benzinga.news submodule, not top-level.
InstrumentsClient
from benzinga.instruments import InstrumentsClient
from benzinga import InstrumentsClient
InstrumentsClient is in benzinga.instruments submodule.

Initialize client with API key, fetch data for AAPL.

import benzinga client = benzinga.Client(api_key=os.environ.get('BENZINGA_API_KEY', ''), retries=3, timeout=30) data = client.data(symbols=['AAPL'], start_date='2024-01-01', end_date='2024-01-05', format='json') print(data)
benzinga --version
Debug
Known issues
breakingIn version 1.x, the Client class replaced the old legacy API calls. Ensure you instantiate Client with api_key, retries, timeout.
fix
Use `client = benzinga.Client(api_key='...')` instead of raw requests.
affects: >=1.0.0
gotchaThe `data()` method returns raw JSON by default. To get a pandas DataFrame, you must pass `format='pandas'`.
fix
`client.data(symbols=[...], format='pandas')`
affects: all
gotchaAPI key is required for all requests. The library does not read environment variables automatically; you must pass the key explicitly.
fix
Set BENZINGA_API_KEY environment variable or pass string to Client.
affects: all
deprecatedThe `retries` and `timeout` parameters in Client were introduced in version 1.20. Older code without these may timeout on slow connections.
fix
Update to >=1.20 and add retries=3, timeout=30.
affects: <1.20
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'benzinga'
Library not installed.
fix
pip install benzinga
benzinga.exceptions.AuthenticationError: 401 Client Error: Unauthorized
Invalid or missing API key.
fix
Ensure you have a valid Benzinga API key and pass it to Client: Client(api_key='your_key_here')
TypeError: Client() got an unexpected keyword argument 'retries'
Old version of benzinga (<1.20) does not support retries/timeout.
fix
Upgrade benzinga: pip install --upgrade benzinga
Upgrade
Version history
1.21latest on PyPI · released Feb 8, 2021
Audit
Dependencies
requestsrequiredHTTP client for API calls
pandasoptionalOptional for DataFrame outputs when using data() method with format='pandas'
Agent activity
57 hits · last 30 days
node
48
Perplexity
1
OpenAI (training)
1
Resources
benzinga — pip install benzinga · libregistry