Forkast Developer Docs
...
Market
Get Token Prices
2 min
fetches token price info for a market and side import { forkastsdk, network } from "@forkastgg/client"; const sdk = new forkastsdk(network mainnet, "your api key"); const marketservice = sdk getmarketservice(); // default side = 0 (buy) const pricesbuy = await marketservice gettokenprices(123); // explicit side = 1 (sell) const pricessell = await marketservice gettokenprices(123, 1); parameters field type required description marketid number yes market identifier side number no trade side (0 = buy, 1 = sell) default value is 0 token prices represent the current quoted pricing for outcome tokens in a given market, returned for the requested side (0 = buy, 1 = sell) use this to display live pricing, build trading uis, or compute expected costs before placing orders