Skip to main content
Get up and running with polymarket-data in minutes. This guide walks through installation, configuration, and your first live requests.
1

Install

The package ships as ESM with bundled TypeScript declarations.
2

Create a client

Optional configuration

OptionDescriptionDefault
dataEndpointBase URL for the classic data API.https://data-api.polymarket.com
gammaEndpointBase URL for the gamma API.https://gamma-api.polymarket.com
fetchCustom Fetch implementation (for SSR/tests).globalThis.fetch
Mocking in tests — pass a stubbed fetch that returns predefined payloads. All methods pipe through the injected fetch before validation.
3

Verify connectivity

If this call fails, verify network access and endpoint URLs. The SDK throws HttpError for API failures and Error("Network error: …") for connectivity issues.
4

Make your first requests

Use named imports for types:
5

Next steps

Data API

Explore positions, trades, activity, holders, and value endpoints.

Gamma API

Discover search, comments, series, markets, and events modules.