Skip to main content

Unified data API for Kalshi and Polymarket. Core schema + clean SDk.

Project description

A Unified SDK for Prediction Markets

predmarket is an asyncio-native python-based SDK that communicates directly with prediction markets (Kalshi and Polymarket).

Both Kalshi and Polymarket provide public-facing APIs with high rate limits. predmarket aims to unify these two APIs into one install, one format, and one library to learn. It aims to be abstract enough to be intuitive, but not lose any power of the individual APIs. So, any parameter in one of polymarket's API endpoints can be used as-is in predmarket.

Install

uv add predmarket

Basic Usage

from predmarket import PredMarket
from httpx import AsyncClient

async def main()
    async with AsyncClient() as client:

        # Initialize fetchers
        kalshi = PredMarket(client, exchange="kalshi")
        polymarket = PredMarket(client, exchange="polymarket")

        # Fetch available Questions (e.g. "When will Elon Musk get to Mars?", events in native APIs)
        kalshi_questions = await kalshi.fetch_questions()
        polymarket_questions = await polymarket.fetch_questions(limit=10, asc=True) # Polymarket-specific query params

        # Fetch available Contracts  (e.g. "Will Elon Musk get to Mars before 2026?", these are individual "solutions" for a given question , Markets in native APIs)
        kalshi_contracts = await kalshi.fetch_contracts()
        polymarket_contracts = await polymarket.fetch_contracts() # Polymarket-specific query params

More Information

predmarket is under rapid development. Expect breaking changes unless indiciated otherwise.

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

predmarket-0.0.1.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.

predmarket-0.0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file predmarket-0.0.1.tar.gz.

File metadata

  • Download URL: predmarket-0.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.19

File hashes

Hashes for predmarket-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4db02b9ab4b17aa98a48e562015af7ed03410a3c9ffe186b0493337fa5207c57
MD5 1e76fb384ba9852cecbf7a8428538ee4
BLAKE2b-256 481ca2832e20382fdef61995096d9b58c76f2cfbe3c956e62478ebc2b8b60f2f

See more details on using hashes here.

File details

Details for the file predmarket-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for predmarket-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5bc519dc4502daff8b58c6fa9e68f77bba666bbe6e21ab4b7c3fb2d9415849a6
MD5 a4bc1494123faf500d8935ab36a050df
BLAKE2b-256 817ffc2a28c02eefb60f8bec100102a4030f3b0d165bc9a05c8cb367fdb0f92f

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