Kite Connect Python 5.2.0 — REST works, WebSocket upgrade fails with 403 using the same API key, access token, and whitelisted IP.
Setup
API key: i0vm…2ti9 Outbound IP (whitelisted): 152.42.158.128 (authenticated HTTP CONNECT proxy for all Kite traffic) Ticker: KiteTicker(api_key, access_token, reconnect=False) Works (REST)
Never reaches on_connect; connect_events=0, socket_ticks=0 Close reason: 1006: WebSocket connection upgrade failed (403 - Forbidden) Proxy log shows tunnel succeeds to WS host: TCP_TUNNEL/200 CONNECT ws.kite.trade:443 HIER_DIRECT/65.2.8.186 Latest attempt: unix 1787503738 (~23 Aug 2026, ~22:22 IST) Already ruled out
Squid ACL allows .kite.trade:443 — not a proxy deny Same token works for REST immediately after login Proxy off → REST fails (IP not whitelisted); proxy on → REST OK, WS still 403 Questions
Why does REST accept (api_key, access_token) on 152.42.158.128 but WS upgrade returns 403? Is WebSocket/streaming enabled separately for this API key? Any concurrent-session limit blocking WS while REST works? Can you check server-side logs for this key/IP around 23 Aug 2026 ~22:22 IST? Running on REST quote fallback for now; need WS for live ticks. Happy to share redacted Squid logs / diagnostics (no secrets).
To access live market data, historical candle data, or the WebSocket API, you need to subscribe to the paid Kite Connect plan.
If you are using a Kite Connect Personal (free) app, please note that it does not provide access to market data, historical data, or the WebSocket API. This limitation is likely the reason you are encountering the HTTP 403 (Insufficient permission for that call) error.
To verify this, please check the type of your app in the Developer Console and ensure that you are using the correct api_key associated with your paid Kite Connect application.
We have checked this and verified it at our end, and we didn't observe any issues with the WebSocket connection. Please review the WebSocket example code and ensure you are using the correct instrument token from the instrument file to check for any errors. Additionally, you can refer to the Python WebSocket streaming FAQs for further guidance.
If you are using a Kite Connect Personal (free) app, please note that it does not provide access to market data, historical data, or the WebSocket API. This limitation is likely the reason you are encountering the HTTP 403 (Insufficient permission for that call) error.
To verify this, please check the type of your app in the Developer Console and ensure that you are using the correct api_key associated with your paid Kite Connect application.
We have checked this and verified it at our end, and we didn't observe any issues with the WebSocket connection.
Please review the WebSocket example code and ensure you are using the correct instrument token from the instrument file to check for any errors. Additionally, you can refer to the Python WebSocket streaming FAQs for further guidance.