This guide outlines the changes from the previous legacy superapi wrapper to the new official SuperApi SDK.
- Legacy:
superApi(lowercase 's') - New:
SuperApi(PascalCase)
The previous version required manual HMAC hashing of payloads and browser-based login redirects. The new version handles this internally.
Old Way:
# Manual HMAC and redirect URL parsingNew Way (Headless):
from superapi.superapi import SuperApi
api = SuperApi(api_key, user_id, password, api_secret)
api.validate_2fa_with_totp("123456") # Direct TOTP validation
# Session & Access Token are now generated automaticallyThe new SDK requires logzero for standardized logging.
pip install logzero pyotp cryptography requestsMethod signatures have been standardized to improve readability.
getFundDetails()->get_fund_details()getPositions()->positions()getHolding()->getHoldings()
- Stability: Resolves "Invalid Session" errors caused by incorrect HMAC calculations.
- Speed: Headless authentication allows for faster bot restarts without manual interaction.
- Coverage: Added support for more order types and better market data parsing.
For support, please raise an issue in the repository.