Skip to main content

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


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.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oddspipe-0.2.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file oddspipe-0.2.0.tar.gz.

File metadata

  • Download URL: oddspipe-0.2.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

Hashes for oddspipe-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6a9771091e8551c237ec8b9603cf409486f679b3aa5b0a7e3d3c8d2f123e2814
MD5 56caee43d6a268ca78f4ac0a17486bc1
BLAKE2b-256 623c6bc318f07e7a0ae16c77bc50b12284e4a7ef15cf17792ade02332d1b1d9c

See more details on using hashes here.

File details

Details for the file oddspipe-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: oddspipe-0.2.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

Hashes for oddspipe-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb65d3a6d50a1c9daa37f3d674bfe8a414236da13da6d7d4e03c4117227f0e3e
MD5 32ffc8b71acc2ea7e5b7d9c326a6e869
BLAKE2b-256 7782c1cf91b78d4e60af40d7e6cba1d4efc25382215e94523fa6299ad808908c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page