Skip to main content
The Pear API maps equivalent and similar events across Kalshi and Polymarket, letting you compare pricing, volume, and liquidity side by side. With 4,391 mapped comparisons, you can systematically identify discrepancies between platforms.

What is a comparison?

A comparison (also called an event mapping) connects an event on Kalshi to the corresponding event on Polymarket. Each comparison includes metadata about the relationship quality and a human-readable explanation of why the events were matched.
{
  "id": 1042,
  "polymarket_id": "0xbtc100k",
  "kalshi_id": "BTC-100K-2025",
  "polymarket_title": "Bitcoin to $100K in 2025?",
  "kalshi_title": "Will Bitcoin reach $100K in 2025?",
  "relationship_type": "exact_match",
  "confidence": "high",
  "reasoning": "Both markets resolve on the same condition: Bitcoin reaching $100,000 at any point in 2025.",
  "bucket": "crypto",
  "subtag": "bitcoin"
}

Relationship types

The relationship_type field describes how closely two events correspond:
TypeDescriptionUse case
exact_matchThe events resolve on the same condition with the same criteria. Pricing differences represent genuine discrepancies.Arbitrage analysis, direct price comparison
similarThe events cover the same topic but may differ in resolution criteria, timeframes, or exact wording.Sentiment analysis, market research
Always check the relationship_type before comparing prices. Two similar events may have legitimately different prices due to different resolution criteria.

Confidence levels

The confidence field indicates how certain the mapping is:
LevelDescription
highVery confident the events are correctly matched. Resolution criteria have been verified.
mediumLikely a correct match, but there may be subtle differences in wording or resolution rules.
lowPossible match that requires manual review. The events appear related but may have important differences.
For reliable cross-platform analysis, filter for high confidence:
curl "http://localhost:8000/api/comparisons?confidence=high&relationship_type=exact_match&limit=20" \
  -H "Authorization: Bearer mk_live_..."

Buckets and subtags

Comparisons are organized with bucket and subtag fields for topical grouping:
  • bucket: Broad topic area (e.g., crypto, politics, sports, economics)
  • subtag: More specific sub-category (e.g., bitcoin, presidential, nfl, fed)
# All crypto comparisons
curl "http://localhost:8000/api/comparisons?bucket=crypto&limit=20" \
  -H "Authorization: Bearer mk_live_..."

# Narrow to bitcoin specifically
curl "http://localhost:8000/api/comparisons?bucket=crypto&limit=20" \
  -H "Authorization: Bearer mk_live_..."

Getting comparison details with market data

The /api/comparisons/{id} endpoint returns the comparison along with actual market data from both venues, making it easy to see side-by-side pricing:
curl "http://localhost:8000/api/comparisons/1042" \
  -H "Authorization: Bearer mk_live_..."
Response:
{
  "id": 1042,
  "polymarket_id": "0xbtc100k",
  "kalshi_id": "BTC-100K-2025",
  "polymarket_title": "Bitcoin to $100K in 2025?",
  "kalshi_title": "Will Bitcoin reach $100K in 2025?",
  "relationship_type": "exact_match",
  "confidence": "high",
  "reasoning": "Both markets resolve on the same condition.",
  "bucket": "crypto",
  "subtag": "bitcoin",
  "kalshi_markets": [
    {
      "venue": "kalshi",
      "venue_market_id": "BTC-100K-2025-YES",
      "title": "Bitcoin $100K - Yes",
      "mid_price": 0.42,
      "best_bid": 0.41,
      "best_ask": 0.43,
      "spread": 0.02,
      "volume": 1200000,
      "volume_24h": 89000
    }
  ],
  "polymarket_markets": [
    {
      "venue": "polymarket",
      "venue_market_id": "0xbtc100k-yes",
      "title": "Bitcoin to $100K in 2025?",
      "mid_price": 0.44,
      "best_bid": 0.43,
      "best_ask": 0.45,
      "spread": 0.02,
      "volume": 2340000,
      "volume_24h": 156000
    }
  ]
}

Finding price discrepancies

Here is a practical example that scans comparisons for pricing differences:
import requests

headers = {"Authorization": "Bearer mk_live_..."}
cursor = None
discrepancies = []

while True:
    params = {
        "confidence": "high",
        "relationship_type": "exact_match",
        "limit": 100
    }
    if cursor:
        params["cursor"] = cursor

    response = requests.get(
        "http://localhost:8000/api/comparisons",
        params=params,
        headers=headers
    )
    page = response.json()

    for comp in page["data"]:
        # Fetch full comparison with market data
        detail = requests.get(
            f"http://localhost:8000/api/comparisons/{comp['id']}",
            headers=headers
        ).json()

        kalshi_prices = [m["mid_price"] for m in detail.get("kalshi_markets", []) if m.get("mid_price")]
        poly_prices = [m["mid_price"] for m in detail.get("polymarket_markets", []) if m.get("mid_price")]

        if kalshi_prices and poly_prices:
            diff = abs(kalshi_prices[0] - poly_prices[0])
            if diff >= 0.03:  # 3 cent threshold
                discrepancies.append({
                    "title": comp["kalshi_title"],
                    "kalshi_price": kalshi_prices[0],
                    "poly_price": poly_prices[0],
                    "diff": diff
                })

    if not page["has_more"]:
        break
    cursor = page["next_cursor"]

# Print results sorted by largest discrepancy
for d in sorted(discrepancies, key=lambda x: x["diff"], reverse=True):
    print(f"{d['title']}: Kalshi={d['kalshi_price']:.2f}, "
          f"Poly={d['poly_price']:.2f}, Diff={d['diff']:.2f}")
For high-frequency monitoring, consider caching comparison IDs and only fetching detailed market data for comparisons you are actively tracking.