Dome - Prediction Markets API
Setup
Read your credentials from ~/.gooseworks/credentials.json:
export GOOSEWORKS_API_KEY=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json'))['api_key'])")
export GOOSEWORKS_API_BASE=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json')).get('api_base','https://api.gooseworks.ai'))")
If ~/.gooseworks/credentials.json does not exist, tell the user to run: npx gooseworks login
All endpoints use Bearer auth: -H "Authorization: Bearer $GOOSEWORKS_API_KEY"
Access data from Polymarket and Kalshi prediction markets.
Capabilities
- Orderbook History: Fetches historical orderbook snapshots for a specific Kalshi market (ticker) over a specified time range
- Market Price: Fetches the current market price for a market by token_id
- Market Price: Fetches the current market price for a Kalshi market by market_ticker
- Trade History: Fetches historical trade data for Kalshi markets with optional filtering by ticker and time range
- Sport by Date: Find equivalent markets across different prediction market platforms (Polymarket, Kalshi, etc
- Sports: Find equivalent markets across different prediction market platforms (Polymarket, Kalshi, etc
- Positions: Fetches all Polymarket positions for a proxy wallet address
- Binance Prices: Fetches historical crypto price data from Binance
- Activity: Fetches activity data for a specific user with optional filtering by market, condition, and time range
- Markets: Find markets on Polymarket using various filters including the ability to search
- Orderbook History: Fetches historical orderbook snapshots for a specific asset (token ID) over a specified time range
- Wallet: Fetches wallet information by providing either an EOA (Externally Owned Account) address or a proxy wallet address
- Candlesticks: Fetches historical candlestick data for a market identified by condition_id, over a specified interval
- Chainlink Prices: Fetches historical crypto price data from Chainlink
- Wallet Profit-and-Loss: Fetches the realized profit and loss (PnL) for a specific wallet address over a specified time range and granularity
- Trade History: Fetches historical trade data with optional filtering by market, condition, token, time range, and user’s wallet address
- Markets: Find markets on Kalshi using various filters including market ticker, event ticker, status, and volume
Usage
Orderbook History
Fetches historical orderbook snapshots for a specific Kalshi market (ticker) over a specified time range. If no start_time and end_time are provided, returns the latest orderbook snapshot for the market.
Parameters:
- ticker* (string) - The Kalshi market ticker
- start_time (integer) - Start time in Unix timestamp (milliseconds). Optional - if not provided along with end_time, returns the latest orderbook snapshot.
- end_time (integer) - End time in Unix timestamp (milliseconds). Optional - if not provided along with start_time, returns the latest orderbook snapshot.
- limit (integer) - Maximum number of snapshots to return (default: 100, max: 200). Ignored when fetching the latest orderbook without start_time and end_time.
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"dome","path":"/kalshi/orderbooks","query":{"ticker":"{ticker}"}}'
Market Price
Fetches the current market price for a market by token_id. Allows historical lookups via the at_time query parameter.
Parameters:
- at_time (integer) - Optional Unix timestamp (in seconds) to fetch a historical market price. If not provided, returns the most real-time price available.
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"dome","path":"/polymarket/market-price/{token_id}"}'
Market Price
Fetches the current market price for a Kalshi market by market_ticker. Returns prices for both yes and no sides. Allows historical lookups via the at_time query parameter.
Parameters:
- at_time (integer) - Optional Unix timestamp (in seconds) to fetch a historical market price. If not provided, returns the most real-time price available.
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"dome","path":"/kalshi/market-price/{market_ticker}"}'
Trade History
Fetches historical trade data for Kalshi markets with optional filtering by ticker and time range. Returns executed trades with pricing, volume, and taker side information. All timestamps are in seconds.
Parameters:
- ticker (string) - The Kalshi market ticker to filter trades
- start_time (integer) - Start time in Unix timestamp (seconds)
- end_time (integer) - End time in Unix timestamp (seconds)
- limit (integer) - Maximum number of trades to return (default: 100)
- offset (integer) - Number of trades to skip for pagination
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"dome","path":"/kalshi/trades","query":{"ticker":"{ticker}"}}'
Sport by Date
Find equivalent markets across different prediction market platforms (Polymarket, Kalshi, etc.) for sports events by sport and date.
Parameters:
- date* (string) - The date to find matching markets for in YYYY-MM-DD format
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"dome","path":"/matching-markets/sports/nba","query":{"date":"2024-03-01"}}'
Sports
Find equivalent markets across different prediction market platforms (Polymarket, Kalshi, etc.) for sports events using a Polymarket market slug or a Kalshi event ticker.
Parameters:
- polymarket_market_slug (string[]) - The Polymarket market slug(s) to find matching markets for. To get multiple markets at once, provide the query param multiple times with different slugs. Can not be combined with kalshi_event_ticker.
- kalshi_event_ticker (string[]) - The Kalshi event ticker(s) to find matching markets for. To get multiple markets at once, provide the query param multiple times with different tickers. Can not be combined with polymarket_market_slug.
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"dome","path":"/matching-markets/sports"}'
Positions
Fetches all Polymarket positions for a proxy wallet address. Returns positions with balance >= 10,000 shares (0.01 normalized) with market info.
Parameters:
- limit (integer) - Maximum number of positions to return per page. Defaults to 100, maximum 100.
- pagination_key (string) - Pagination key returned from previous request to fetch next page of results
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"dome","path":"/polymarket/positions/wallet/{wallet_address}"}'
Binance Prices
Fetches historical crypto price data from Binance. Returns price data for a specific currency pair over an optional time range. When no time range is provided, returns the most recent price. All timestamps are in Unix milliseconds.
Parameters:
- currency* (string) - The currency pair symbol. Must be lowercase alphanumeric with no separators (e.g., btcusdt, ethusdt, solusdt, xrpusdt).
- start_time (integer) - Start time in Unix timestamp (milliseconds). If not provided along with end_time, returns t