# Polymarket Markets API > Public Polymarket markets, events, and recent trades from official Gamma and Data API v2 endpoints. Each paid operation uses a fixed USDC price on Base with the x402 exact scheme. Unpaid GET, HEAD, and POST return 402 payment terms (POST validates the body only after payment terms are satisfied). A request that carries payment-signature is not yet charged: settlement happens only after a successful (2xx) result that returns real data (status complete or partial). HTTP 4xx/5xx and coverage status failed or empty payloads are not charged. Settled 2xx responses include a payment-response header; uncharged responses do not. Follow https://www.brainiac.software/agent-instructions.txt for install, payment pins, idempotency, and billing rules. - Product: https://www.brainiac.software/api/polymarket - Docs: https://www.brainiac.software/api/polymarket/docs - OpenAPI: https://www.brainiac.software/api/polymarket/openapi.json - Contact: support@brainiac.software (https://www.brainiac.software/contact) ## Operations ### POST /api/v1/polymarket/markets $0.008 USDC. List Polymarket markets from the public Gamma API. Keywords: polymarket, prediction market, odds, prediction markets, market prices, outcome prices, bid ask, condition id, volume, liquidity, Gamma API Inputs: query?, slug?, conditionId?, closed?, limit?, offset?, order?, ascending? Docs: https://www.brainiac.software/api/polymarket/markets Example request: ```json { "limit": 5, "closed": false } ``` Example response: ```json { "status": "complete", "data": { "retrievedAt": "2026-11-20T21:36:00.000Z", "limit": 20, "offset": 0, "markets": [ { "id": "559651", "question": "Xi Jinping out before 2027?", "slug": "xi-jinping-out-before-2027", "conditionId": "0xa467b14d51f01b957109d9cbb1d6c124fab2a089d52ed8f471d23c2812e743b7", "outcomes": [ "Yes", "No" ], "outcomePrices": [ "0.0175", "0.9825" ], "bestBid": 0.017, "bestAsk": 0.018, "lastTradePrice": 0.015, "spread": 0.001, "volume": "17392796.370488998", "liquidity": "299906.07864", "endDate": "2027-01-01T04:59:00Z", "active": true, "closed": false } ], "unavailable": [] }, "nextCursor": null, "progress": { "processed": 0, "total": null, "unit": "items", "scannedRange": null }, "sources": [ { "source": "upstream", "url": "https://gamma-api.polymarket.com/markets", "retrievedAt": "2026-11-20T21:36:00.000Z" } ], "missing_items": [], "limitations": [] } ``` ### POST /api/v1/polymarket/events $0.008 USDC. List Polymarket events and nested markets from the public Gamma Events API. Keywords: polymarket, prediction market, events, odds, event markets, outcome prices, volume, slug, Gamma API Inputs: query?, slug?, eventId?, closed?, active?, limit?, offset? Docs: https://www.brainiac.software/api/polymarket/events Example request: ```json { "limit": 5, "closed": false } ``` Example response: ```json { "status": "complete", "data": { "retrievedAt": "2026-11-20T21:36:00.000Z", "limit": 20, "offset": 0, "events": [ { "id": "12345", "title": "Example event", "slug": "example-event", "endDate": "2026-12-31T00:00:00Z", "volume": "1000000", "liquidity": "50000", "active": true, "closed": false, "markets": [ { "id": "559651", "question": "Example market?", "slug": "example-market", "conditionId": "0xa467b14d51f01b957109d9cbb1d6c124fab2a089d52ed8f471d23c2812e743b7", "outcomes": [ "Yes", "No" ], "outcomePrices": [ "0.42", "0.58" ], "volume": "100000", "endDate": "2026-12-31T00:00:00Z" } ] } ], "unavailable": [] }, "nextCursor": null, "progress": { "processed": 0, "total": null, "unit": "items", "scannedRange": null }, "sources": [ { "source": "upstream", "url": "https://gamma-api.polymarket.com/events", "retrievedAt": "2026-11-20T21:36:00.000Z" } ], "missing_items": [], "limitations": [] } ``` ### POST /api/v1/polymarket/trades $0.008 USDC. Recent Polymarket trades from the public Data API v2 trade feed (not v1, not authenticated CLOB). Keywords: polymarket, prediction market, trades, recent trades, trade feed, last price, condition id, event id, Data API, market activity Inputs: conditionId?, eventId?, user?, limit?, cursor? Docs: https://www.brainiac.software/api/polymarket/trades Example request: ```json { "limit": 20 } ``` Example response: ```json { "status": "complete", "data": { "retrievedAt": "2026-11-20T21:36:00.000Z", "trades": [ { "proxyWallet": "0x81d529f0a6b2cfb3e64dedd1cb171350dd38c38e", "side": "SELL", "tokenId": "72131623180530088702232590799201462172787760651892934121714422597098986683477", "conditionId": "0xe1f1fb6e070d5196ef36e38bba8f8ab4c50b2ce989f332065bdb8654af9ea837", "size": 0.01, "price": 0.88, "timestamp": 1795210636, "title": "Bitcoin Up or Down - November 20, 4:35PM-4:40PM ET", "slug": "btc-updown-5m-1795210500", "outcome": "Up", "outcomeIndex": 0, "transactionHash": "0x1387942877a3c7ca9281c120eb79397b8146e82a255845979a9e4d1cf6792a7a" } ], "pagination": { "limit": 20, "hasMore": true, "nextCursor": "cursor-example" }, "unavailable": [] }, "nextCursor": null, "progress": { "processed": 0, "total": null, "unit": "items", "scannedRange": null }, "sources": [ { "source": "upstream", "url": "https://data-api.polymarket.com/v2/trades", "retrievedAt": "2026-11-20T21:36:00.000Z" } ], "missing_items": [], "limitations": [] } ``` ### POST /api/v1/polymarket/leaderboard $0.0085 USDC. Official Polymarket Data API v2 leaderboard of wallets by PnL and volume, with optional timeframe. Keywords: polymarket, leaderboard, pnl, volume, prediction market, Data API v2 Inputs: timeframe?, category?, limit?, cursor? Docs: https://www.brainiac.software/api/polymarket/leaderboard Example request: ```json { "timeframe": "day", "limit": 10 } ``` Example response: ```json { "status": "complete", "data": { "timeframe": "day", "leaders": [ { "rank": 1, "userId": "0x2c335066fe58fe9237c3d3dc7b275c2a034a0563", "userName": "demo", "pnl": "595456.2685383962", "volume": "3870941.3891580007", "verified": false } ], "pagination": { "limit": 10, "hasMore": true }, "sourceUrl": "https://data-api.polymarket.com/v2/leaderboard", "asOf": "2026-11-20T23:20:00.000Z" }, "nextCursor": null, "progress": { "processed": 0, "total": null, "unit": "items", "scannedRange": null }, "sources": [], "missing_items": [], "limitations": [] } ``` ### POST /api/v1/polymarket/price-history $0.0085 USDC. Official Polymarket CLOB historical prices for a market token from the public prices-history API. Keywords: polymarket, price history, odds, CLOB, token id, prediction market Inputs: tokenId?, conditionId?, outcome?, interval?, fidelity? Docs: https://www.brainiac.software/api/polymarket/price-history Example request: ```json { "tokenId": "32338220190071351435772801779725302244575775216413325951443816017994629993401", "interval": "1d" } ``` Example response: ```json { "status": "complete", "data": { "tokenId": "32338220190071351435772801779725302244575775216413325951443816017994629993401", "interval": "1d", "history": [ { "time": "2026-11-19T12:00:00.000Z", "price": "0.0145" }, { "time": "2026-11-20T12:00:00.000Z", "price": "0.0175" } ], "sourceUrl": "https://clob.polymarket.com/prices-history", "asOf": "2026-11-20T23:20:00.000Z" }, "nextCursor": null, "progress": { "processed": 0, "total": null, "unit": "items", "scannedRange": null }, "sources": [], "missing_items": [], "limitations": [] } ``` ### POST /api/v1/polymarket/order-book $0.0085 USDC. Official Polymarket CLOB order book for a market token: bids and asks with price and size. Keywords: polymarket, order book, bids, asks, CLOB, depth Inputs: tokenId?, conditionId?, outcome?, depth? Docs: https://www.brainiac.software/api/polymarket/order-book Example request: ```json { "tokenId": "32338220190071351435772801779725302244575775216413325951443816017994629993401", "depth": 10 } ``` Example response: ```json { "status": "complete", "tokenId": "32338220190071351435772801779725302244575775216413325951443816017994629993401", "bids": [ { "price": "0.017", "size": "10507.64" } ], "asks": [ { "price": "0.018", "size": "7893.67" } ], "truncated": true, "source": "Polymarket CLOB", "sourceUrl": "https://clob.polymarket.com/book", "asOf": "2026-11-20T23:20:00.000Z", "missing_items": [] } ```