DEV Community

Cover image for How to Fetch Live Polymarket & Kalshi Prediction Market Odds in Python (Zero API Keys)
Khan
Khan

Posted on

How to Fetch Live Polymarket & Kalshi Prediction Market Odds in Python (Zero API Keys)

Tracking prediction markets across Polymarket and Kalshi usually means maintaining two different APIs, normalizing probability formats (0–1 vs cents/bid-ask strings), and manually matching identical questions across venues to spot price spreads.

Here is a clean, proxy-free way to pull normalized live odds, 24h volume, liquidity, and cross-venue spread hints from both exchanges in a single Python call.

1. Install the Client

pip install apify-client
export APIFY_TOKEN="your_apify_token"
Enter fullscreen mode Exit fullscreen mode

2. Fetch Normalized Polymarket & Kalshi Markets

This calls the Polymarket & Kalshi Prediction Markets Unified Scraper directly over HTTP APIs (no headless browser or proxies needed):

import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])

run = client.actor("api-market/prediction-markets-unified").call(
    run_input={
        "platforms": ["polymarket", "kalshi"],
        "minVolume24h": 1000,
        "maxMarketsPerPlatform": 50,
        "includeCrossMarketMatches": True,
    }
)

items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(f"Fetched {len(items)} normalized markets")

for m in items[:5]:
    print(m["platform"], "|", m["question"], "| YES:", m["impliedProbPct"], "%")
Enter fullscreen mode Exit fullscreen mode

3. Or Call It Synchronously via REST / cURL

If you don't want an SDK dependency (or want to plug it into n8n, Make, or an AI agent):

curl -sS -X POST \
  "https://api.apify.com/v2/acts/api-market~prediction-markets-unified/run-sync-get-dataset-items" \
  -H "Authorization: Bearer ${APIFY_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"platforms":["polymarket","kalshi"],"maxMarketsPerPlatform":20,"includeCrossMarketMatches":true}'
Enter fullscreen mode Exit fullscreen mode

Each returned item follows one flat schema (platform, question, yesPrice, noPrice, impliedProbPct, spreadBps, volume24h, liquidity, closeTime, and crossMarketMatch when a similar market exists on the other venue).


More Proxy-Free Data APIs & Examples

I've been building a collection of lightweight, API-first scrapers with Pay-Per-Event pricing and ready-to-run Python/Node/cURL examples in github.com/wOkk93/apify-data-actors:

Full catalog: apify.com/api-market — feedback and schema suggestions welcome!

Top comments (0)