polymarket-sdk
v1.0.2
Published
A TypeScript SDK for interacting with the Polymarket API.
Readme
Polymarket SDK
A TypeScript SDK for interacting with the Polymarket API.
Installation
npm install polymarket-sdkUsage
List Markets
Fetch markets from Polymarket with various filters.
import { listMarkets } from 'polymarket-sdk';
async function main() {
try {
// Fetch top 5 markets by 24h volume
const markets = await listMarkets({
limit: 5,
ascending: false,
order: 'volume24hr'
});
markets.forEach((market) => {
console.log(`${market.question} (ID: ${market.id})`);
console.log(`Volume 24h: ${market.volume24hr}`);
});
} catch (error) {
console.error('Error fetching markets:', error);
}
}
main();