OddsPipe Python SDK
Python client for the OddsPipe prediction market API.
Install
pip install oddspipe
Quick start
from oddspipe import OddsPipe
client = OddsPipe(api_key="your-api-key")
# List top markets by volume
markets = client.markets(limit=10)
for m in markets["items"]:
print(m["title"], m["spread"])
# Search for a market
results = client.search("Trump", platform="polymarket")
# Get OHLCV candlesticks
candles = client.candlesticks(market_id=123, interval="1h", limit=100)
for c in candles["candles"]:
print(c["timestamp"], c["close"], c["volume"])
# Find cross-platform price divergences
spreads = client.spreads(min_spread=0.03)
for item in spreads["items"]:
print(item["polymarket"]["title"], item["spread"]["yes_diff"])
# Most-traded matched pairs first (default sort="spread": largest divergence first)
liquid = client.spreads(sort="volume", min_score=95, limit=5)
# Cross-platform spread for a single market
spread = client.spread(market_id=123)
print(spread["sources"])
print(spread["spread"])
API reference
| Method | Endpoint | Description |
|---|---|---|
markets() |
GET /v1/markets |
List markets with latest prices |
market(id) |
GET /v1/markets/{id} |
Single market detail |
search(q) |
GET /v1/markets/search |
Full-text search |
history(id) |
GET /v1/markets/{id}/history |
Raw price snapshots |
candlesticks(id) |
GET /v1/markets/{id}/candlesticks |
OHLCV candles (1m/5m/1h/1d) |
spread(id) |
GET /v1/markets/{id}/spread |
Cross-platform spread |
spreads() |
GET /v1/spreads |
Cross-platform price spreads |
Error handling
from oddspipe import OddsPipe, OddsPipeError
client = OddsPipe(api_key="your-key")
try:
client.market(999999)
except OddsPipeError as e:
print(e.status_code) # 404
print(e.body) # {"detail": "Market not found"}
Release files for oddspipe 0.3.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 | |
|---|---|---|---|
| oddspipe-0.3.0.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oddspipe-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.9 kB
Release files / oddspipe-0.3.0.tar.gz
| Download URL | oddspipe-0.3.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50955eb9a8d1aa5badb553ee6e6348054c14466d72f80594c5df00463c08ec47
|
|
BLAKE2b-256 checksum How to use checksums |
16934a309e27a110b78a56efebeb1aab4f18dc77f3410e7bab057ff062393094
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / oddspipe-0.3.0-py3-none-any.whl
| Download URL | oddspipe-0.3.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86f31db4cefdfc1c353300963103102017087e4c521633ffb16055c5ab85e9f4
|
|
BLAKE2b-256 checksum How to use checksums |
ed86c848eb8d635645954f0c08345db2169a1b4e5d455f0d296b66525b175a41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|