polyoxide-gamma
Read-only Rust client for the Polymarket Gamma market data API. No authentication required.
Installation
[]
= "0.13"
Or use the unified polyoxide crate (includes Gamma by default):
[]
= "0.13"
Quick start
use Gamma;
async
Builder configuration
Gamma::builder() returns a GammaBuilder with sensible defaults. Every setting is optional:
use Gamma;
use RetryConfig;
let gamma = builder
.base_url // default
.timeout_ms // request timeout
.pool_size // HTTP connection pool
.max_concurrent // in-flight request cap (prevents Cloudflare 1015)
.with_retry_config
.build?;
Gamma::new() is shorthand for Gamma::builder().build().
API namespaces
All endpoints are read-only. Queries use a fluent builder pattern: chain filters, then call .send().await?.
Markets
// List with filters
let markets = gamma.markets.list
.open
.limit
.volume_num_min
.tag_id
.send.await?;
// Get by condition ID or slug
let market = gamma.markets.get.send.await?;
let market = gamma.markets.get_by_slug.include_tag.send.await?;
// Get tags for a market
let tags = gamma.markets.tags.send.await?;
ListMarkets supports: limit, offset, order, ascending, id, slug, clob_token_ids, condition_ids, market_maker_address, liquidity_num_min/max, volume_num_min/max, start_date_min/max, end_date_min/max, tag_id, related_tags, cyom, uma_resolution_status, game_id, sports_market_types, rewards_min_size, question_ids, include_tag, closed, open, archived.
Events
// List active events
let events = gamma.events.list
.active
.limit
.send.await?;
// Get by ID or slug
let event = gamma.events.get.include_chat.send.await?;
let event = gamma.events.get_by_slug.send.await?;
// Related events, tags, tweet count, comment count
let related = gamma.events.get_related_by_slug.send.await?;
let tags = gamma.events.tags.send.await?;
let tweets = gamma.events.tweet_count.send.await?;
let comments = gamma.events.comment_count.send.await?;
Series
let series_list = gamma.series.list
.closed
.categories_labels
.send.await?;
let series = gamma.series.get.include_chat.send.await?;
Tags
let tags = gamma.tags.list
.limit
.is_carousel
.send.await?;
let tag = gamma.tags.get.send.await?;
let tag = gamma.tags.get_by_slug.send.await?;
// Related tags with filters
let related = gamma.tags.get_related
.omit_empty
.status
.send.await?;
// Related tags with full event data
let detailed = gamma.tags.get_related_detailed.send.await?;
Comments
let comments = gamma.comments.list
.parent_entity_type
.parent_entity_id
.holders_only
.limit
.send.await?;
let comment = gamma.comments.get.send.await?;
let user_comments = gamma.comments.by_user.send.await?;
Sports
let sports = gamma.sports.list.send.await?;
let market_types = gamma.sports.market_types.send.await?;
let teams = gamma.sports.list_teams
.league
.limit
.send.await?;
Search
use SearchResponse;
let results: SearchResponse = gamma.search
.public_search
.search_profiles
.search_tags
.limit_per_type
.events_status
.send.await?;
// results.events, results.profiles, results.tags
User
use UserResponse;
let profile: UserResponse = gamma.user
.get
.send.await?;
Health
let latency = gamma.health.ping.await?;
println!;
Feature flags
| Flag | Effect |
|---|---|
specta |
Derives specta::Type on response types for TypeScript bindings |
License
Licensed under either of MIT or Apache-2.0 at your option.