Python SDK for SmaugLabs historical Polymarket data API
Project description
SmaugLabs Python SDK
Typed Python client for the SmaugLabs historical Polymarket data API.
Install
pip install smauglabs
Quick Start
from smauglabs import SmaugLabs
client = SmaugLabs(api_key="sl_live_...")
# discover markets
events = client.list_events(limit=5)
results = client.search_markets("Trump", limit=3)
trending = client.trending_markets()
# historical orderbook
chart = client.sovereign_chart("TOKEN_ID", granularity="5m")
snap = client.orderbook_snapshot("TOKEN_ID")
spread = client.spread_history("TOKEN_ID", granularity="1h", limit=50)
# crypto reference prices
btc = client.crypto_klines("BTC", interval="1h", limit=200)
eth = client.crypto_chart("ETH", interval=300, limit=100)
# event correlation
tl = client.event_timeline("EVENT_ID", interval_minutes=5)
news = client.event_news("EVENT_ID")
# trader activity
lb = client.leaderboard(limit=10)
signals = client.latest_signals()
profile = client.trader_profile("0xABC...")
# bulk export for backtesting
data = client.export_klines("BTC", interval="1h", limit=50000)
client.close()
Context Manager
with SmaugLabs(api_key="sl_live_...") as client:
events = client.list_events()
Custom Base URL
client = SmaugLabs(api_key="...", base_url="http://localhost:8000")
API Reference
Full endpoint docs at api.smauglabs.com/docs.
| Group | Methods |
|---|---|
| Market Discovery | search_markets · list_events · get_event · trending_markets · market_categories |
| Historical Orderbook | orderbook_snapshot · orderbook_history · orderbook_depth · spread_history · sovereign_chart · list_tokens · data_coverage · cross_market_correlation · query |
| Crypto Reference | crypto_history · crypto_chart · crypto_klines · crypto_ticks · crypto_tick_ohlcv · crypto_depth · btc_price |
| Event Correlation | event_timeline · event_news · event_metadata |
| Trader Activity | leaderboard · latest_signals · list_traders · trader_profile · trader_signals · trader_trades · trader_pnl |
| Data Export | export_orderbook · export_klines · export_catalog · list_parquet_files |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
smauglabs-0.6.0.tar.gz
(8.8 kB
view details)
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
smauglabs-0.6.0-py3-none-any.whl
(10.3 kB
view details)
File details
Details for the file smauglabs-0.6.0.tar.gz.
File metadata
- Download URL: smauglabs-0.6.0.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79cdb1c2fd3e56b01319031fb779a7ea220a673301fd0123bbf68ff01a79b962
|
|
| MD5 |
acfb0fadc3f445c8469cfb0bc6e92a81
|
|
| BLAKE2b-256 |
edaed9a9d295c90e05f70aa76b6f7630ebe21df1b6bfce70eb71e057cf3838d0
|
File details
Details for the file smauglabs-0.6.0-py3-none-any.whl.
File metadata
- Download URL: smauglabs-0.6.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1d05060f516c071f168efb1f77ba281424a8a537e41709cba2a207427e8d58e
|
|
| MD5 |
a81ba6771a539fb39b295713f970fb16
|
|
| BLAKE2b-256 |
bae98e8fa13ba2dde60483d7476403c645550f8ef6d6c92f72afda429694a495
|