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

# Search or fetch Polymarket data

> Search supported market inputs by text, slug, token, or trending volume. API keys need the `market_data:read` scope.



## OpenAPI

````yaml /openapi.yaml get /api/polymarket
openapi: 3.1.0
info:
  title: Blueprints API
  version: '1.0'
  description: >-
    API for approved Blueprints product clients and integrations. Account
    resources require bearer authentication.
servers:
  - url: https://api.useblueprints.ai
security:
  - apiKeyBearer: []
tags:
  - name: Health
    description: Service status endpoints that do not require authentication.
  - name: Market data
    description: Authenticated read-only helpers for finding supported market inputs.
  - name: Blueprints
    description: Create, inspect, update, deploy, and stop account-owned blueprints.
  - name: Orders
    description: Read account order activity.
  - name: Portfolio
    description: Read account-level balances, positions, and portfolio summary data.
  - name: Risk rules
    description: Read and update account-level trading safeguards.
  - name: API keys
    description: Manage API keys used by trusted external integrations and MCP clients.
paths:
  /api/polymarket:
    get:
      tags:
        - Market data
      summary: Search or fetch Polymarket data
      description: >-
        Search supported market inputs by text, slug, token, or trending volume.
        API keys need the `market_data:read` scope.
      operationId: getPolymarketData
      parameters:
        - name: query
          in: query
          schema:
            type: string
          description: Text search, for example Bitcoin or US election.
        - name: slug
          in: query
          schema:
            type: string
          description: Event or market slug to fetch directly.
        - name: tokenId
          in: query
          schema:
            type: string
          description: Token ID to resolve to its market.
        - name: marketByTokenId
          in: query
          schema:
            type: string
          description: Token ID to resolve to its raw Gamma market.
        - name: book
          in: query
          schema:
            type: string
          description: Token ID to fetch CLOB order-book levels.
        - name: trending
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 50
          description: >-
            Number of trending events to return, sorted by 24h volume and
            preserving grouped markets.
        - name: top
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 50
          description: >-
            Number of top markets to return. Keep requests small and avoid
            polling large result sets.
        - name: expand
          in: query
          schema:
            type: string
            enum:
              - markets
          description: Expand multi-market events into one row per binary market.
      responses:
        '200':
          description: >-
            Market search, market detail, price history, or order-book data
            depending on query parameters.
          content:
            application/json:
              schema: {}
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  responses:
    Unauthorized:
      description: Missing, invalid, revoked, or expired credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Credential is valid but cannot perform this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
        message:
          type: string
  securitySchemes:
    apiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: bp_ API key
      x-default: bp_YOUR_API_KEY

````