Keep your API Key secure. Do not share it in publicly accessible areas such as GitHub, client-side code, or unsecured communications. If you believe your key has been compromised, contact support immediately.
Authentication Methods
The Benzinga API supports two methods for authentication. We strongly recommend using the HTTP Header method for production applications as it is more secure and prevents your key from appearing in URL logs.1. HTTP Header (Recommended)
To authenticate via the header, include theAuthorization header with the value token <YOUR_API_KEY>.
2. Query Parameter
For quick testing or when header modification isn’t possible, you can pass your key as a query parameter namedtoken.
Code Examples
Here are production-ready examples for connecting to the Benzinga API in common languages.Troubleshooting
Common authentication errors and how to resolve them.| Status Code | Message | Possible Cause | Resolution |
|---|---|---|---|
| 401 | Unauthorized | Invalid API Key | Check that your API key is correct and has not been regenerated. ensure no extra spaces are copied. |
| 401 | Unauthorized | Missing API Key | Ensure the Authorization header is formatted correctly as token <KEY> or the token parameter is present. |
| 403 | Forbidden | Insufficient Permissions | Your API key is valid, but your plan does not include access to the requested endpoint. Contact sales or support to upgrade your plan. |