Skip to content

Developer guide

Polymarket API Guide

If you build dashboards, research tools or data pipelines, the Polymarket APIs are the foundation. This guide covers the three API surfaces, working code and the scaling mistakes to avoid.

Every plan includes an Agent API Key. No credit card. No deposit. No crypto wallet.

One request, one market
$ curl -s "https://gamma-api.polymarket.com/markets?limit=1"
[{
  "id": "512340",
  "question": "Fed decision in December?",
  "outcomes": "[\"Yes\", \"No\"]",
  "outcomePrices": "[\"0.61\", \"0.39\"]",
  "active": true,
  "closed": false
}]

Example values, trimmed to six fields. A market has about 90. Note that outcomes and outcomePrices arrive as JSON strings, so parse them a second time.

Polymarket API overview

Most teams interact with three data surfaces:

  • CLOB API: real-time order book and price data.
  • Gamma API: market metadata, event context, and discovery.
  • Data API: historical fills, activity snapshots, and analytics-friendly records.

Production systems typically combine all three: Gamma for universe selection, CLOB for live state, and historical endpoints for analytics and research.

Common use cases

  • Fetching live prices and implied probabilities per outcome.
  • Pulling trade history for research and backtests.
  • Tracking liquidity and order-book depth.
  • Building scanners for newly active markets.
  • Feeding market data into your own models.

Code examples

Start with a market list request, then layer in order-book and trade endpoints.

cURL example

curl -s "https://gamma-api.polymarket.com/markets?limit=5" \
  -H "accept: application/json"

JavaScript / TypeScript example

type Market = { id: string; question: string; active: boolean };

async function fetchMarkets(limit = 10): Promise<Market[]> {
  const response = await fetch(
    `https://gamma-api.polymarket.com/markets?limit=${limit}`,
    { next: { revalidate: 60 } },
  );

  if (!response.ok) {
    throw new Error(`Failed to fetch markets: ${response.status}`);
  }

  return (await response.json()) as Market[];
}

Architecture best practices

  • Keep ingestion and downstream jobs as separate services to reduce blast radius during outages.
  • Normalize payloads into stable internal models so API shape changes do not break downstream logic.
  • Store checkpoint cursors for incremental sync jobs instead of repeatedly full-refreshing large datasets.
  • Add latency and error telemetry on every endpoint to detect degradation before users do.

Rate limits and reliability guidance

  • Use caching and incremental revalidation on read-heavy pages.
  • Batch requests where possible instead of polling one endpoint at a time.
  • Handle retries with exponential backoff on 429 and 5xx responses.
  • Validate payloads before storing data to protect downstream jobs.
  • Run periodic audits of stale markets so analytics stay aligned with active products.

How PolyTrackers adds value

Raw API data is powerful, but noisy. PolyTrackers adds unusual-activity flags, public wallet records and paper trading on top, so your team can focus on the product and not on data plumbing.

Need endpoints tailored for product workflows? Review the docs:

PolyTrackers API docs

Frequently asked questions

What API should I start with for Polymarket market discovery?

Start with the Gamma API for market metadata and discovery. It gives you event context and market IDs, which you can then combine with CLOB and trade-history endpoints.

How often should I refresh Polymarket API data?

For dashboard experiences, 15 to 60 second refresh windows usually balance freshness and rate limits. For time-sensitive workflows, subscribe to faster sources and cache aggressively.

Do I need to build a full ingestion pipeline myself?

Not always. If your team mainly needs cleaned market and wallet data, a platform like PolyTrackers can reduce maintenance by handling ingestion, normalization, and anomaly detection.

Related guides

Skip repetitive API work

PolyTrackers handles ingestion and normalization. Every plan includes an Agent API Key, and an AI agent can place paper trades through MCP.

  • No credit card
  • No deposit
  • No crypto wallet
Create a free account