Python client for the OddsPipe prediction market API
Project description
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["title"], item["spread"]["yes_diff"])
# 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"}
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
oddspipe-0.1.0.tar.gz
(4.1 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
File details
Details for the file oddspipe-0.1.0.tar.gz.
File metadata
- Download URL: oddspipe-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a58eac9e1c8e0c9426d4cbf42a6dcefc191ae08ea1df062cac1c698c026b38ba
|
|
| MD5 |
88862fa314bb01fa940e27eee5cf7cb2
|
|
| BLAKE2b-256 |
57fda0b800c490dadc665b1e78515bed2eb572ec9f38d9b64237d830ba921eab
|
File details
Details for the file oddspipe-0.1.0-py3-none-any.whl.
File metadata
- Download URL: oddspipe-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
035081129c402ff72e2bcaa18c80e3b6771ec3d86cc0d899b77710bd6db55eca
|
|
| MD5 |
1593c4fbb5a04cdacd18ee9750baaf10
|
|
| BLAKE2b-256 |
49c67c5a56feab85ee8fa6c7aba1db2c35393a56dcef8c22b0c05ab6be0ee3d6
|