PolyTest
v0.3.0Read historical Polymarket crypto Up/Down market data: prices, snapshots, and order books.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
polytest_list_markets List markets
Lists Up/Down markets of one market_type for one coin. Use it to find a market_id before reading snapshots or a price series. Returns market rows, newest first by start time, each with its window, opening and closing spot price, winner, volume, and status. Use status, not winner, to tell whether a market is still running. coin is btc, eth, or sol, and 4hr and 24hr markets exist for btc only. start_time and end_time filter on the market start time. PolyTest loads new markets in batches, and note says so when the newest market is hours old. Costs 1 API request. To continue, call again with offse…
| Parameter | Type | Description |
|---|---|---|
market_type * | string | Window length. One of 5m, 15m, 1hr, 4hr, 24hr. |
coin | string | Coin symbol in lowercase: btc, eth, or sol. 4hr and 24hr markets exist for btc only. |
end_time | string | ISO 8601. Keeps markets that start at or before this time. No zone means UTC. |
limit | integer | Rows per page. |
offset | integer | Rows to skip. Pass next_offset from the previous page. |
start_time | string | ISO 8601. Keeps markets that start at or after this time. No zone means UTC. |
polytest_get_market Get market
Returns one market by market_id or by slug. Pass exactly one of them. A slug is the last path segment of a Polymarket event URL, as in https://polymarket.com/event/<slug>, and the whole URL works too. Use it to resolve a Polymarket link or to read the full record of a market, including token ids and resolution fields. Costs 1 API request.
| Parameter | Type | Description |
|---|---|---|
market_id | string | PolyTest market id. Pass this or slug, not both. |
slug | string | A Polymarket event URL, or its last path segment. Pass this or market_id, not both. |
polytest_get_snapshots Get snapshots
Returns snapshots of one market, oldest first. Each row has time, spot_price, price_up, and price_down. Use it for tick detail in a short time range. For the shape of a whole market, use polytest_get_price_series. A market has about 8 snapshots per second, so narrow the range with start_time and end_time. With include_orderbook each row also has the Up and Down order books, cut to orderbook_depth levels per side, and a page holds at most 20 rows. The book at one moment is this tool with start_time set to that moment, limit 1, and include_orderbook true. Costs 1 API request. To continue, call a…
| Parameter | Type | Description |
|---|---|---|
market_id * | string | PolyTest market id from polytest_list_markets or polytest_get_market. |
end_time | string | ISO 8601. Keeps snapshots at or before this time. No zone means UTC. |
include_orderbook | boolean | Adds the Up and Down order books to each row. |
limit | integer | Rows per page. At most 20 with order books. |
offset | integer | Rows to skip. Pass next_offset from the previous page. |
orderbook_depth | integer | Price levels kept per side of each book. |
start_time | string | ISO 8601. Keeps snapshots at or after this time. No zone means UTC. |
polytest_get_limits Get plan limits
Returns the plan behind the current credential, an API key or a signed-in account: tier, rate limits, concurrency cap, data access, key cap, and trial budget. data_access gives how many of the most recent markets of each type the plan can read. A null cap means no cap. trial_budget is what a free trial may use in total over its 3 days. It applies only during a trial and does not show how much is left. Use it before a large read or after a plan or rate limit error. Costs 1 API request.
polytest_get_price_series Get price series
Returns evenly spaced price points across one market, oldest first. Use it to see the shape of a market without paging through snapshots. It splits the market window, or the part of it inside start_time and end_time, into samples equal buckets and returns the first snapshot of each bucket. Each point has time, spot_price, price_up, and price_down. empty_buckets counts the buckets with no snapshot, and note says where the data ends when the last buckets are empty. For a market still running, the range stops at the current time. Costs 1 + samples API requests, which is 21 with the default. The r…
| Parameter | Type | Description |
|---|---|---|
market_id * | string | PolyTest market id from polytest_list_markets or polytest_get_market. |
end_time | string | ISO 8601. End of the range. Defaults to the market end. No zone means UTC. |
samples | integer | Number of buckets. Each one costs 1 API request. |
start_time | string | ISO 8601. Start of the range. Defaults to the market start. No zone means UTC. |