OpenInterest Lens SDK
Real-time futures market structure API — OI + COT + term structure as developer-ready signals.
Install
pip install openinterest-lens
For WebSocket streaming support:
pip install openinterest-lens[ws]
Quick Start
from openinterest_lens import OpenInterestLensClient
client = OpenInterestLensClient(
api_key="oil_sk_live_your_key_here",
base_url="https://api.openinterestlens.com" # or http://localhost:8000 for local
)
# Get positioning signals for S&P 500 E-mini
signal = client.get_signals("ES")
print(f"Smart Money Direction: {signal.data.direction}")
print(f"Conviction: {signal.data.conviction}")
# Get term structure
ts = client.get_term_structure("ES")
# Get COT data
cot = client.get_cot("ES")
# List available contracts
contracts = client.get_contracts()
client.close()
Async Client
import asyncio
from openinterest_lens import AsyncOpenInterestLensClient
async def main():
async with AsyncOpenInterestLensClient(api_key="...") as client:
signal = await client.get_signals("ES")
print(signal.data.direction)
asyncio.run(main())
Builder Pattern
from openinterest_lens import ClientBuilder
client = (
ClientBuilder()
.base_url("https://api.openinterestlens.com")
.api_key("oil_sk_live_...")
.timeout(60)
.max_retries(5)
.build()
)
WebSocket Streaming
import asyncio
from openinterest_lens import AsyncSignalStream
async def stream():
stream = AsyncSignalStream(
api_key="oil_sk_live_...",
contracts=["ES", "NQ", "CL"],
)
async for event in stream:
print(f"{event['contract']}: {event['signal']['direction']}")
asyncio.run(stream())
API Endpoints
| Endpoint | Description |
|---|---|
GET /v1/contracts |
List available contracts |
GET /v1/signals/{symbol} |
Get positioning signals |
GET /v1/term-structure/{symbol} |
Get term structure curves |
GET /v1/roll-pressure/{symbol} |
Get roll pressure index |
GET /v1/cot/{symbol} |
Get COT report data |
GET /v1/health |
Health check |
GET /v1/quality |
Data quality metrics |
WS /ws/v1/signals |
Real-time signal streaming |
Tiers
| Feature | Free | Pro ($49/mo) | Enterprise |
|---|---|---|---|
| Requests/day | 100 | 10,000 | Unlimited |
| Contracts | 5 | All | All |
| Historical data | 30 days | 1 year | Full |
| WebSocket | ❌ | ✅ | ✅ |
| Support | Community | Slack |
License
MIT
Metadata
Release files for openinterest-lens 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openinterest_lens-0.1.0.tar.gz | 17.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openinterest_lens-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.4 kB
Release files / openinterest_lens-0.1.0.tar.gz
| Download URL | openinterest_lens-0.1.0.tar.gz |
|---|---|
| Size | 17.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ccfb600f943a40c6b1bc07027c291ab720da25441716e9b3b98b0171b0000c87
|
|
BLAKE2b-256 checksum How to use checksums |
cd3b61891b44ce58908a04f52860227f9ea2d519a48dc037e08c6ae2aadd5d68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / openinterest_lens-0.1.0-py3-none-any.whl
| Download URL | openinterest_lens-0.1.0-py3-none-any.whl |
|---|---|
| Size | 30.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ffc6ae54565894220e2e8563b85ff0403c7ca114ace852a6f80a3dc2bc3c083
|
|
BLAKE2b-256 checksum How to use checksums |
e20c8d6d1a74552dfce2b827fd392946cc13e7c205c38a4b005bccf3569a5af0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|