- Added new documentation URLs from llms.txt index - Updated TARGET.md with 244 total documentation pages - Scraped new pages for trading, concepts, and API reference sections - Updated changelog and new index pages
16 KiB
Documentation Index
Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt Use this file to discover all available pages before exploring further.
Public Methods
These methods can be called without a signer or user credentials. Use these for reading market data, prices, and order books.
Client Initialization
Public methods require the client to initialize with the host URL and Polygon chain ID.
```typescript theme={null} import { ClobClient } from "@polymarket/clob-client";const client = new ClobClient(
"https://clob.polymarket.com",
137
);
// Ready to call public methods
const markets = await client.getMarkets();
```
```python theme={null}
from py_clob_client.client import ClobClient
client = ClobClient(
host="https://clob.polymarket.com",
chain_id=137
)
# Ready to call public methods
markets = client.get_markets()
```
Health Check
getOk()
Health check endpoint to verify the CLOB service is operational.
async getOk(): Promise<any>
Markets
getMarket()
Get details for a single market by condition ID.
async getMarket(conditionId: string): Promise<Market>
getMarkets()
Get details for multiple markets paginated.
async getMarkets(): Promise<PaginationPayload>
getSimplifiedMarkets()
Get simplified market data paginated for faster loading.
async getSimplifiedMarkets(): Promise<PaginationPayload>
getSamplingMarkets()
Get markets eligible for sampling/liquidity rewards.
async getSamplingMarkets(): Promise<PaginationPayload>
getSamplingSimplifiedMarkets()
Get simplified market data for markets eligible for sampling/liquidity rewards.
async getSamplingSimplifiedMarkets(): Promise<PaginationPayload>
Order Books and Prices
calculateMarketPrice()
Calculate the estimated price for a market order of a given size.
async calculateMarketPrice(
tokenID: string,
side: Side,
amount: number,
orderType: OrderType = OrderType.FOK
): Promise<number>
getOrderBook()
Get the order book for a specific token ID.
async getOrderBook(tokenID: string): Promise<OrderBookSummary>
getOrderBooks()
Get order books for multiple token IDs.
async getOrderBooks(params: BookParams[]): Promise<OrderBookSummary[]>
getPrice()
Get the current best price for buying or selling a token ID.
async getPrice(
tokenID: string,
side: "BUY" | "SELL"
): Promise<any>
getPrices()
Get the current best prices for multiple token IDs.
async getPrices(params: BookParams[]): Promise<PricesResponse>
getMidpoint()
Get the midpoint price (average of best bid and best ask) for a token ID.
async getMidpoint(tokenID: string): Promise<any>
getMidpoints()
Get the midpoint prices for multiple token IDs.
async getMidpoints(params: BookParams[]): Promise<any>
getSpread()
Get the spread (difference between best ask and best bid) for a token ID.
async getSpread(tokenID: string): Promise<SpreadResponse>
getSpreads()
Get the spreads for multiple token IDs.
async getSpreads(params: BookParams[]): Promise<SpreadsResponse>
getPricesHistory()
Get historical price data for a token.
async getPricesHistory(params: PriceHistoryFilterParams): Promise<MarketPrice[]>
Trades
getLastTradePrice()
Get the price of the most recent trade for a token.
async getLastTradePrice(tokenID: string): Promise<LastTradePrice>
getLastTradesPrices()
Get the most recent trade prices for multiple tokens.
async getLastTradesPrices(params: BookParams[]): Promise<LastTradePriceWithToken[]>
getMarketTradesEvents()
Get recent trade events for a market.
async getMarketTradesEvents(conditionID: string): Promise<MarketTradeEvent[]>
Market Parameters
getFeeRateBps()
Get the fee rate in basis points for a token.
async getFeeRateBps(tokenID: string): Promise<number>
getTickSize()
Get the tick size (minimum price increment) for a market.
async getTickSize(tokenID: string): Promise<TickSize>
getNegRisk()
Check if a market uses negative risk (binary complementary tokens).
async getNegRisk(tokenID: string): Promise<boolean>
Time & Server Info
getServerTime()
Get the current server timestamp.
async getServerTime(): Promise<number>