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

# Global search preview — top results across users and events

> Returns up to 5 hits per type for the header dropdown. If the query starts with `0x` we look up users by wallet (exact at length 42, prefix from `0x` + 8 hex characters; a shorter `0x…` matches no wallet), plus the user whose username equals the query (case-insensitive, exact, at any length), and `events` is empty. Otherwise two independent text searches run in parallel: users need at least 3 characters after trimming (a shorter query returns no users), events start from 1 character. Events also surface tag-driven hits via `matchedVia: 'tag'`, match every query word as a word start in the title, sides, teams, competition or live tags (any order, accents ignored), and, when fewer than 20 events match that way and a query word has 4 or more characters, typo look-alikes follow below every exact hit with `matchedVia: 'fuzzy'` (not when a synonym, typed as it is or read from a typo, already matches an event this search lists, open or finished; RND-4711, RND-4766, RND-4773). A query that contains a known synonym (RND-3864; for example `man utd`, `bitcoin`) also matches events that have the target words (`manchester united`, `btc`) as whole words; a target of several words must appear as that phrase (`man utd` does not match Manchester City vs Leeds United; RND-4711). The same holds when the query types such a target in full: `manchester united` needs those words together (or written as one word: `la liga` also matches `LaLiga`), so it no longer matches Manchester City vs Leeds United (RND-4765). A query word read as a typo of a known synonym (`bitcion`) is searched as the query typed right (`bitcoin`): it lists and ranks events, and keeps or drops typo look-alikes, exactly as that query does (RND-4766). Events are admitted and ordered as on `/api/search/events` (RND-3865). `didYouMean` names the query the events answer when they came only from a synonym or a typo match. `suggestion` and `suggestionCount` carry a "Did you mean …?" line and its result count, `counts` the results per type (RND-4243), and `suggestions` up to 5 queries to try when nothing was found (RND-4249). Minimum query length is 1 character. A market maker's wallet is never a user hit.



## OpenAPI

````yaml /api-reference/openapi.json get /api/search
openapi: 3.1.0
info:
  title: PredictStreet API
  description: >-
    Client-facing HTTP API for the PredictStreet prediction-market platform.
    **Partner kinds.** Every authenticated endpoint except the partner-level
    platform reads (`/api/platform/status`, `/notices`, `/maintenance`) resolves
    a request's *effective wallet* from the partner row. `single_wallet`
    partners bind to one `associatedWallet` set at creation. `multi_wallet`
    partners declare the actor on every request via an `X-User-Wallet:
    0x<40-hex>` header. See the [Partner kinds](/auth/api-keys#partner-kinds)
    doc for the full contract.
  version: '2026-06-16'
  contact:
    name: PredictStreet partners
    email: partners@predictstreet.com
servers:
  - url: https://core-api.adipredictstreet.com
    description: Production — replace with the API host issued at partner onboarding.
security: []
tags:
  - name: Deposits
    description: >-
      Gasless USDC deposit relay - submit a signed EIP-2612 permit and the
      platform broadcasts the on-chain deposit for you (no gas).
  - name: Events
    description: >-
      Polymarket-style event grouping with football metadata (group, stage,
      teams, tags).
  - name: Tags
    description: Curated tag taxonomy used to filter events.
  - name: Markets
    description: 'Public market data: list, detail, orderbook, trades, OHLC.'
  - name: Crypto
    description: >-
      Crypto price markets: the underlying-asset price curve and Up/Down series
      navigation. The markets themselves are ordinary binary markets — list them
      through /api/markets and /api/events.
  - name: Orders
    description: >-
      Signed-order place / cancel / read. Requires `X-Api-Key` with
      `orders:read` / `orders:write` scope; every write additionally requires an
      EIP-712 signature over the order.
  - name: Portfolio
    description: >-
      Balances, positions, trades, fees, vault info for the key's
      `associatedWallet`. Requires `X-Api-Key` with `portfolio:read` scope.
  - name: Matches
    description: >-
      A match groups several events into one fixture/card (1X2 + first-scorer +
      over-under under one matchup).
  - name: Vault
    description: >-
      Backend co-signatures for ERC-1155 split / merge, and recovery for
      off-chain locks when the corresponding chain tx never confirmed. Requires
      `X-Api-Key` with `vault:write` scope plus an EIP-712 signature over the
      operation.
  - name: Leaderboard
    description: Public ranked leaderboard across PnL / volume buckets.
  - name: Search
    description: Global search across users, events, and matches.
  - name: Withdrawal Security
    description: >-
      Self-service withdrawal 2FA (TOTP) and withdrawal-address whitelist. Same
      endpoints serve the web app (user sessions) and API-key integrators.
      Mutations need `vault:write`, reads `portfolio:read`. Both are opt-in per
      wallet and only gate withdrawals once the platform enables
      withdrawal-security enforcement.
  - name: Platform
    description: >-
      Platform reference data and state. The contract registry and the fee
      configuration are public and need no key. The freeze flag (`/status`),
      active notices (`/notices`) and maintenance windows (`/maintenance`) need
      a partner API key in `X-Api-Key`.
paths:
  /api/search:
    get:
      tags:
        - Search
      summary: Global search preview — top results across users and events
      description: >-
        Returns up to 5 hits per type for the header dropdown. If the query
        starts with `0x` we look up users by wallet (exact at length 42, prefix
        from `0x` + 8 hex characters; a shorter `0x…` matches no wallet), plus
        the user whose username equals the query (case-insensitive, exact, at
        any length), and `events` is empty. Otherwise two independent text
        searches run in parallel: users need at least 3 characters after
        trimming (a shorter query returns no users), events start from 1
        character. Events also surface tag-driven hits via `matchedVia: 'tag'`,
        match every query word as a word start in the title, sides, teams,
        competition or live tags (any order, accents ignored), and, when fewer
        than 20 events match that way and a query word has 4 or more characters,
        typo look-alikes follow below every exact hit with `matchedVia: 'fuzzy'`
        (not when a synonym, typed as it is or read from a typo, already matches
        an event this search lists, open or finished; RND-4711, RND-4766,
        RND-4773). A query that contains a known synonym (RND-3864; for example
        `man utd`, `bitcoin`) also matches events that have the target words
        (`manchester united`, `btc`) as whole words; a target of several words
        must appear as that phrase (`man utd` does not match Manchester City vs
        Leeds United; RND-4711). The same holds when the query types such a
        target in full: `manchester united` needs those words together (or
        written as one word: `la liga` also matches `LaLiga`), so it no longer
        matches Manchester City vs Leeds United (RND-4765). A query word read as
        a typo of a known synonym (`bitcion`) is searched as the query typed
        right (`bitcoin`): it lists and ranks events, and keeps or drops typo
        look-alikes, exactly as that query does (RND-4766). Events are admitted
        and ordered as on `/api/search/events` (RND-3865). `didYouMean` names
        the query the events answer when they came only from a synonym or a typo
        match. `suggestion` and `suggestionCount` carry a "Did you mean …?" line
        and its result count, `counts` the results per type (RND-4243), and
        `suggestions` up to 5 queries to try when nothing was found (RND-4249).
        Minimum query length is 1 character. A market maker's wallet is never a
        user hit.
      operationId: SearchController_preview
      parameters:
        - name: q
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
          description: >-
            Search query, 1–64 characters after trimming (else 400
            `query_too_short` / `query_too_long`). Sent more than once, as an
            object (`q[x]=…`), or containing a NUL character → 400
            `invalid_query`.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchPreviewRespDto'
        '400':
          description: >-
            Missing or out-of-bound `q` (`query_required`, `query_too_short`,
            `query_too_long`), or an `invalid_query` (repeated, object or NUL
            `q`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - {}
components:
  schemas:
    SearchPreviewRespDto:
      type: object
      required:
        - query
        - walletMode
        - users
        - events
        - usersHasMore
        - eventsHasMore
        - didYouMean
        - suggestion
        - suggestionCount
        - counts
        - suggestions
      properties:
        query:
          type: string
          description: Trimmed query string actually used.
        walletMode:
          type: boolean
          description: >-
            True when the query parsed as a `0x…` wallet prefix. In that case
            `events` is always empty.
        users:
          type: array
          items:
            $ref: '#/components/schemas/SearchUser'
        events:
          type: array
          items:
            $ref: '#/components/schemas/SearchEvent'
        usersHasMore:
          type: boolean
          description: >-
            True when there is at least one more row past the preview slice for
            this type — drives the "View more" footer in the dropdown without a
            follow-up round-trip.
        eventsHasMore:
          type: boolean
        didYouMean:
          type: string
          nullable: true
          description: >-
            RND-3864. Set when the events came only from a synonym (`man utd` →
            `manchester united`) or the typo fallback (`antropic` →
            `anthropic`): the query they answer, for example for a "Showing
            results for …" line. `null` when the query matched by itself, when
            no event matched, and in `0x` mode. When a query word was read as a
            typo of a known synonym (RND-4766), the query is searched as typed
            right and `didYouMean` is that corrected query, with only the typo
            word replaced and every other word as typed (`bitcion Price` →
            `bitcoin Price`; RND-5467) whenever its own words or synonyms find
            an event (on the pages where it is set).
        suggestion:
          type: string
          nullable: true
          description: >-
            RND-4243. The "Did you mean …?" line: when the query found fewer
            than 5 events itself, a typo fix (never a synonym) that finds more
            events than those, also when `didYouMean` is set (RND-5467); else
            `didYouMean`. `null` otherwise, and when the suggestion finds no
            event as a query of its own.
        suggestionCount:
          type: integer
          nullable: true
          description: >-
            RND-4243. How many events `suggestion` finds as a query of its own
            (as `/api/search/events?q=<suggestion>`), at most 200. `null`
            without a suggestion, or when it could not be counted.
        counts:
          description: RND-4243. Results per type, for tabs and "See all" links.
          allOf:
            - $ref: '#/components/schemas/SearchCounts'
        suggestions:
          type: array
          items:
            type: string
          description: >-
            RND-4249. Chips for a zero-result answer, at most 5, each a query of
            1–64 characters to search next: the query's own words of 3 or more
            characters that find events alone (for a query of two or more words;
            never a typo match), then popular searches that share one of those
            words, then tags of the events those words find. Words and popular
            searches are lower-case; tags keep their name. Empty otherwise, and
            when none is found. When the chips could not all be read in time the
            answer is sent with `Cache-Control: no-store`, so a retry can fill
            them. Filled only when neither users nor events were found.
    ErrorEnvelope:
      type: object
      description: >-
        Error body returned by every API error (same shape as `Error`). Branch
        on `error.code`, not on `message`.
      required:
        - status
        - error
      properties:
        status:
          type: integer
          description: HTTP status, repeated in the body.
          example: 400
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable code.
              example: bad_request
            message:
              type: string
            trace_id:
              type: string
              description: Request trace id; quote it to support. May be absent.
            retryAfterSec:
              type: integer
              description: >-
                Seconds to wait before retrying, when the server says so (also
                sent as the `Retry-After` header).
            retryable:
              type: boolean
              description: >-
                Whether the same request may be sent again as it is. Absent when
                the server does not say.
            details:
              type: object
              additionalProperties: true
              description: Extra structured context thrown with the error.
    SearchUser:
      type: object
      required:
        - walletAddress
        - vaultAddress
        - username
        - avatarUrl
        - predictionCount
      properties:
        walletAddress:
          type: string
          description: Wallet (EOA) address, EIP-55 checksummed — the public identity.
        vaultAddress:
          type: string
          description: The user's vault address.
        username:
          type: string
          nullable: true
        avatarUrl:
          type: string
          nullable: true
          description: >-
            The profile photo (512x512 WebP), only once it passed moderation;
            null shows a generated avatar.
        predictionCount:
          type: integer
          nullable: true
          example: 48
          description: >-
            RND-4250. The public profile's Predictions total (open, won, lost
            and voided positions); `null` when it could not be read (the hit is
            still returned).
    SearchEvent:
      type: object
      required:
        - id
        - slug
        - title
        - teamA
        - teamB
        - matchedVia
        - kind
        - competition
        - scheduledAt
        - imageUrl
        - closesAt
        - live
        - finished
      properties:
        id:
          type: string
        slug:
          type: string
        title:
          type: string
        teamA:
          nullable: true
          description: Home team; null when unknown.
          allOf:
            - $ref: '#/components/schemas/TeamRefDto'
        teamB:
          nullable: true
          description: Away team; null when unknown.
          allOf:
            - $ref: '#/components/schemas/TeamRefDto'
        matchedVia:
          type: string
          enum:
            - title
            - team
            - tag
            - fuzzy
          description: >-
            Which field caused the hit. `tag` means the event was found via one
            of its active tags rather than a direct title/team match. `fuzzy`
            means no exact match: the query is close to the event text (a typo);
            such hits rank below every exact hit (`RND-3863`). A word-start
            match is labelled `title`.
        kind:
          type: string
          enum:
            - match
            - tournament
          nullable: true
          description: >-
            RND-4243. The `/api/events?kind=` side of the event: `match` or
            `tournament` (an outright). `null` for an event that neither lists.
        competition:
          nullable: true
          description: >-
            RND-4243. The event's own competition, as on `/api/events`; `null`
            when none.
          allOf:
            - $ref: '#/components/schemas/SearchCompetition'
        scheduledAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            RND-4243. Scheduled start (`scheduledAt` on `/api/events`); `null`
            when unset.
        imageUrl:
          type: string
          nullable: true
          description: >-
            RND-4318. The event's logo, as `imageUrl` on `GET
            /api/events/{slug}`: the event's own image, else the image of the
            crypto series that page binds; `null` when neither is set.
        closesAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            RND-4243. When the event's next public market stops trading; `null`
            when none is open (in play or finished).
        live:
          type: boolean
          description: RND-4243. The event is in play now.
        finished:
          type: boolean
          description: >-
            RND-4243. The contest has ended (the `/api/events?closed=true`
            view).
    SearchCounts:
      type: object
      required:
        - matches
        - events
        - users
      properties:
        matches:
          type: integer
          description: >-
            Events of `kind: match` the query finds (as
            `/api/events?kind=match`), at most 200.
        events:
          type: integer
          description: >-
            Events of `kind: tournament` the query finds (as
            `/api/events?kind=tournament`), at most 200.
        users:
          type: integer
          description: >-
            Users the query finds, at most 200; `0` for a text query below the
            3-character username minimum.
    TeamRefDto:
      type: object
      properties:
        code:
          type: string
          description: FIFA 3-letter code (e.g. "BRA").
        label:
          type: string
          description: >-
            Display name (e.g. "Brazil"). Falls back to the code when the code
            has no name mapping.
        logo:
          type: string
          nullable: true
          description: >-
            Club crest URL, or null. Null is normal for a national team: render
            the crest when present and fall back to a flag drawn from `code`
            only when it is null.
      required:
        - code
        - label
        - logo
    SearchCompetition:
      type: object
      required:
        - name
        - slug
        - logo
      properties:
        name:
          type: string
        slug:
          type: string
          description: Competition slug, accepted by `/api/events?competition=`.
        logo:
          type: string
          nullable: true
          description: Competition crest URL, or null.

````

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