> ## Documentation Index
> Fetch the complete documentation index at: https://docs.foresight.now/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a market

> Single-market detail by `condition_id`. Accepts any status. **L0 — public.**



## OpenAPI

````yaml /api-reference/openapi-clob-v1.yaml get /v1/markets/{condition_id}
openapi: 3.1.0
info:
  title: Foresight CLOB Trading API v1
  version: 1.0.0
  description: >
    Public-facing CLOB (central-limit order book) REST API for the Foresight

    prediction-market platform.


    This is a **different API from the legacy AMM Trade API** (`/trade/*`). The

    CLOB API trades signed limit/market orders against an order book instead of

    swapping against an automated market maker.


    ## Base URL


    ```

    https://api.foresight.now

    ```


    All routes below are prefixed with `/v1`.


    ## Auth tiers


    - **L0** — public, no credentials (all market-data routes).

    - **L1** — Privy JWT (`Authorization: Bearer <jwt>`); used for API-key
    management.

    - **L2** — Privy JWT **or** API-key headers (`fs-api-key` +
    `fs-api-secret`); used for trading and private reads.


    ## Market identity


    A market is identified by the pair **`condition_id`** (on-chain
    ConditionalTokens

    condition hash) + **`chain_id`** (blockchain network id). Internal database

    identifiers are never exposed.


    The CLOB currently runs on **BNB Smart Chain (BSC) mainnet — `chain_id:
    56`**.

    The collateral token on BSC has **18 decimals**. Always read the
    authoritative

    `decimals` from `GET /v1/markets/{condition_id}/tokens` rather than
    hard-coding

    it — amount math signed at the wrong scale is rejected at ingest.


    ## Async matching


    `POST /v1/orders` always returns `status: OPEN`. Matching runs in a
    background

    worker; matched / partial / failed transitions arrive on the private `user`

    WebSocket channel (`wss://api.foresight.now/v1/ws`).


    ## Error envelope


    Every non-2xx response is shaped as (all field names snake_case):


    ```json

    {
      "correlation_id": "abc-123",
      "code": "NOT_FOUND",
      "message": "Market not found",
      "status_code": 404,
      "timestamp": "2026-06-03T10:15:30.000Z",
      "path": "/v1/markets/0x.../book"
    }

    ```
servers:
  - url: https://api.foresight.now
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
tags:
  - name: Auth
    description: API-key lifecycle and WebSocket token issuance.
  - name: Market Data
    description: Public markets, orderbook, ticker, trades, tokens. L0 — no auth.
  - name: Orders
    description: Place, list, and cancel signed EIP-712 orders. L2.
  - name: Fills
    description: Authenticated wallet's fill history. L2.
  - name: Positions
    description: Authenticated wallet's CLOB positions. L2.
paths:
  /v1/markets/{condition_id}:
    get:
      tags:
        - Market Data
      summary: Get a market
      description: >-
        Single-market detail by `condition_id`. Accepts any status. **L0 —
        public.**
      parameters:
        - $ref: '#/components/parameters/ConditionIdPath'
        - $ref: '#/components/parameters/ChainIdQuery'
        - $ref: '#/components/parameters/LanguageHeader'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Market'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    ConditionIdPath:
      in: path
      name: condition_id
      required: true
      schema:
        type: string
        example: '0x9cded060be358b76678e598084cf258c7257771e473dbb461cad23417302d606'
      description: On-chain ConditionalTokens condition hash.
    ChainIdQuery:
      in: query
      name: chain_id
      required: true
      schema:
        type: integer
        example: 56
      description: Blockchain network id. BSC mainnet is `56`.
    LanguageHeader:
      in: header
      name: X-Language
      schema:
        type: string
        enum:
          - en
          - cn
        default: en
      description: >-
        Language for translated fields (`summary`, `rules`). Defaults to
        English.
  schemas:
    Market:
      type: object
      required:
        - condition_id
        - chain_id
        - question
        - status
        - tokens
        - fee_rate_bps
        - created_at
      properties:
        condition_id:
          type: string
          description: On-chain ConditionalTokens condition hash.
        chain_id:
          type: integer
          example: 56
        question:
          type: string
          example: Will BTC close above $100k on Dec 31?
        summary:
          type: string
          nullable: true
          description: Market-group description, translated per `X-Language`.
        rules:
          type: string
          nullable: true
          description: Resolution rules, translated per `X-Language`.
        collateral_token:
          type: string
          nullable: true
          description: Collateral ERC-20 address.
        ctf_exchange_address:
          type: string
          nullable: true
          description: >-
            CTF Exchange contract — used as the EIP-712 `verifyingContract` when
            signing orders for this market.
        conditional_tokens_address:
          type: string
          nullable: true
          description: >-
            ConditionalTokens (ERC-1155) contract address for this market's
            chain.
        status:
          type: string
          enum:
            - OPEN
            - CLOSED
            - RESOLVED
            - PAUSED
            - SEEDING
          description: Raw market status. Trading is only possible while `OPEN`.
        end_date:
          type: string
          format: date-time
          nullable: true
        tokens:
          type: array
          items:
            $ref: '#/components/schemas/MarketToken'
        ticker:
          oneOf:
            - $ref: '#/components/schemas/Ticker'
            - type: 'null'
        fee_rate_bps:
          type: integer
          example: 100
          description: Advertised platform fee in basis points (100 = 1%).
        created_at:
          type: string
          format: date-time
    MarketToken:
      type: object
      properties:
        outcome:
          type: integer
          enum:
            - 0
            - 1
          description: 0 = NO, 1 = YES.
        outcome_label:
          type: string
          enum:
            - 'NO'
            - 'YES'
        token_id:
          type: string
          description: ERC-1155 position (token) id used as `token_id` when signing orders.
        decimals:
          type: integer
          example: 18
          description: >-
            Collateral token decimals. Present on the /tokens endpoint only. 18
            on BSC.
    Ticker:
      type: object
      description: >
        Cached ticker snapshot **as embedded in a market object**. Numeric
        fields

        are JSON numbers (camelCase). `null` until the first order/trade
        populates

        the cache. Note: this differs from the standalone `/ticker` endpoint,
        which

        returns snake_case string fields.
      nullable: true
      properties:
        bestBid:
          type: number
          example: 0.54
        bestAsk:
          type: number
          example: 0.55
        lastPrice:
          type: number
          example: 0.545
        spread:
          type: number
          example: 0.01
        displayPriceYES:
          type: number
          example: 0.55
        displayPriceNO:
          type: number
          example: 0.45
    Error:
      type: object
      required:
        - correlation_id
        - code
        - message
        - status_code
        - timestamp
        - path
      properties:
        correlation_id:
          type: string
          description: Request correlation id; falls back to `"unknown"` when none is set.
        code:
          type: string
          example: NOT_FOUND
        message:
          type: string
        status_code:
          type: integer
          example: 404
        timestamp:
          type: string
          format: date-time
        path:
          type: string
          example: /v1/markets/0x.../book
  responses:
    ErrorResponse:
      description: Error envelope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

````