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

# Get current prices for a set of markets

> Current per-venue prices for up to 50 markets, each leg with its source and age, and whether the closed-leg gate ran.



## OpenAPI

````yaml /openapi.json get /public/v1/prices/snapshot
openapi: 3.1.0
info:
  description: >-
    Read-only prediction-market data across Polymarket, Kalshi, Limitless and
    predict.fun over REST. Every request sends your key as `Authorization:
    Bearer tl_live_…`; try any endpoint from its page.
  title: TrendlineLabs Public API
  version: '1'
servers:
  - description: Production
    url: https://systems.trendlinelabs.ai
security: []
tags:
  - description: 'Read back the key you are calling with: its scopes, tier and rate limit.'
    name: Your key
  - description: Events group markets across venues; each carries a `universal_id`.
    name: Events
  - description: One market's order book, price history and trades on one venue.
    name: Markets
  - description: Current prices for a set of markets in one call.
    name: Prices
  - description: Live cross-venue price gaps on the same market.
    name: Opportunities
paths:
  /public/v1/prices/snapshot:
    get:
      tags:
        - Prices
      summary: Get current prices for a set of markets
      description: >-
        Current per-venue prices for up to 50 markets, each leg with its source
        and age, and whether the closed-leg gate ran.
      operationId: getPriceSnapshot
      parameters:
        - description: comma-separated market universal ids, at most 50
          in: query
          name: ids
          required: true
          schema:
            description: comma-separated market universal ids, at most 50
            title: Ids
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                as_of_ms: 1791266400000
                closed: null
                closed_gate: ok
                snapshot:
                  mk-btc-100k-2026:
                    kalshi:
                      no_ask: 60
                      no_size: 205
                      price_source: redis
                      price_ts_ms: 1791266398800
                      venue_id: KXBTC-26DEC31-B100000
                      yes_ask: 41
                      yes_size: 310
                    polymarket:
                      no_ask: 0.55
                      no_size: 120
                      price_source: redis
                      price_ts_ms: 1791266399200
                      venue_id: bitcoin-above-100k-on-december-31
                      yes_ask: 0.46
                      yes_size: 1500
                truncated: false
              schema:
                $ref: '#/components/schemas/PublicPriceSnapshot'
          description: Successful Response
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: 'unauthorized: no key, or a key that is unknown, revoked or expired.'
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            WWW-Authenticate:
              description: Bearer realm="public-api"
              schema:
                type: string
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            insufficient_scope: the key lacks the scope this route needs;
            ip_not_allowed: the request came from an address outside the key's
            allowlist; tier_required: the key owner's plan does not include API
            access; access_not_granted: API access is free but granted on
            request; request it on https://trendlinelabs.ai/developer.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            invalid_request: a parameter is missing, unknown, malformed or out
            of bounds, or a cursor does not match.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            rate_limited: too many requests, or too many failed authentications;
            wait Retry-After seconds.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            Retry-After:
              description: seconds to wait before retrying
              schema:
                type: integer
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            internal_error: an unexpected failure on our side; quote the request
            id. The body may instead be text/plain with no envelope and no
            X-RateLimit-* headers when a failure escapes the route's own
            handling.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
          description: >-
            dependency_unavailable: one of our own stores could not be read;
            retry later.
          headers:
            Cache-Control:
              description: no-store on every answer
              schema:
                type: string
            X-RateLimit-Limit:
              description: >-
                requests allowed per window for this key; present once the key
                passed the limiter
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: >-
                requests left in this window; present once the key passed the
                limiter
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                seconds until the window resets; present once the key passed the
                limiter
              schema:
                type: integer
            X-Request-Id:
              description: >-
                this request's id (yours, when you sent X-Request-Id); equals
                the envelope's request_id
              schema:
                type: string
      security:
        - HTTPBearer: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: >
            #!/bin/sh

            # getPriceSnapshot: Get current prices for a set of markets. Needs
            TRENDLINE_API_KEY; TRENDLINE_API_BASE overrides the base.

            curl -sS
            "${TRENDLINE_API_BASE:-https://systems.trendlinelabs.ai}/public/v1/prices/snapshot?ids=mk-btc-100k-2026"
            \
              -H "Authorization: Bearer $TRENDLINE_API_KEY"
        - label: Python
          lang: python
          source: >
            """getPriceSnapshot: Get current prices for a set of markets. Needs
            TRENDLINE_API_KEY; TRENDLINE_API_BASE overrides the base."""

            import os


            import requests


            BASE = os.environ.get("TRENDLINE_API_BASE",
            "https://systems.trendlinelabs.ai")

            KEY = os.environ["TRENDLINE_API_KEY"]


            r = requests.get(f"{BASE}/public/v1/prices/snapshot", params={"ids":
            "mk-btc-100k-2026"},
                             headers={"Authorization": f"Bearer {KEY}"}, timeout=10)
            r.raise_for_status()

            print(r.json())
        - label: JavaScript
          lang: javascript
          source: >
            // getPriceSnapshot: Get current prices for a set of markets. Needs
            TRENDLINE_API_KEY; TRENDLINE_API_BASE overrides the base.

            const BASE = process.env.TRENDLINE_API_BASE ??
            "https://systems.trendlinelabs.ai";

            const KEY = process.env.TRENDLINE_API_KEY;

            const r = await
            fetch(`${BASE}/public/v1/prices/snapshot?ids=mk-btc-100k-2026`, {
            headers: { Authorization: `Bearer ${KEY}` } });

            console.log(r.status, await r.json());
components:
  schemas:
    PublicPriceSnapshot:
      properties:
        as_of_ms:
          description: when the snapshot was read, unix milliseconds
          title: As Of Ms
          type: integer
        closed:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/PublicClosedMarker'
              type: object
            - type: 'null'
          description: >-
            markets with a closed leg, by market universal id; absent when none
            is closed or the check could not run
          title: Closed
        closed_gate:
          description: >-
            ok when the closed-leg check ran, unavailable when it could not, so
            an absent `closed` is not read as none closed
          enum:
            - ok
            - unavailable
          title: Closed Gate
          type: string
        snapshot:
          additionalProperties:
            anyOf:
              - additionalProperties:
                  $ref: '#/components/schemas/PublicLeg'
                propertyNames:
                  enum:
                    - kalshi
                    - polymarket
                    - limitless
                    - predictfun
                type: object
              - type: 'null'
          description: >-
            per market universal id, its legs by venue; null when no venue has a
            price for it
          title: Snapshot
          type: object
        truncated:
          default: false
          description: >-
            true when more ids were sent than the route serves and the rest were
            dropped
          title: Truncated
          type: boolean
      required:
        - snapshot
        - as_of_ms
        - closed_gate
      title: PublicPriceSnapshot
      type: object
    PublicError:
      properties:
        error:
          $ref: '#/components/schemas/PublicErrorBody'
          description: the refusal
      required:
        - error
      title: PublicError
      type: object
    PublicClosedMarker:
      properties:
        platforms:
          description: each of this market's legs that has closed
          items:
            $ref: '#/components/schemas/PublicClosedLeg'
          title: Platforms
          type: array
      required:
        - platforms
      title: PublicClosedMarker
      type: object
    PublicLeg:
      properties:
        no_ask:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            the venue's best NO ask: cents (0 to 100) on every venue but
            Polymarket, which is 0..1
          title: No Ask
        no_size:
          anyOf:
            - type: number
            - type: 'null'
          description: size available at the best NO ask
          title: No Size
        price_source:
          anyOf:
            - enum:
                - redis
                - db
              type: string
            - type: 'null'
          description: >-
            where this price was read: the value redis means the live price
            cache, db the last stored price
          title: Price Source
        price_ts_ms:
          anyOf:
            - type: integer
            - type: 'null'
          description: when this price was observed, unix milliseconds
          title: Price Ts Ms
        venue_id:
          anyOf:
            - type: string
            - type: 'null'
          description: the market's id on this venue (a ticker, slug or numeric id)
          title: Venue Id
        yes_ask:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            the venue's best YES ask: cents (0 to 100) on every venue but
            Polymarket, which is 0..1
          title: Yes Ask
        yes_size:
          anyOf:
            - type: number
            - type: 'null'
          description: size available at the best YES ask
          title: Yes Size
      title: PublicLeg
      type: object
    PublicErrorBody:
      properties:
        code:
          description: >-
            a machine-readable code from x-known-codes; a new code may be added,
            so handle an unknown one by its status
          title: Code
          type: string
          x-known-codes:
            - access_not_granted
            - dependency_unavailable
            - insufficient_scope
            - internal_error
            - invalid_request
            - ip_not_allowed
            - market_closed
            - not_found
            - rate_limited
            - tier_required
            - unauthorized
            - upstream_unavailable
            - venue_not_listed
            - venue_unsupported
        message:
          description: a human-readable explanation; never parse it
          title: Message
          type: string
        request_id:
          description: >-
            this request's id, also sent as the X-Request-Id header; quote it
            when asking for help
          title: Request Id
          type: string
      required:
        - code
        - message
        - request_id
      title: PublicErrorBody
      type: object
    PublicClosedLeg:
      properties:
        last_quote_cents:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            the leg's last YES price before it closed, in cents (0 to 100) on
            every venue; null when the venue stores no price
          title: Last Quote Cents
        quoted_at:
          anyOf:
            - type: string
            - type: 'null'
          description: when that last price was seen, ISO 8601; null when unknown
          title: Quoted At
        venue:
          description: the venue on which this market's leg has closed
          enum:
            - kalshi
            - polymarket
            - limitless
            - predictfun
          title: Venue
          type: string
        venue_id:
          anyOf:
            - type: string
            - type: 'null'
          description: the market's id on this venue (a ticker, slug or numeric id)
          title: Venue Id
      required:
        - venue
      title: PublicClosedLeg
      type: object
  securitySchemes:
    HTTPBearer:
      description: 'Authorization: Bearer tl_live_…'
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.