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

# Search Delphi Markets

> Search across all Delphi market clusters by keyword. Uses fuzzy multi-word matching where each word must appear somewhere in the title, but in any order.

For example, searching "british minister" will match titles like "Will the British Prime Minister resign?" even though the exact phrase does not appear.

## What you get

- Delphi market clusters matching your keywords
- Each result includes the delphi_id, title, canonical exchange reference, cluster size, and last update time
- Each result also includes a `markets` array listing the individual exchange markets (exchange name, market_id, title) so you can navigate directly to each market's detail endpoint
- Results ranked by cluster size (most cross-exchange coverage first)

## Exchange market references

The `markets` array in each result contains entries like:
- `{ "exchange": "kalshi", "market_id": "AMAZONFTC-29DEC31", "title": "..." }`
- `{ "exchange": "polymarket", "market_id": "0xabc...", "title": "..." }`

Use these to construct detail endpoint URLs, e.g. `/api/v1/klsi/AMAZONFTC-29DEC31/market`

## Use cases

- Discover prediction markets across all exchanges by topic
- Find equivalent markets for arbitrage or hedging
- Power a market search interface with direct exchange links
- Explore what questions prediction markets are tracking

## Example

- Request: `GET /api/v1/search/markets?q=bitcoin&limit=10`
- Header: `X-API-Key: YOUR_API_KEY`



## OpenAPI

````yaml /openapi.json get /api/v1/search/markets
openapi: 3.0.3
info:
  title: Delphi Markets API
  description: >-
    Welcome to Delphi Markets API


    The Delphi Markets API provides unified access to prediction market data
    from **Kalshi (KLSI)** and **Polymarket (POLY)** exchanges.


    Quick Start:


    1. **Get a test API key** - Click on `POST /api/v1/test-key` below and hit
    'Try it'

    2. **Copy your key** - Save the `api_key` from the response

    3. **Authorize** - Click 'Authorize' in the sidebar and paste your key

    4. **Start exploring** - Try any endpoint!


    What You Can Build:


    - **Trading Bots**: Access real-time orderbook data and trade history

    - **Market Analytics**: Analyze market movements, spreads, and liquidity

    - **Research Tools**: Search and filter across thousands of prediction
    markets

    - **Price Feeds**: Get live pricing data for any market


    ---


    Authentication:


    All API requests require an API key passed in the `X-API-Key` header:


    Example request: GET `/api/v1/klsi/markets`

    Header: X-API-Key: dphi_live_your_key_here


    Getting an API Key:


    | Type | Duration | Rate Limit | How to Get |

    |------|----------|------------|------------|

    | Test Key | 10 minutes | 60 req/min | `POST /api/v1/test-key` |

    | Production Key | Permanent | 300 req/min | Contact us |


    ---


    Rate Limits:


    Requests are rate-limited per API key:


    - **Test keys**: 60 requests per minute

    - **Production keys**: 300 requests per minute


    When you exceed the limit, you'll receive a `429 Too Many Requests`
    response. Wait and retry.


    ---


    Error Codes:


    | Code | Meaning |

    |------|---------------|

    | 400 | Bad Request - Invalid parameters |

    | 401 | Unauthorized - Missing or invalid API key |

    | 404 | Not Found - Resource doesn't exist |

    | 429 | Too Many Requests - Rate limit exceeded |

    | 500 | Server Error - Something went wrong |


    All errors return JSON with an `error` field:


    {"error": "invalid api key format"}


    ---


    Support:


    For production API keys or support, visit
    [delphimarkets.com](delphimarkets.com).
  version: 1.0.0
  contact:
    name: Delphi Markets
    url: https://delphimarkets.com
  x-logo:
    url: https://delphimarkets.com/logo.png
servers:
  - url: https://api.delphiterminal.co
    description: Delphi Markets API
security:
  - ApiKeyAuth: []
tags:
  - name: Getting Started
    description: >-
      Start here to get a test API key and begin experimenting with the API.
      Test keys are valid for 10 minutes.
  - name: Health
    description: Health check endpoint to verify the API is operational.
  - name: Auth
    description: >-
      User authentication endpoints for creating accounts and managing sessions.
      Note: These are separate from API key authentication.
  - name: Search
    description: >-
      Search across all markets and events. Includes autocomplete suggestions
      for building search interfaces.
  - name: Delphi
    description: >-
      Cross-exchange market matching via Delphi IDs. Look up cluster metadata
      and find equivalent markets across all supported exchanges.
  - name: Clusters
    description: >-
      Cross-exchange market matching. Markets asking the same question across
      Kalshi, Polymarket, Limitless, and PFun are grouped into clusters. Use
      these endpoints to discover equivalent markets for arbitrage, hedging, and
      cross-exchange analytics.
  - name: KLSI
    description: >-
      Access Kalshi (KLSI) prediction market data including market details,
      orderbooks, trade history, and analytics. Kalshi is a US-regulated
      prediction market exchange.
  - name: Polymarket
    description: >-
      Access Polymarket (POLY) prediction market data including market details,
      orderbooks, and trade history. Polymarket is a decentralized prediction
      market platform.
  - name: Limitless
    description: >-
      Access Limitless exchange prediction market data including orderbooks.
      Limitless is a prediction market platform.
  - name: Predict.fun
    description: >-
      Access Predict.fun exchange prediction market data including price
      history.
  - name: Opinion Labs
    description: >-
      Access Opinion Labs prediction market data including market details,
      orderbooks, price history, and trade history.
  - name: Gemini
    description: >-
      Access Gemini prediction market data including market details, orderbooks,
      price history, and trade history.
  - name: Manifold
    description: >-
      Access Manifold prediction market data including market details,
      orderbooks, price history, and trade history.
  - name: ForecastEx
    description: >-
      Access ForecastEx prediction market data including market details and
      trade history.
  - name: PredictIt
    description: >-
      Access PredictIt prediction market data including market details and price
      history.
  - name: Events
    description: >-
      Events group related markets together. Use these endpoints to browse
      events by category or find all markets within an event.
  - name: Candles
    description: >-
      OHLCV (Open, High, Low, Close, Volume) candle data across exchanges.
      Supports multiple time intervals: 1s, 1m, 5m, 10m, 1h, 1d. Currently
      available for Kalshi (KLSI) with more exchanges coming soon.
  - name: Advanced Analytics
    description: >-
      Advanced orderbook analytics and price data. These endpoints provide
      deeper market insights including historical spreads, liquidity metrics,
      and best quote time series.
  - name: Trading
    description: >-
      Place, query, and cancel orders across all supported prediction-market
      exchanges (Polymarket, Kalshi, Opinion Labs, Gemini, Limitless,
      Predict.fun).


      **Important — client-side signing required for on-chain exchanges.**
      Polymarket, Opinion Labs, Limitless, and Predict.fun use EIP-712 signed
      orders. The signature must be produced on your machine using your private
      key — the Delphi server never has access to it. Use the
      `@delphimarkets/sdk` `build*Order()` helpers to construct a valid
      `signed_order` payload. Raw HTTP calls to `POST /orders` will be rejected
      by the exchange unless `signed_order` contains a valid signature.
  - name: Credentials
    description: >-
      Register and inspect your stored exchange credentials. Each user has at
      most one credential set per exchange. Credentials are encrypted at rest
      and used by the server when forwarding orders to centralized exchanges
      (Kalshi, Gemini) or for credential-derivation flows (Polymarket).
  - name: Polymarket Onboarding
    description: >-
      One-time helpers for Polymarket: derive CLOB HMAC credentials from an EOA
      private key, verify stored credentials are still valid, and look up the
      Gnosis Safe (proxy) address for an EOA. Use these once per user before
      placing your first Polymarket order.
paths:
  /api/v1/search/markets:
    get:
      tags:
        - Search
      summary: Search Delphi Markets
      description: >-
        Search across all Delphi market clusters by keyword. Uses fuzzy
        multi-word matching where each word must appear somewhere in the title,
        but in any order.


        For example, searching "british minister" will match titles like "Will
        the British Prime Minister resign?" even though the exact phrase does
        not appear.


        ## What you get


        - Delphi market clusters matching your keywords

        - Each result includes the delphi_id, title, canonical exchange
        reference, cluster size, and last update time

        - Each result also includes a `markets` array listing the individual
        exchange markets (exchange name, market_id, title) so you can navigate
        directly to each market's detail endpoint

        - Results ranked by cluster size (most cross-exchange coverage first)


        ## Exchange market references


        The `markets` array in each result contains entries like:

        - `{ "exchange": "kalshi", "market_id": "AMAZONFTC-29DEC31", "title":
        "..." }`

        - `{ "exchange": "polymarket", "market_id": "0xabc...", "title": "..."
        }`


        Use these to construct detail endpoint URLs, e.g.
        `/api/v1/klsi/AMAZONFTC-29DEC31/market`


        ## Use cases


        - Discover prediction markets across all exchanges by topic

        - Find equivalent markets for arbitrage or hedging

        - Power a market search interface with direct exchange links

        - Explore what questions prediction markets are tracking


        ## Example


        - Request: `GET /api/v1/search/markets?q=bitcoin&limit=10`

        - Header: `X-API-Key: YOUR_API_KEY`
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
          description: >-
            Search keywords. Multiple words are matched independently (all must
            appear in the title, in any order).
          example: bitcoin
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 25
            maximum: 100
          description: Maximum number of results to return (default 25, max 100).
      responses:
        '200':
          description: Array of matching market clusters
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EnrichedMarketCluster'
        '400':
          description: Invalid query (missing or too short)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  schemas:
    EnrichedMarketCluster:
      type: object
      description: >-
        Market cluster with inline exchange market listings. Extends
        MarketCluster with a markets array showing which exchanges carry this
        market.
      properties:
        delphi_id:
          type: string
          description: Unique Delphi ID for the cluster
        title:
          type: string
          description: Cluster title describing the shared question
        canonical_ref:
          type: string
          description: Canonical reference for the cluster
        size:
          type: integer
          description: Number of markets in the cluster
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
        markets:
          type: array
          description: Individual exchange markets belonging to this cluster
          items:
            $ref: '#/components/schemas/ExchangeMarketRef'
    ExchangeMarketRef:
      type: object
      description: >-
        A lightweight reference to a market on a specific exchange. Use the
        exchange and market_id to construct the full market detail endpoint URL.
      properties:
        exchange:
          type: string
          description: >-
            Exchange name (kalshi, polymarket, limitless, predictfun,
            opinionlabs)
          example: kalshi
        market_id:
          type: string
          description: Market identifier on the exchange
          example: AMAZONFTC-29DEC31
        title:
          type: string
          description: Market title on the exchange
          example: Will Amazon lose the FTC case by Dec 31?
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your API key (get one from the test-key endpoint above)

````