DEV Community

vesper_finch
vesper_finch

Posted on • Originally published at github.com

I Built a Free API That Scans 10,000+ Prediction Markets for Arbitrage

Prediction markets are booming. Polymarket alone handles billions in volume. But with 10,000+ active markets, finding mispricings by hand is impossible.

So I built an API that does it automatically.

The Problem

Prediction markets have a simple rule: for mutually exclusive outcomes, the probabilities should sum to 1.0 (or 100%). When they don't, someone is wrong — and you can profit from the difference.

But there are three types of mispricings hiding across thousands of markets:

  1. Exclusive outcome deviations — "Who will win?" markets where Yes prices sum to 1.47 instead of 1.0
  2. Ladder contradictions — "Will BTC hit $100K?" at 60% but "Will BTC hit $90K?" at 50% (logically impossible)
  3. Cross-market conflicts — Two related markets contradicting each other

The API

One endpoint. JSON response. No auth required for free tier.

curl https://polymarket-api.onrender.com/api/scan
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "scan_time": "2026-03-12T00:22:58Z",
  "events_scanned": 750,
  "markets_scanned": 11330,
  "opportunities_found": 110,
  "opportunities": [
    {
      "type": "exclusive_outcome",
      "description": "CS2 Match: Sum(Yes)=5.74, expected=1.0",
      "deviation_pct": 473.8,
      "estimated_profit_pct": 145.25,
      "min_liquidity_usd": 451.0,
      "strategy": "BUY_ALL_NO",
      "confidence": "high"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Filtering

# Only opportunities with >5% profit and >$1000 liquidity
curl "https://polymarket-api.onrender.com/api/scan?min_profit=5&min_liquidity=1000"
Enter fullscreen mode Exit fullscreen mode

Rate Limits

Free Pro ($29/mo)
Requests 3/day Unlimited
Results Top 10 All (50+)
Cache 5 min Real-time

How It Works

The scanner:

  1. Fetches all active events from Polymarket's public Gamma API (no auth needed)
  2. Parses ~11,000 markets across ~750 events
  3. Runs three detection algorithms (exclusive, ladder, cross-market)
  4. Ranks by estimated profit percentage
  5. Caches results for 5 minutes to be nice to the API

The entire scanner is open-source: github.com/vesper-astrena/polymarket-scanner-api

Built With

  • FastAPI — async Python web framework
  • Polymarket Gamma API — public, read-only market data
  • Render.com — free tier hosting

The whole thing is ~300 lines of API code + ~400 lines of scanner logic.

What I Learned

Most "arbitrage" opportunities in prediction markets aren't real arbitrage. Sports O/U markets and non-exclusive outcomes often look like mispricings but aren't. The scanner filters for truly exclusive outcomes and flags confidence levels accordingly.

The biggest genuine opportunities tend to be in esports and low-liquidity markets — exactly where you'd expect pricing to be least efficient.


Try it: curl https://polymarket-api.onrender.com/api/scan

Source: GitHub

Pro access: Gumroad

Top comments (0)