You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Official TypeScript SDK for the Polymarket US API.
Installation
npm install polymarket-us
Usage
Public Endpoints (No Authentication)
import{PolymarketUS}from'polymarket-us';constclient=newPolymarketUS();// Get events with paginationconstevents=awaitclient.events.list({limit: 10,offset: 0,active: true});constnextPage=awaitclient.events.list({limit: 10,offset: 10,active: true});// Get a specific eventconstevent=awaitclient.events.retrieve(123);consteventBySlug=awaitclient.events.retrieveBySlug('super-bowl-2025');// Get marketsconstmarkets=awaitclient.markets.list();constmarket=awaitclient.markets.retrieveBySlug('btc-100k');// Get order bookconstbook=awaitclient.markets.book('btc-100k');// Get best bid/offerconstbbo=awaitclient.markets.bbo('btc-100k');// Searchconstresults=awaitclient.search.query({query: 'bitcoin'});// Series and sportsconstseries=awaitclient.series.list();constsports=awaitclient.sports.list();
Authenticated Endpoints (Trading)
import{PolymarketUS}from'polymarket-us';constclient=newPolymarketUS({keyId: process.env.POLYMARKET_KEY_ID,secretKey: process.env.POLYMARKET_SECRET_KEY,});// Create an orderconstorder=awaitclient.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 ordersconstopenOrders=awaitclient.orders.list();// Cancel an orderawaitclient.orders.cancel(order.id,{marketSlug: 'btc-100k-2025'});// Cancel all ordersawaitclient.orders.cancelAll();// Get positionsconstpositions=awaitclient.portfolio.positions();// Get activity historyconstactivities=awaitclient.portfolio.activities();// Get account balancesconstbalances=awaitclient.account.balances();
Authentication
Polymarket US uses Ed25519 signature authentication. Generate API keys at polymarket.us/developer.
The SDK automatically signs requests with your credentials: