servloci
Official Python SDK for sending verified broker order and trade API requests through your dedicated ServLoci IPv6.
Install
pip install servloci
One-token quickstart
Generate an access token in the ServLoci portal, verify the broker once, then:
from servloci import Client
client = Client(token="sl_live_...", broker="dhan")
response = client.get(
"/v2/orders",
headers={
"access-token": "YOUR_DHAN_ACCESS_TOKEN",
"client-id": "YOUR_DHAN_CLIENT_ID",
},
)
response.raise_for_status()
print(response.json())
The SDK adds X-ServLoci-Token and X-ServLoci-Broker. ServLoci confirms
that the selected broker was verified under your account, forwards only the
allowed order/trade path to that broker's official origin, and sends the
request from your assigned IPv6. Your broker authorization headers pass
through and are not stored.
Environment-variable setup is equally small:
export SERVLOCI_TOKEN='sl_live_...'
export SERVLOCI_BROKER='dhan'
from servloci import Client
client = Client.from_env()
response = client.post("/v2/orders", headers={...}, json={...})
Supported fixed-origin HTTP routes: Dhan, Kite (Zerodha), Groww, FYERS, Upstox, and ICICI Direct. Kotak Neo uses a per-session dynamic origin and therefore remains available through SOCKS5 only.
Existing broker SDKs / SOCKS5
The original helper remains backwards compatible:
pip install 'servloci[socks]'
import servloci
servloci.configure(
api_key="dhan:1000000001",
api_secret="YOUR_SOCKS_PASSWORD",
)
# Import the broker SDK only after configure().
from dhanhq import dhanhq
Use the HTTP Client for the easiest setup. Use SOCKS5 when the broker's
official SDK must control the complete URL or its API origin is dynamic.
Security
- Treat
sl_live_...as a password; never commit or log it. - Access tokens are displayed once, stored server-side only as SHA-256 hashes, and can be rotated or revoked in the portal.
- Only broker-native paths beginning with
/are accepted by the SDK. - ServLoci restricts the application forwarder to documented order/trade paths.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file servloci-0.2.0.tar.gz.
File metadata
- Download URL: servloci-0.2.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
790baf397ae555583fd72ba1e7c503ac173bce82e4f4d3500e16e7a67fe56513
|
|
| MD5 |
a16270957bfe293cfeb3a6a71cec144d
|
|
| BLAKE2b-256 |
09624e5c1a3f21a53761a26addbb6f2820b3c5824585d7fec22de1e7d434777f
|
File details
Details for the file servloci-0.2.0-py3-none-any.whl.
File metadata
- Download URL: servloci-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c67c3dccb4fdaacdac429512a702dee6e1c25609871297da5cee444c56b9a69
|
|
| MD5 |
3df5f041509468ec9875b4c0b8a93b28
|
|
| BLAKE2b-256 |
7b11c83ed5cd4bce39ea14c2474a58b7c0a5ad7943d7c8a9a2136a3f6a4e29cf
|