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

# Midpoint Price

> Returns the midpoint price for a token, calculated as the average of the best bid and best ask.

If the book is one-sided (only bids or only asks), the missing side is treated as 0. Response is enriched with PolyNode market metadata.

Returns the midpoint price for a token or market, calculated as the average of the best bid and best ask.

## Identifier types

The `{token_id}` parameter accepts three types:

| Identifier       | Format                | Returns                                 |
| ---------------- | --------------------- | --------------------------------------- |
| **Token ID**     | All digits, 70+ chars | Single midpoint (Polymarket-compatible) |
| **Condition ID** | Starts with `0x`      | Midpoints for both outcomes             |
| **Slug**         | Human-readable string | Midpoints for all outcomes in the event |

### By token ID

```bash theme={null}
curl "https://api.polynode.dev/v1/midpoint/114694726451307654528948558967898493662917070661203465131156925998487819889437" \
  -H "x-api-key: YOUR_KEY"
```

```json theme={null}
{
  "mid": "0.465",
  "token_id": "114694726451307654528948558967898493662917070661203465131156925998487819889437",
  "question": "Netanyahu out by end of 2026?",
  "slug": "netanyahu-out-before-2027-684-719-226"
}
```

### By condition ID

```bash theme={null}
curl "https://api.polynode.dev/v1/midpoint/0xd1796c09d0d6f876f8580086ae9808ec991784e3a74b25a1830a25de71a78c96" \
  -H "x-api-key: YOUR_KEY"
```

```json theme={null}
{
  "condition_id": "0xd1796c09d0d6f876f8580086ae9808ec991784e3a74b25a1830a25de71a78c96",
  "question": "Netanyahu out by end of 2026?",
  "event_title": "Netanyahu out by...?",
  "outcomes": [
    {"outcome": "Yes", "token_id": "11469472645...", "mid": "0.465"},
    {"outcome": "No", "token_id": "66255671088...", "mid": "0.535"}
  ]
}
```

## Calculation

```
midpoint = (best_bid + best_ask) / 2
```

If the book is one-sided (only bids or only asks), the missing side is treated as 0. This matches Polymarket's behavior.

## Notes

* The `mid` value is a decimal string (e.g. `"0.465"`).
* Returns a 404 if no book exists for the identifier.


## OpenAPI

````yaml GET /v1/midpoint/{token_id}
openapi: 3.1.0
info:
  title: PolyNode API
  description: >-
    Real-time Polymarket data API with decoded mempool settlements, OHLCV
    candles, and full Polygon JSON-RPC proxy.
  contact:
    name: PolyNode
    url: https://polynode.dev
  license:
    name: ''
  version: 2.0.0
servers:
  - url: https://api.polynode.dev
    description: Production
security:
  - api_key: []
paths:
  /v1/midpoint/{token_id}:
    get:
      tags:
        - Orderbook
      summary: Midpoint price
      description: >-
        Returns the midpoint price for a token, calculated as the average of the
        best bid and best ask.


        If the book is one-sided (only bids or only asks), the missing side is
        treated as 0. Response is enriched with PolyNode market metadata.
      operationId: get_midpoint
      parameters:
        - name: token_id
          in: path
          description: >-
            Token ID (all digits), condition ID (starts with 0x), or event slug.
            Token ID returns a single book; condition ID and slug return all
            outcomes.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Midpoint price
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MidpointResponse'
              example:
                mid: '0.465'
                token_id: >-
                  114694726451307654528948558967898493662917070661203465131156925998487819889437
                question: Netanyahu out by end of 2026?
                slug: netanyahu-out-before-2027-684-719-226
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Token not found in orderbook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: No orderbook exists for the requested token id
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key: []
components:
  schemas:
    MidpointResponse:
      type: object
      description: >-
        Midpoint price. The `mid` field matches Polymarket's CLOB `/midpoint`
        response. Additional fields are PolyNode enrichment.
      required:
        - mid
      properties:
        mid:
          type: string
          description: >-
            Midpoint price as decimal string, calculated as (best_bid +
            best_ask) / 2
        token_id:
          type: string
          description: Token ID (PolyNode enrichment)
        question:
          type: string
          description: Market question (PolyNode enrichment)
        slug:
          type: string
          description: Event slug (PolyNode enrichment)
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: x-api-key

````