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

# Search Products

> Search for products within a shopping session.



## OpenAPI

````yaml /openapi.json post /api/v1/shopping/sessions/{session_id}/search
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/shopping/sessions/{session_id}/search:
    post:
      tags:
        - Shopping
      summary: Search Products
      description: Search for products within a shopping session.
      operationId: search_products_api_v1_shopping_sessions__session_id__search_post
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Session Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductSearchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductSearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ProductSearchRequest:
      properties:
        query:
          type: string
          maxLength: 500
          minLength: 1
          title: Query
        merchant_type:
          anyOf:
            - type: string
              enum:
                - affiliate
                - ucp
                - acp
            - type: 'null'
          title: Merchant Type
        max_results:
          type: integer
          maximum: 20
          minimum: 1
          title: Max Results
          default: 10
        price_min_cents:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Price Min Cents
        price_max_cents:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Price Max Cents
      type: object
      required:
        - query
      title: ProductSearchRequest
    ProductSearchResponse:
      properties:
        query:
          type: string
          title: Query
        results:
          items:
            $ref: '#/components/schemas/ProductSearchResult'
          type: array
          title: Results
        total_count:
          type: integer
          title: Total Count
        source:
          type: string
          title: Source
      type: object
      required:
        - query
        - results
        - total_count
        - source
      title: ProductSearchResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProductSearchResult:
      properties:
        title:
          type: string
          title: Title
        price_cents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Price Cents
        currency:
          type: string
          title: Currency
          default: USD
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        product_url:
          type: string
          title: Product Url
        affiliate_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Affiliate Url
        merchant_domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Merchant Domain
        merchant_type:
          type: string
          title: Merchant Type
          default: affiliate
        rating:
          anyOf:
            - type: number
            - type: 'null'
          title: Rating
        source:
          type: string
          title: Source
          default: brave_search
      type: object
      required:
        - title
        - product_url
      title: ProductSearchResult
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````