getPolymarketPriceHistory()
Read outcome price history for a chart.
Unsigned read directly from Polymarket CLOB using an outcome token ID. Uncached, no automatic retries. Returns data, source, fetchedAt and stale. Display data does not authorize trading. See the guide for units and errors.
market-discovery workflow · All SDK methods
Import and runtime
@crisp-trade/partner-sdk/discovery — public Polymarket reads from your backend; no CRISP credentials or signing.
Client setup and shared behavior
Arguments
| Argument | Presence | Released TypeScript type |
|---|---|---|
query | Required | |
options | Optional | |
Named types are expanded under “Exact released types” below. Parameters are in call order; optional does not imply nullable.
Example
Public display read. Replace example slugs or search text with your selected discovery inputs.
import { getPolymarketPriceHistory } from '@crisp-trade/partner-sdk/discovery';
const result = await getPolymarketPriceHistory({
tokenId: '123',
interval: '1d',
fidelity: 5,
});
console.log(result.data.history);Returns
The exact return type is shown below; this helper does not use the ordinary HTTP response wrapper.
Return type
Promise<DiscoveryResult<{
history: Array<{
timestamp: number;
price: number;
}>;
}>>Errors and lifecycle
Discovery errors, cache and cancellation. Public reads use PolymarketDiscoveryError, not CrispApiError. No order is submitted.
Related HTTP operations
Direct Polymarket sources. These reads are not CRISP HMAC operations.
Exact released types
Extracted from the shipped SDK 0.13.0, not separately maintained signatures.
Full signature
getPolymarketPriceHistory(query: PolymarketPriceHistoryQuery, options?: DiscoveryRequest): Promise<DiscoveryResult<{
history: Array<{
timestamp: number;
price: number;
}>;
}>>PolymarketPriceHistoryQuery
export interface PolymarketPriceHistoryQuery {
/** Outcome token ID, not the Gamma market ID or condition ID. */
tokenId: string;
interval?: "max" | "all" | "1m" | "1w" | "1d" | "6h" | "1h";
/** Unix seconds. Supply both bounds instead of interval. */
startTs?: number;
endTs?: number;
/** Sampling resolution in minutes. */
fidelity?: number;
}DiscoveryRequest
export interface DiscoveryRequest {
signal?: AbortSignal;
}DiscoveryResult
export interface DiscoveryResult<T> {
data: T;
source: string;
fetchedAt: string;
stale: boolean;
}