Markets

A market is a single tradable YES/NO contract. Prices are quoted in dollars per contract from `0.01` to `0.99`; a winning contract settles at `1.00`. These endpoints expose market discovery plus public market data (order book, trades, price history).

List markets

Public
GET/api/markets

Returns markets with filtering and pagination. Two pagination modes are supported: pass `cursor` (or `event_ticker` / `series_ticker`) for cursor pagination, otherwise classic `page`-based pagination is used.

Query parameters

  • categorystringqueryoptional

    Filter by category slug.

  • searchstringqueryoptional

    Full-text search over market titles.

  • statusstringqueryoptional

    Filter by market status.

    ACTIVECLOSEDRESOLVEDSUSPENDEDDRAFT
  • event_tickerstringqueryoptional

    Only markets in this event (switches to cursor mode).

  • series_tickerstringqueryoptional

    Only markets in this series (switches to cursor mode).

  • limitintegerqueryoptionaldefault: 20

    Page size. Max 100.

  • cursorstringqueryoptional

    Opaque cursor (cursor mode).

  • pageintegerqueryoptionaldefault: 1

    1-based page number (page mode).

Request

cURL
curl "https://api.majjha.com/api/markets"

Response

200 OK
{
  "markets": [
    {
      "id": "mkt_btc5m_a1",
      "ticker": "BTC-5MIN-25JUN04T0900-Y",
      "eventTicker": "BTC-5MIN-25JUN04T0900",
      "title": "BTC above $68,500 at 09:05?",
      "description": "Resolves YES if BTC/USD is at or above the strike at 09:05 UTC.",
      "resolutionCriteria": "Coinbase BTC-USD spot at 09:05:00 UTC.",
      "categoryId": "cat_crypto",
      "status": "ACTIVE",
      "outcome": null,
      "closeDate": "2026-06-04T09:05:00Z",
      "lastYesPrice": "0.54",
      "lastNoPrice": "0.46",
      "volume": "12840.00",
      "liquidity": "3200.00",
      "marketType": "BINARY",
      "createdAt": "2026-06-04T09:00:00Z",
      "updatedAt": "2026-06-04T09:03:00Z"
    }
  ],
  "total": 142,
  "page": 1,
  "totalPages": 8
}
  • In cursor mode the response is `{ "cursor": string | null, "markets": [...] }` instead of the page envelope.

Get market

Public
GET/api/markets/{ticker}

Returns a single market by ticker (or internal id), including detail fields like category and trade counts.

Path parameters

  • tickerstringpathrequired

    Market ticker or internal id.

Request

cURL
curl "https://api.majjha.com/api/markets/{ticker}"

Response

200 OK
{
  "market": {
    "id": "mkt_btc5m_a1",
    "ticker": "BTC-5MIN-25JUN04T0900-Y",
    "eventTicker": "BTC-5MIN-25JUN04T0900",
    "title": "BTC above $68,500 at 09:05?",
    "description": "Resolves YES if BTC/USD is at or above the strike at 09:05 UTC.",
    "resolutionCriteria": "Coinbase BTC-USD spot at 09:05:00 UTC.",
    "categoryId": "cat_crypto",
    "category_name": "Crypto",
    "category_slug": "crypto",
    "status": "ACTIVE",
    "outcome": null,
    "closeDate": "2026-06-04T09:05:00Z",
    "lastYesPrice": "0.54",
    "lastNoPrice": "0.46",
    "volume": "12840.00",
    "liquidity": "3200.00",
    "marketType": "BINARY",
    "trade_count": 318,
    "position_count": 64,
    "createdAt": "2026-06-04T09:00:00Z",
    "updatedAt": "2026-06-04T09:03:00Z"
  }
}

Get market order book

Public
GET/api/markets/{ticker}/orderbook

Returns the current order book for a market: aggregated `bids` and `asks` levels plus convenience top-of-book fields. Prices and quantities are decimal strings.

Path parameters

  • tickerstringpathrequired

    Market ticker or internal id.

Request

cURL
curl "https://api.majjha.com/api/markets/{ticker}/orderbook"

Response

200 OK
{
  "orderbook": {
    "bids": [
      { "price": "0.53", "quantity": "120", "order_count": 3 },
      { "price": "0.52", "quantity": "340", "order_count": 7 }
    ],
    "asks": [
      { "price": "0.55", "quantity": "90", "order_count": 2 },
      { "price": "0.56", "quantity": "210", "order_count": 5 }
    ],
    "best_bid": "0.53",
    "best_ask": "0.55",
    "spread": "0.02",
    "mid_price": "0.54"
  }
}
  • The WebSocket `orderbook.<market_id>` channel pushes this exact `data` shape on every change — see the WebSocket guide.

Get market trades

Public
GET/api/markets/{ticker}/trades

Returns recent public trades (prints) for a single market, newest first.

Path parameters

  • tickerstringpathrequired

    Market ticker or internal id.

Query parameters

  • limitintegerqueryoptionaldefault: 50

    Max number of trades to return.

Request

cURL
curl "https://api.majjha.com/api/markets/{ticker}/trades"

Response

200 OK
{
  "trades": [
    {
      "id": "trd_9f2",
      "marketId": "mkt_btc5m_a1",
      "ticker": "BTC-5MIN-25JUN04T0900-Y",
      "side": "YES",
      "price": "0.54",
      "quantity": "25",
      "createdAt": "2026-06-04T09:03:11Z"
    }
  ]
}

List trades (exchange-wide)

Public
GET/api/markets/trades

Returns a cursor-paginated, exchange-wide trade tape. Optionally filter by `ticker`. Useful for building a live ticker or backfilling price history.

Query parameters

  • tickerstringqueryoptional

    Restrict the tape to a single market ticker.

  • limitintegerqueryoptionaldefault: 100

    Page size. Max 100.

  • cursorstringqueryoptional

    Opaque cursor from the previous page.

Request

cURL
curl "https://api.majjha.com/api/markets/trades"

Response

200 OK
{
  "cursor": "eyJ0cyI6IDE3MTc0NTkzODB9",
  "trades": [
    {
      "trade_id": "trd_9f2",
      "ticker": "BTC-5MIN-25JUN04T0900-Y",
      "price": "0.54",
      "count": "25",
      "taker_side": "yes",
      "created_at": "2026-06-04T09:03:11Z"
    }
  ]
}

Get price history

Public
GET/api/markets/{ticker}/price-history

Returns a time series of YES-price ticks for charting a market.

Path parameters

  • tickerstringpathrequired

    Market ticker or internal id.

Query parameters

  • limitintegerqueryoptionaldefault: 500

    Max number of ticks, newest last.

Request

cURL
curl "https://api.majjha.com/api/markets/{ticker}/price-history"

Response

200 OK
{
  "ticks": [
    { "yes_price": "0.51", "created_at": "2026-06-04T09:00:30Z" },
    { "yes_price": "0.53", "created_at": "2026-06-04T09:01:30Z" },
    { "yes_price": "0.54", "created_at": "2026-06-04T09:03:00Z" }
  ]
}

Analyze market (AI)

Public
GET/api/markets/{ticker}/analyze

Returns an AI-generated probability estimate and rationale for a market. Intended for research and UI surfacing — not financial advice.

Path parameters

  • tickerstringpathrequired

    Market ticker or internal id.

Request

cURL
curl "https://api.majjha.com/api/markets/{ticker}/analyze"

Response

200 OK
{
  "probability": 0.56,
  "confidence": "medium",
  "reasoning": "Spot has trended slightly above the strike with rising short-term momentum...",
  "keyFactors": ["short-term momentum", "thin order book above strike"],
  "marketSentiment": "leaning YES",
  "recommendation": "Slight edge to YES at current price",
  "currentPrice": 0.54
}