PAPI
API Reference

Markets

Market data endpoints for Polymarket and Kalshi

Market Data Endpoints

Retrieve market data from Polymarket and Kalshi. All responses use unified types with consistent JSON shapes across exchanges. Market data is cached with short TTLs (5-60 seconds).

All endpoints in this section require the read scope.


Polymarket

List Markets

GET /polymarket/markets
ParameterTypeDescription
limitintegerNumber of results to return
searchstringSearch by title
pagination_keystringCursor for pagination
statusstringFilter by status: open, closed
tagsstringFilter by tags
curl -s "https://papi.tylerthebuildor.com/polymarket/markets?limit=2&status=open" \
  -H "Authorization: Bearer papi_sk_live_..."

The response is a raw JSON array of Market objects, not wrapped in an object.

[
  {
    "market_id": "0x1234abcd...",
    "event_id": "evt_001",
    "title": "Will Bitcoin exceed $100k?",
    "description": "This market resolves Yes if Bitcoin...",
    "slug": "will-bitcoin-exceed-100k",
    "outcomes": [
      {
        "outcome_id": "71234567890",
        "label": "Yes",
        "price": "0.72",
        "price_change_24h": "0.05"
      },
      {
        "outcome_id": "71234567891",
        "label": "No",
        "price": "0.28",
        "price_change_24h": "-0.05"
      }
    ],
    "resolution_date": "2026-12-31T23:59:59Z",
    "volume_24h": "150000.00",
    "volume_total": "1250000.00",
    "liquidity": "50000.00",
    "open_interest": null,
    "url": "https://polymarket.com/event/will-bitcoin-exceed-100k",
    "image": "https://...",
    "status": "open",
    "category": "Crypto",
    "tags": [],
    "tick_size": "0.01",
    "exchange": "Polymarket"
  }
]

Get Market

GET /polymarket/markets/{id}

Returns a single Market object by ID.

curl -s "https://papi.tylerthebuildor.com/polymarket/markets/0x1234abcd..." \
  -H "Authorization: Bearer papi_sk_live_..."

List Events

GET /polymarket/events

Events group related markets together.

ParameterTypeDescription
limitintegerNumber of results to return
searchstringSearch by title
pagination_keystringCursor for pagination
curl -s "https://papi.tylerthebuildor.com/polymarket/events?limit=1" \
  -H "Authorization: Bearer papi_sk_live_..."
[
  {
    "id": "evt_001",
    "title": "Bitcoin Price Milestones",
    "description": "Markets tracking Bitcoin price targets",
    "slug": "bitcoin-price-milestones",
    "markets": [
      {
        "market_id": "0x1234abcd...",
        "event_id": "evt_001",
        "title": "Will Bitcoin exceed $100k?",
        "description": "...",
        "slug": "will-bitcoin-exceed-100k",
        "outcomes": [
          { "outcome_id": "71234567890", "label": "Yes", "price": "0.72", "price_change_24h": "0.05" },
          { "outcome_id": "71234567891", "label": "No", "price": "0.28", "price_change_24h": "-0.05" }
        ],
        "resolution_date": "2026-12-31T23:59:59Z",
        "volume_24h": "150000.00",
        "volume_total": "1250000.00",
        "liquidity": "50000.00",
        "open_interest": null,
        "url": "https://polymarket.com/event/will-bitcoin-exceed-100k",
        "image": "https://...",
        "status": "open",
        "category": "Crypto",
        "tags": [],
        "tick_size": "0.01",
        "exchange": "Polymarket"
      }
    ],
    "volume_24h": "150000.00",
    "url": "https://polymarket.com/event/bitcoin-price-milestones",
    "image": "https://...",
    "exchange": "Polymarket"
  }
]

Get Order Book

GET /polymarket/orderbooks
ParameterTypeRequiredDescription
token_idstringYesThe outcome token ID
curl -s "https://papi.tylerthebuildor.com/polymarket/orderbooks?token_id=71234567890" \
  -H "Authorization: Bearer papi_sk_live_..."
{
  "bids": [
    { "price": "0.70", "size": "500.00" },
    { "price": "0.69", "size": "1200.00" }
  ],
  "asks": [
    { "price": "0.72", "size": "300.00" },
    { "price": "0.73", "size": "800.00" }
  ],
  "timestamp": "2026-03-18T12:00:00Z"
}

Get Trades

GET /polymarket/trades
ParameterTypeRequiredDescription
token_idstringYesThe outcome token ID
limitintegerNoNumber of results
start_timestringNoISO 8601 start time filter
end_timestringNoISO 8601 end time filter
curl -s "https://papi.tylerthebuildor.com/polymarket/trades?token_id=71234567890&limit=2" \
  -H "Authorization: Bearer papi_sk_live_..."
[
  {
    "id": "trade_001",
    "timestamp": "2026-03-18T11:55:00Z",
    "price": "0.72",
    "amount": "50.00",
    "side": "buy"
  },
  {
    "id": "trade_002",
    "timestamp": "2026-03-18T11:50:00Z",
    "price": "0.71",
    "amount": "100.00",
    "side": "sell"
  }
]

Get Candlesticks (OHLCV)

GET /polymarket/candlesticks
ParameterTypeRequiredDescription
condition_idstringYesThe market condition ID
intervalstringYesCandle interval (e.g., 1m, 5m, 1h, 1d)
start_timestringNoISO 8601 start time
end_timestringNoISO 8601 end time
curl -s "https://papi.tylerthebuildor.com/polymarket/candlesticks?condition_id=0xabc...&interval=1h" \
  -H "Authorization: Bearer papi_sk_live_..."
[
  {
    "timestamp": "2026-03-18T12:00:00Z",
    "open": "0.70",
    "high": "0.73",
    "low": "0.69",
    "close": "0.72",
    "volume": "5000.00"
  },
  {
    "timestamp": "2026-03-18T11:00:00Z",
    "open": "0.68",
    "high": "0.71",
    "low": "0.67",
    "close": "0.70",
    "volume": "3200.00"
  }
]

Get Wallet Info

GET /polymarket/wallet
ParameterTypeRequiredDescription
addressstringYesWallet address
curl -s "https://papi.tylerthebuildor.com/polymarket/wallet?address=0x742d35Cc..." \
  -H "Authorization: Bearer papi_sk_live_..."

Get Wallet PnL

GET /polymarket/wallet/pnl/{address}
ParameterTypeRequiredDescription
granularitystringNoTime granularity: day, week, month, year, all
curl -s "https://papi.tylerthebuildor.com/polymarket/wallet/pnl/0x742d35Cc...?granularity=month" \
  -H "Authorization: Bearer papi_sk_live_..."

Kalshi

List Markets

GET /kalshi/markets
ParameterTypeDescription
limitintegerNumber of results to return
searchstringSearch by title
pagination_keystringCursor for pagination
statusstringFilter by status: open, closed, settled
curl -s "https://papi.tylerthebuildor.com/kalshi/markets?status=open&limit=2" \
  -H "Authorization: Bearer papi_sk_live_..."

Response uses the same Market schema:

[
  {
    "market_id": "KXBTC-26DEC31-T100000",
    "event_id": "KXBTC-26DEC31",
    "title": "Bitcoin above $100,000 on December 31?",
    "description": "...",
    "slug": "bitcoin-above-100000-december-31",
    "outcomes": [
      {
        "outcome_id": "yes",
        "label": "Yes",
        "price": "0.62",
        "price_change_24h": "0.03"
      },
      {
        "outcome_id": "no",
        "label": "No",
        "price": "0.38",
        "price_change_24h": "-0.03"
      }
    ],
    "resolution_date": "2026-12-31T23:59:59Z",
    "volume_24h": "8500.00",
    "volume_total": "154200.00",
    "liquidity": null,
    "open_interest": "8350.00",
    "url": "https://kalshi.com/markets/KXBTC-26DEC31-T100000",
    "image": null,
    "status": "open",
    "category": "Crypto",
    "tags": [],
    "tick_size": "0.01",
    "exchange": "Kalshi"
  }
]

Kalshi prices are automatically converted from cents to decimals. A Kalshi price of 62 cents becomes "0.62" in the response.

Get Market

GET /kalshi/markets/{ticker}
curl -s "https://papi.tylerthebuildor.com/kalshi/markets/KXBTC-26DEC31-T100000" \
  -H "Authorization: Bearer papi_sk_live_..."

Returns a single Market object.

List Events

GET /kalshi/events
ParameterTypeDescription
limitintegerNumber of results to return
searchstringSearch by title
curl -s "https://papi.tylerthebuildor.com/kalshi/events?limit=1" \
  -H "Authorization: Bearer papi_sk_live_..."

Returns an array of Event objects with the same schema as Polymarket events, but with "exchange": "Kalshi".

Get Order Book

GET /kalshi/orderbooks
ParameterTypeRequiredDescription
tickerstringYesThe market ticker
curl -s "https://papi.tylerthebuildor.com/kalshi/orderbooks?ticker=KXBTC-26DEC31-T100000" \
  -H "Authorization: Bearer papi_sk_live_..."
{
  "bids": [
    { "price": "0.61", "size": "200.00" },
    { "price": "0.60", "size": "500.00" }
  ],
  "asks": [
    { "price": "0.63", "size": "150.00" },
    { "price": "0.64", "size": "300.00" }
  ],
  "timestamp": "2026-03-18T12:00:00Z"
}

Get Trades

GET /kalshi/trades
ParameterTypeRequiredDescription
tickerstringYesThe market ticker
limitintegerNoNumber of results
start_timestringNoISO 8601 start time
end_timestringNoISO 8601 end time
curl -s "https://papi.tylerthebuildor.com/kalshi/trades?ticker=KXBTC-26DEC31-T100000&limit=2" \
  -H "Authorization: Bearer papi_sk_live_..."
[
  {
    "id": "trade_k001",
    "timestamp": "2026-03-18T11:55:00Z",
    "price": "0.62",
    "amount": "10.00",
    "side": "buy"
  }
]

Get Candlesticks (OHLCV)

GET /kalshi/candlesticks
ParameterTypeRequiredDescription
tickerstringYesThe market ticker
intervalstringYesCandle interval
start_timestringNoISO 8601 start time
end_timestringNoISO 8601 end time
curl -s "https://papi.tylerthebuildor.com/kalshi/candlesticks?ticker=KXBTC-26DEC31-T100000&interval=1h" \
  -H "Authorization: Bearer papi_sk_live_..."
[
  {
    "timestamp": "2026-03-18T12:00:00Z",
    "open": "0.60",
    "high": "0.63",
    "low": "0.59",
    "close": "0.62",
    "volume": "1500.00"
  }
]

Cross-Exchange

Matching Markets

GET /matching-markets

Find markets that exist on both Polymarket and Kalshi for the same underlying event.

ParameterTypeDescription
polymarket_market_slugstringFilter by Polymarket market slug
kalshi_event_tickerstringFilter by Kalshi event ticker
sportstringFilter by sport
datestringFilter by date
curl -s "https://papi.tylerthebuildor.com/matching-markets?sport=nba" \
  -H "Authorization: Bearer papi_sk_live_..."

Unified Type Reference

All market data endpoints return these types regardless of exchange.

Market

FieldTypeDescription
market_idstringExchange-specific market identifier
event_idstringParent event identifier
titlestringMarket question
descriptionstringFull description
slugstringURL-friendly identifier
outcomesarrayList of Outcome objects
resolution_datestringISO 8601 resolution date
volume_24hstring24-hour trading volume
volume_totalstringAll-time trading volume
liquiditystring | nullCurrent liquidity
open_intereststring | nullOpen interest
urlstringLink to market on exchange
imagestring | nullMarket image URL
statusstringopen, closed, or settled
categorystringMarket category
tagsarrayList of tag strings
tick_sizestringMinimum price increment
exchangestringPolymarket or Kalshi

Outcome

FieldTypeDescription
outcome_idstringOutcome token/contract ID
labelstringDisplay label (e.g., "Yes", "No")
pricestringCurrent price as decimal string
price_change_24hstring24-hour price change

OrderBook

FieldTypeDescription
bidsarrayList of { price, size } objects
asksarrayList of { price, size } objects
timestampstringISO 8601 timestamp

Trade

FieldTypeDescription
idstringTrade identifier
timestampstringISO 8601 timestamp
pricestringExecution price
amountstringTrade size
sidestringbuy or sell

PriceCandle

FieldTypeDescription
timestampstringISO 8601 candle open time
openstringOpening price
highstringHighest price
lowstringLowest price
closestringClosing price
volumestringVolume in the candle period

On this page