Official TypeScript SDK for the Polymarket US API.
Installation
npminstall polymarket-us
Usage
Public Endpoints (No Authentication)
import{ PolymarketUS }from'polymarket-us';const client =newPolymarketUS();// Get events with paginationconst events =await client.events.list({ limit:10, offset:0, active:true});const nextPage =await client.events.list({ limit:10, offset:10, active:true});// Get a specific eventconst event =await client.events.retrieve(123);const eventBySlug =await client.events.retrieveBySlug('super-bowl-2025');// Get marketsconst markets =await client.markets.list();const market =await client.markets.retrieveBySlug('btc-100k');// Get order bookconst book =await client.markets.book('btc-100k');// Get best bid/offerconst bbo =await client.markets.bbo('btc-100k');// Searchconst results =await client.search.query({ query:'bitcoin'});// Series and sportsconst series =await client.series.list();const sports =await client.sports.list();
Authenticated Endpoints (Trading)
import{ PolymarketUS }from'polymarket-us';const client =newPolymarketUS({
keyId: process.env.POLYMARKET_KEY_ID,
secretKey: process.env.POLYMARKET_SECRET_KEY,});// Create an orderconst order =await client.orders.create({
marketSlug:'btc-100k-2025',
intent:'ORDER_INTENT_BUY_LONG',
type:'ORDER_TYPE_LIMIT',
price:{ value:'0.55', currency:'USD'},
quantity:100,
tif:'TIME_IN_FORCE_GOOD_TILL_CANCEL',});// Get open ordersconst openOrders =await client.orders.list();// Cancel an orderawait client.orders.cancel(order.id,{ marketSlug:'btc-100k-2025'});// Cancel all ordersawait client.orders.cancelAll();// Get positionsconst positions =await client.portfolio.positions();// Get activity historyconst activities =await client.portfolio.activities();// Get account balancesconst balances =await client.account.balances();
Authentication
Polymarket US uses Ed25519 signature authentication. Generate API keys at polymarket.us/developer.
The SDK automatically signs requests with your credentials: