@polyman/gamma
v0.1.0
Published
Polymarket Gamma API client — market discovery, events, categories, and resolution data
Readme
@polyman/gamma
Polymarket Gamma API client — market discovery, events, categories, and resolution data.
Base URL:
https://gamma-api.polymarket.com
Installation
npm install @polyman/gammaUsage
import { GammaClient } from '@polyman/gamma';
const client = new GammaClient();
// List active markets
const markets = await client.getMarkets({ limit: 20, active: true });
// Find a market by slug
const market = await client.getMarketBySlug('will-bitcoin-reach-100k-by-2025');
console.log(market?.clobTokenIds); // use with CLOB API for prices
// Filter by category
const politics = await client.getMarkets({ category: 'Politics', limit: 10 });
// List events
const events = await client.getEvents({ limit: 5, active: true });
const event = await client.getEventBySlug('us-election-2024');API Reference
GammaClient
| Method | Description |
|---|---|
| getMarkets(params?) | List markets with optional filters |
| getMarketBySlug(slug) | Fetch a single market by slug |
| getMarketByConditionId(id) | Fetch a market by condition ID |
| getEvents(params?) | List events with optional filters |
| getEventBySlug(slug) | Fetch a single event by slug |
GetMarketsParams
| Field | Type | Description |
|---|---|---|
| slug | string | Filter by market slug |
| active | boolean | Filter by active status |
| closed | boolean | Filter by closed status |
| category | string | Filter by category |
| limit | number | Max results |
| offset | number | Pagination offset |
License
ISC
