A small, Sandbox-first Python client for the INFINN API. Beginners can log in in a few lines.

Sandbox (UAT / Test — NOT live)

The SDK defaults to env="sandbox" (alias "uat"). Hosts stay on uat.infinn.in. Live needs env="live" and prints a warning.

On this page

Install

Not on PyPI yet. Install the wheel bundled with these docs:

Bash
pip install ./infinn-0.1.2-py3-none-any.whl "websocket-client>=1.6"
# optional live ticker support, if you did not install websocket-client above
pip install "infinn[ticker]"

pip install infinn is not on PyPI yet. Or from the source tree: pip install . inside downloads/sdk/infinn_sdk_src/. Older 0.1.1 files stay in that folder for history only. Use 0.1.2.

5-line Sandbox quickstart

Python
from infinn import Infinn

api = Infinn(env="sandbox")          # Sandbox (UAT / Test — NOT live)
print(api.login_url())               # open in browser; login with UPPERCASE user ID + password + TOTP
api.generate_session(input("Paste full redirect URL: "))
print(api.limits())                  # read-only check

Set INFINN_API_KEY and INFINN_API_SECRET in your environment before running. The SDK uppercases the user ID, pulls code= out of a full redirect URL, and builds checksum = sha256(api_key + secret + code) for you.

Sandbox tested — 5 Nov 2026

Read-only Sandbox checks passed: login / generate_session, user_details, search_instrument, quote, WebSocket ticker. Package infinn 0.1.1. No orders were placed.

Known: Sandbox Limits may time out

On Sandbox (uat.infinn.in), Limits sometimes hangs with a read timeout. Other reads (UserDetails, SearchScrip, GetQuotes) and the ticker work. The SDK uses a connect/read request timeout so your script does not freeze forever. Retry later, or skip Limits while testing on Sandbox.

Beginner test steps (Sandbox)

  1. Install the 0.1.2 wheel from downloads/sdk/.
  2. Set INFINN_API_KEY and INFINN_API_SECRET.
  3. Run the 5-line quickstart above with env="sandbox".
  4. Open the login URL, sign in with an UPPERCASE user ID, password and TOTP, then paste the full redirect URL.
  5. Call user_details(), search_instrument(...), quote(...). Optional: api.ticker() for a few seconds.
  6. Do not place orders on Sandbox until you are ready. Prefer Live only after Sandbox checks pass.

Method table

MethodWhat it doesAPI endpoint
login_url()Browser login linkOAuth page
generate_session(url_or_code)Exchange code for tokenGenAcsTok
set_session / load_session / save_sessionReuse a plain JSON session—
user_details()Account profileUserDetails
limits()Cash / marginLimits
search_instrument(text)Find symbolsSearchScrip
quote / ltpSnapshot priceGetQuotes
option_chain(exch, tsym, strike, count)Option contracts around a strike (0.1.2)GetOptionChain
security_info(exch, token)Lot size, tick size, expiry (0.1.2)GetSecurityInfo
place_order / modify_order / cancel_orderOrdersPlaceOrder / ModifyOrder / CancelOrder
orders() / trades()BooksOrderBook / TradeBook
positions() / holdings()PortfolioPositionBook / Holdings
ticker()WebSocket callbacksNorenWSTP
totp(secret)RFC 6238 helper—

option_chain and security_info

New in 0.1.2. option_chain(exchange, tradingsymbol, strike, count) returns option contracts around a strike (GetOptionChain). security_info(exchange, token) returns lot size, tick size and expiry (GetSecurityInfo). The Straddle / Strangle example uses both.

Examples

Coming from Zerodha Kite?

This is an original INFINN library — not a fork, and not Zerodha-branded. Method names are intentionally familiar so porting is easy:

Familiar nameINFINN SDKNotes
login_urllogin_url()Sandbox uses your app key as route_to
generate_session(request_token)generate_session(url_or_code)Accepts full redirect URL
place_order(...)place_order(...)Maps BUY/SELL, MARKET/LIMIT to Noren fields
orders / positions / holdingssame
ltp / quotesameUses GetQuotes
KiteTickerTicker via api.ticker()Optional websocket-client

Safety notes

  • Default env is Sandbox (UAT / Test — NOT live).
  • Secrets only from INFINN_API_KEY / INFINN_API_SECRET.
  • Tokens are never written to logs; repr() masks them.
  • Local write rate-limit stays under 10 orders/sec.
  • Network retries only on read endpoints.
  • The tick-recorder’s encrypted token.json (binary IA2T) is not loadable — use save_session() / load_session() plain JSON.
  • Do not place live orders until you have tested on Sandbox.

Downloads

0.1.1 files are in the same folder for history only. Use 0.1.2.

Version: infinn 0.1.2.

Esc
↑↓ navigate↵ openEsc close/ to search