Skip to main content

Polymarket CLOB Client

Build powerful prediction market applications with the official TypeScript client for Polymarket’s Central Limit Order Book API

Quick start

Get up and running with Polymarket CLOB Client in minutes

1

Install the package

Install the CLOB client using your preferred package manager:
npm install @polymarket/clob-client
2

Initialize the client

Create a new client instance with your signer and credentials:
import { ClobClient } from "@polymarket/clob-client";
import { Wallet } from "@ethersproject/wallet";

const host = "https://clob.polymarket.com";
const signer = new Wallet("your-private-key");
const creds = await new ClobClient(host, 137, signer).createOrDeriveApiKey();

const client = new ClobClient(host, 137, signer, creds);
3

Place your first order

Create and post an order to the CLOB:
import { Side, OrderType } from "@polymarket/clob-client";

const order = await client.createAndPostOrder(
  {
    tokenID: "your-token-id",
    price: 0.65,
    side: Side.BUY,
    size: 100
  },
  { tickSize: "0.01", negRisk: false },
  OrderType.GTC
);

console.log("Order created:", order);
Get market information including token IDs and tick sizes from the Gamma Markets API.

Explore by topic

Learn about the key features and capabilities of the CLOB client

Authentication

Learn about API key management and authentication methods

Orders

Understand order types, lifecycle, and management

Markets

Explore market data, pricing, and order book access

RFQ Trading

Trade using the Request for Quote system

Error Handling

Handle errors and API responses effectively

Market Data

Access real-time market data and historical prices

Features

Everything you need to build on Polymarket

Complete TypeScript Support

Fully typed interfaces with IntelliSense support for a superior development experience

Multiple Order Types

Support for GTC, FOK, GTD, and FAK orders with flexible execution options

Secure Authentication

EIP-712 signature verification and API key management for secure trading

Real-Time Market Data

Access order books, trades, pricing, and market events in real-time

Ready to get started?

Follow our quickstart guide to create your first order in minutes, or dive into the API reference to explore all available features.