Documentation Index
Fetch the complete documentation index at: https://docs.context.markets/llms.txt
Use this file to discover all available pages before exploring further.
Quickstart
Get up and running with the Context SDK. This guide covers reading market data — no wallet required.
Prerequisites
Setup
mkdir context-quickstart && cd context-quickstart
npm init -y
npm install context-markets
Create a script file:
// index.ts
import { ContextClient } from "context-markets"
const ctx = new ContextClient()
1. List markets
const { markets } = await ctx.markets.list({ sortBy: "trending", limit: 5 })
for (const m of markets) {
console.log(`${m.question} (${m.id.slice(0, 10)}...)`)
}
2. Get quotes
const marketId = markets[0].id
const quotes = await ctx.markets.quotes(marketId)
if (quotes.yes.bid && quotes.yes.ask) {
console.log(`Yes: ${quotes.yes.bid}¢ bid / ${quotes.yes.ask}¢ ask`)
console.log(`Spread: ${quotes.spread}¢`)
}
3. Get the orderbook
const book = await ctx.markets.orderbook(marketId, { depth: 5 })
console.log("Bids:")
for (const bid of book.bids) {
console.log(` ${bid.price}¢ — ${bid.size} contracts`)
}
console.log("Asks:")
for (const ask of book.asks) {
console.log(` ${ask.price}¢ — ${ask.size} contracts`)
}
Run it
Next steps
Place your first order
Fund your account and submit a trade
Fetching market data
Quotes, orderbooks, and price history
SDK reference
Full SDK documentation
API reference
Raw endpoint documentation