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

> ## Agent Instructions
> To integrate AGG, start with Quickstart: REST (https://docs.agg.market/quickstart/rest), then Order lifecycle & statuses (https://docs.agg.market/concepts/order-lifecycle).
> Track every trade until it reaches a terminal status. Before retrying a failed or timed-out call, read Errors, retries & idempotency (https://docs.agg.market/concepts/errors).
> The API reference is generated from https://docs.agg.market/openapi/openapi.json.

# Look up venue market outcomes by external identifier

> Resolves venue-side outcome keys (e.g. Polymarket token_id) to AGG outcomes, including `matchedVenueMarketOutcomes` counterpart references across venues. The referenced markets are returned alongside `data` as `matchedVenueMarkets[]` — the same shape /venue-markets nests on each market — so a trade flow resolves the counterpart's venue and venue-side ids from this one response. Note a Kalshi No-side outcome has no `externalIdentifier`; its ticker is the sibling market's `externalIdentifier`. Batch up to 20 keys. Outcome keys are globally unique, so `venue` is optional and narrows only. Kalshi carries its ticker on exactly one of the two outcomes per market, so Kalshi No-side outcomes cannot be resolved here — fetch the market via GET /venue-markets?venue=kalshi&externalIdentifier= and read both outcomes from it.



## OpenAPI

````yaml /openapi/openapi.json get /venue-market-outcomes
openapi: 3.0.2
info:
  title: AGG API
  version: 1.0.0
  description: >-
    Prediction market aggregator REST API — authentication, users, venue events,
    venue markets, orderbooks, charts, and execution workflows.
servers:
  - url: https://api.agg.market
    description: Production
security: []
tags:
  - name: Authentication
    description: Sign users in and manage their session tokens.
  - name: Markets
    description: Find events, markets and outcomes to trade.
  - name: Market Data
    description: Live orderbooks, prices, charts and scores for those markets.
  - name: Trading
    description: Quote, place, sign, track and cancel orders.
  - name: Portfolio
    description: A user's orders, positions, balances and activity.
  - name: Funding
    description: Deposit addresses, withdrawals, balance refills and fiat on-ramp.
  - name: Users
    description: The signed-in user's profile, linked accounts, KYC and venue keys.
  - name: Hosted Venue Accounts
    description: Provision, fund and withdraw from venue accounts hosted for the user.
  - name: Webhooks
    description: Configure and operate webhook delivery to your server.
  - name: Partner Admin
    description: Server-side reads across your app's users, orders and analytics.
  - name: Paper Trading
    description: Simulated accounts and orders for testing without real funds.
  - name: News
    description: News feeds linked to markets.
  - name: Correlated Markets
    description: Markets related to a given market and the effect of its resolution.
paths:
  /venue-market-outcomes:
    get:
      tags:
        - Markets
      summary: Look up venue market outcomes by external identifier
      description: >-
        Resolves venue-side outcome keys (e.g. Polymarket token_id) to AGG
        outcomes, including `matchedVenueMarketOutcomes` counterpart references
        across venues. The referenced markets are returned alongside `data` as
        `matchedVenueMarkets[]` — the same shape /venue-markets nests on each
        market — so a trade flow resolves the counterpart's venue and venue-side
        ids from this one response. Note a Kalshi No-side outcome has no
        `externalIdentifier`; its ticker is the sibling market's
        `externalIdentifier`. Batch up to 20 keys. Outcome keys are globally
        unique, so `venue` is optional and narrows only. Kalshi carries its
        ticker on exactly one of the two outcomes per market, so Kalshi No-side
        outcomes cannot be resolved here — fetch the market via GET
        /venue-markets?venue=kalshi&externalIdentifier= and read both outcomes
        from it.
      operationId: listVenueMarketOutcomes
      parameters:
        - name: externalIdentifier
          in: query
          required: true
          schema:
            anyOf:
              - maxItems: 20
                type: array
                items:
                  type: string
              - type: string
        - name: venue
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/Venue'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - matchedVenueMarkets
                  - nextCursor
                  - hasMore
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - venueMarketId
                        - label
                      properties:
                        id:
                          type: string
                        venueMarketId:
                          type: string
                        externalIdentifier:
                          type: string
                          nullable: true
                        label:
                          type: string
                        title:
                          type: string
                          nullable: true
                        price:
                          minimum: 0
                          maximum: 1
                          deprecated: true
                          description: >-
                            No longer returned. Fetch live prices from GET
                            /midpoints (pass this outcome's parent venueMarketId
                            in `ids` and match on
                            `outcomes[].venueMarketOutcomeId`), or subscribe to
                            the WebSocket midpoint stream.
                          type: number
                        winner:
                          type: boolean
                          nullable: true
                        payoutPerShare:
                          minimum: 0
                          maximum: 1
                          description: >-
                            Per-share USDC payout of this outcome in [0, 1] once
                            the market settles. Source of truth over `winner`
                            when set: a Polymarket UMA 50/50 stores 0.5 on both
                            sides, a Novig void stores its refund prices (e.g.
                            0.155 / 0.845). `null` = unknown; clients fall back
                            to `winner ? 1/winnerCount : 0`.
                          type: number
                          nullable: true
                        refundAtCost:
                          description: >-
                            True when the venue voided the market and returns
                            every holder their stake (ProphetX). `winner` is
                            true on every outcome and `payoutPerShare` is null;
                            the per-share refund is the holder's own average
                            entry price. Check this BEFORE `payoutPerShare` /
                            `winner ? 1/winnerCount : 0`.
                          type: boolean
                        matchedVenueMarketOutcomes:
                          type: array
                          items:
                            type: object
                            required:
                              - venueMarketId
                              - venueMarketOutcomeId
                            properties:
                              venueMarketId:
                                type: string
                              venueMarketOutcomeId:
                                type: string
                  matchedVenueMarkets:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - venue
                        - externalIdentifier
                        - question
                      properties:
                        id:
                          type: string
                        venue:
                          $ref: '#/components/schemas/Venue'
                        deployerVenue:
                          type: string
                          nullable: true
                        externalIdentifier:
                          type: string
                        question:
                          type: string
                        description:
                          type: string
                          nullable: true
                        rulesPrimary:
                          type: string
                          nullable: true
                        rulesSecondary:
                          type: string
                          nullable: true
                        volume:
                          minimum: 0
                          type: number
                          nullable: true
                        volume24hr:
                          minimum: 0
                          type: number
                          nullable: true
                        status:
                          type: string
                          enum:
                            - open
                            - closed
                            - resolved
                            - unopened
                            - paused
                        conditionId:
                          type: string
                          nullable: true
                        arbReturn:
                          type: number
                          nullable: true
                        shortTitle:
                          type: string
                          nullable: true
                        image:
                          type: string
                          nullable: true
                        venueEvent:
                          type: object
                          required:
                            - id
                            - externalIdentifier
                          properties:
                            id:
                              type: string
                            externalIdentifier:
                              type: string
                            slug:
                              type: string
                              nullable: true
                            title:
                              type: string
                              nullable: true
                            series:
                              type: object
                              required:
                                - id
                                - venue
                                - externalIdentifier
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                                  nullable: true
                                venue:
                                  type: string
                                externalIdentifier:
                                  type: string
                              nullable: true
                          nullable: true
                        venueMarketOutcomes:
                          type: array
                          items:
                            type: object
                            required:
                              - id
                              - venueMarketId
                              - label
                            properties:
                              id:
                                type: string
                              venueMarketId:
                                type: string
                              externalIdentifier:
                                type: string
                                nullable: true
                              label:
                                type: string
                              title:
                                type: string
                                nullable: true
                              price:
                                deprecated: true
                                description: >-
                                  No longer returned. Fetch live prices from GET
                                  /midpoints — sibling outcomes are covered by
                                  the `matched[]` entries of the parent market's
                                  midpoint item.
                                type: number
                              winner:
                                type: boolean
                                nullable: true
                              payoutPerShare:
                                minimum: 0
                                maximum: 1
                                description: >-
                                  Per-share USDC payout of this outcome in [0,
                                  1] once the market settles. Source of truth
                                  over `winner` when set: a Polymarket UMA 50/50
                                  stores 0.5 on both sides, a Novig void stores
                                  its refund prices (e.g. 0.155 / 0.845). `null`
                                  = unknown; clients fall back to `winner ?
                                  1/winnerCount : 0`.
                                type: number
                                nullable: true
                              refundAtCost:
                                description: >-
                                  True when the venue voided the market and
                                  returns every holder their stake (ProphetX).
                                  `winner` is true on every outcome and
                                  `payoutPerShare` is null; the per-share refund
                                  is the holder's own average entry price. Check
                                  this BEFORE `payoutPerShare` / `winner ?
                                  1/winnerCount : 0`.
                                type: boolean
                  nextCursor:
                    type: string
                    nullable: true
                  hasMore:
                    type: boolean
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - appId: []
components:
  schemas:
    Venue:
      type: string
      enum:
        - kalshi
        - polymarket
        - limitless
        - opinion
        - predict
        - pred
        - tiprun
        - probable
        - myriad
        - hyperliquid
        - novig
        - prophetx
        - betdex
    ErrorMessage:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: x-app-id
      description: Your application ID. Required for all app-tier and user-tier routes.

````