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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 23.2MB
glibcpy 3.10–3.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
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'benzinga'
Library not installed.
benzinga.exceptions.AuthenticationError: 401 Client Error: Unauthorized
Invalid or missing API key.
fixEnsure 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.
fixUpgrade 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'