
Polymarket publishes public APIs specifically to support programmatic trading and third-party tools. If you can write code, you can build against them — bots, alert systems, dashboards, analytics.
This guide covers what the APIs do, how the pieces fit together, and — the part most tutorials skip — an honest accounting of what building and running a bot actually costs.
The two APIs you'll use
Polymarket's surface splits into two roles.
The Gamma API — market metadata
This is the read-only discovery layer. Use it to find markets, read their metadata, and fetch resolution details:
- Listing active markets and their questions
- Slugs, token IDs, and category tags
- Resolution criteria and settlement source
- End dates and market status
If you're building an alert tool, a dashboard, or a market scanner, Gamma may be all you need. It requires no authentication for public data.
The CLOB API — the order book and trading
CLOB stands for Central Limit Order Book, and this is where trading happens:
- Live order book depth for each outcome token
- Current best bid and ask
- Order placement, cancellation, and status
- Your positions and balances
Anything that places a trade goes through here, and this is the part that needs authentication.
How authentication works
This trips up most first-time builders, so it's worth understanding the model before you write code.
Polymarket uses a two-level authentication scheme:
Level 1 — your wallet signature. You prove you control a wallet by signing a message with its private key. This is used to derive or create your API credentials.
Level 2 — API credentials. The derived credentials (key, secret, passphrase) sign subsequent requests using HMAC. Day-to-day trading uses these rather than repeatedly signing with your wallet key.
Orders themselves are signed with your wallet key and submitted to the CLOB, where they're matched and settled on-chain.
The practical implication: your bot needs access to a private key to sign orders. There's no scoped, trade-only API key like a centralised exchange offers. That's a meaningful security consideration, and it's why the ecosystem around Polymarket has attracted key-stealing malware. Use a dedicated wallet funded only with your trading capital — we cover this properly in our guide to bot security.
A gotcha worth knowing about
Polymarket supports several wallet types, identified by a signature type: EOA (a plain wallet), proxy wallets from older Magic-link signups, Gnosis Safe, and the newer deposit-wallet contracts.
If your account was created recently, you likely have a deposit wallet, where the address holding funds is a contract owned by your EOA rather than the EOA itself. Some client libraries assume the signing address and the funding address are the same, which causes orders to be rejected with signer/API-key mismatch errors.
If you hit that wall: check which wallet type your account uses, and confirm your client library supports it. This is one of the most common reasons a technically correct bot still can't place an order.
Order types and mechanics
Limit orders rest on the book at your price. Good for patient entries; the risk is never filling.
Market-style orders cross the spread and fill immediately at the best available price. On short-duration markets where the window closes in minutes, aggressive pricing is usually the right call — an unfilled order at a great price is worth nothing.
Order sizing and tick size. Each market has a minimum tick and minimum size. Orders that don't conform get rejected. Read these from the market metadata rather than hardcoding assumptions.
Partial fills. A large order may fill in chunks against multiple resting orders. Your bot must handle this — checking whether the full size filled, and deciding whether to cancel and re-place the remainder or accept the partial. Getting this wrong is a classic source of duplicate positions.
Rate limits and reliability
Public endpoints and trading endpoints have separate limits. Build with that in mind:
Cache market metadata. Slugs and token IDs don't change during a market's life. Fetch once, reuse.
Don't poll aggressively for prices. Use websockets where available rather than hammering REST endpoints.
Handle failures as normal, not exceptional. Network calls fail. Implement retries with backoff, and make your order logic idempotent so a retry doesn't create a duplicate position.
Watch reconnection carefully. A websocket that silently drops and reconnects can leave your bot trading on stale data. Heartbeat and validate.
What building actually costs
Here's the honest accounting most tutorials omit.
Development time. A working bot — not a demo script, but something with proper error handling, order lifecycle management, reconnection logic and position tracking — is realistically several weeks for a competent developer. The demo takes an afternoon. The reliable version doesn't.
Hosting. A VPS runs $20–100+/month, indefinitely. For latency-sensitive strategies you'll want it geographically close to the infrastructure, which costs more.
Maintenance. APIs evolve. Libraries break. Your bot fails at 4am and you discover it at 9am, having missed a session or — worse — having placed orders on stale data.
Monitoring. You need alerting for silent failures. A bot that dies quietly is worse than one that crashes loudly, because you'll keep believing it's working.
Strategy development. This is the real cost, and it's the one nobody's tutorial addresses — because they don't have a profitable strategy either. Building the execution layer is engineering; finding an edge is research, and it's far harder.
Build or buy?
Build if: you enjoy the engineering, you have a strategy you believe in, and you want full control. The APIs are well-documented and the ecosystem is mature enough that you won't be alone.
Buy if: you want to trade rather than maintain infrastructure. Compare honestly — a $20–50/month VPS plus weeks of development plus ongoing maintenance is a real cost against a one-time or subscription service.
The maths worth doing: if a service costs $80 once, that's roughly two months of VPS hosting — before you've written a line of code or developed a single strategy. That comparison doesn't always favour buying, but it's rarely as close as builders assume when they start.
What to build if you're building
Some genuinely useful projects, roughly by difficulty:
Market scanner (easy). Poll Gamma for active markets matching your criteria, alert when odds cross a threshold. No auth needed, no funds at risk.
Odds tracker (easy). Record order book snapshots over time. Surprisingly useful — most strategy research needs historical odds data, and it isn't readily available.
Alert bot (moderate). Combine market data with signals from elsewhere (a spot exchange feed, for instance) and push notifications to Telegram or Discord.
Paper-trading engine (moderate). Run your strategy against live data without placing real orders. Do this before risking money — it catches the bugs that backtests hide.
Full execution bot (hard). Order placement, fill verification, position tracking, risk limits, error recovery. Don't start here.
The backtesting trap
If you build a bot, you'll build a backtest. Two mistakes make almost any strategy look profitable:
Look-ahead bias. Using information that wasn't available at the moment of the simulated entry — a candle close that hadn't closed yet, or a price from later in the window. This inflates results dramatically and silently.
Fixed entry pricing. Assuming you always fill at $0.50 manufactures a clean 2× return on every win. Real entries vary with how far the market has already moved, and that variation is where profitability actually lives.
If your backtest shows a 75% win rate and live results come in near 55%, one of these is usually why.
Frequently asked questions
Is using the Polymarket API allowed? Yes — the APIs are published specifically to support programmatic trading and third-party tools. Your eligibility to use the platform depends on your jurisdiction.
Do I need a VPS? Only for self-hosting. For latency-sensitive arbitrage, proximity matters a lot. For signal-based directional strategies on 5–15 minute windows, considerably less — a reliable connection matters more than raw microseconds.
What language should I use? Python has the most community examples and client libraries. Node works well. Rust or Go if latency genuinely matters to your strategy — but confirm it does before optimising for it.
Can I use the API without giving up my private key? Not for trading. Order signing requires the key. You can build read-only tools — scanners, dashboards, alerts — with no key at all, and that's a genuinely safer place to start.
Why do my orders get rejected? Common causes: tick size or minimum size violations, insufficient balance or allowance, an expired market, or a wallet-type mismatch between your signing address and funding address. The error message usually distinguishes them.
The bottom line
Polymarket's APIs are open, documented, and genuinely usable. If you want to build, you can — and starting with read-only tools like scanners and odds trackers is a low-risk way to learn the surface.
Just cost it honestly. The execution layer is a few weeks of engineering plus ongoing hosting and maintenance. The strategy is the hard part, and no API gives you that.
Don't want to build it? Metazen Pulse runs 12 tested strategies on Polymarket's 5M and 15M Bitcoin markets — one-time $80, non-custodial, with risk controls you configure. Watch every non-premium signal live and free on our Telegram channel.
Related: Prediction market bots: a complete guide · Is it safe to give a Polymarket bot your private key?
Trading prediction markets involves real risk of loss. Past performance does not guarantee future results. Nothing here is financial advice.
See the strategies before you trust anything
Every non-premium signal is published live and free on our Telegram channel — follow the calls in real time and check them against actual market outcomes.