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

# Product Search

> Search for products by text query or image input. Requests are async by default, or use mode=sync to wait up to 30 seconds for completion.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/henry-sdk/openapi.documented.yml post /product/search
openapi: 3.1.0
info:
  title: Henry Labs API
  version: 1.5.0
  description: Playground for Henry Labs API endpoints
  contact:
    name: Henry Labs API Support
    email: support@henrylabs.ai
servers:
  - url: https://api.henrylabs.ai/v1
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Product
    description: Product search, details, and data enrichment
  - name: Cart
    description: Universal user shopping cart management
  - name: Orders
    description: Order management post purchase
  - name: Merchants
    description: Merchant information and status
  - name: Card
    description: Card tokenization and management
paths:
  /product/search:
    post:
      tags:
        - Product
      summary: Product Search
      description: >-
        Search for products by text query or image input. Requests are async by
        default, or use mode=sync to wait up to 30 seconds for completion.
      operationId: productSearch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/productSearchInput'
            examples:
              globalTextSearch:
                summary: Global text search
                value:
                  type: global
                  filters:
                    type: text
                    query: Air Max Shoes
                    country: US
                    price:
                      min: 1
                      max: 100
                      currency: USD
                    sortBy: price-low-to-high
                  mode: async
                  limit: 40
                  cursor: 0
              globalImageUrlSearch:
                summary: Global image search with imageUrl
                value:
                  type: global
                  filters:
                    type: image
                    imageUrl: >-
                      https://static.nike.com/a/images/t_web_pdp_535_v2/f_auto/example.png
                    country: US
                  mode: sync
                  limit: 10
                  cursor: 0
              globalImageBase64Search:
                summary: Global image search with base64 imageUrl
                value:
                  type: global
                  filters:
                    type: image
                    imageUrl: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
                    country: US
                  mode: async
                  limit: 5
                  cursor: 0
              merchantSearch:
                summary: Merchant search
                value:
                  type: merchant
                  filters:
                    merchant: nike.com
                    price:
                      min: 1
                      max: 100
                      currency: USD
                  mode: async
                  limit: 20
                  cursor: 0
      responses:
        '201':
          description: >-
            Product search queued successfully, use refId to check status and
            retrieve results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/productSearchStatusResponse'
        '400':
          description: Bad request - Invalid parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  status:
                    type: string
                  message:
                    type: string
                required:
                  - success
                  - status
                  - message
                additionalProperties: false
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  status:
                    type: string
                  message:
                    type: string
                required:
                  - success
                  - status
                  - message
                additionalProperties: false
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import HenrySDK from '@henrylabs/sdk';

            const client = new HenrySDK({
              apiKey: process.env['HENRY_SDK_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.products.search({
              filters: {
                type: 'text',
                query: 'Air Max Shoes',
                country: 'US',
                price: {
                  min: 1,
                  max: 100,
                  currency: 'USD',
                },
                sortBy: 'price-low-to-high',
              },
              type: 'global',
              limit: 40,
              mode: 'async',
            });

            console.log(response.refId);
components:
  schemas:
    productSearchInput:
      oneOf:
        - $ref: '#/components/schemas/productSearchGlobalInput'
        - $ref: '#/components/schemas/productSearchMerchantInput'
      type: object
      discriminator:
        propertyName: type
        mapping:
          global:
            $ref: '#/components/schemas/productSearchGlobalInput'
          merchant:
            $ref: '#/components/schemas/productSearchMerchantInput'
    productSearchStatusResponse:
      type: object
      properties:
        refId:
          type: string
          pattern: ^[a-zA-Z]{3}-ref_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}$
        status:
          type: string
          enum:
            - pending
            - processing
            - complete
            - failed
        result:
          type: object
          properties:
            products:
              type: array
              items:
                $ref: '#/components/schemas/productSearchResponseData'
            pagination:
              type: object
              properties:
                nextCursor:
                  anyOf:
                    - type: number
                    - type: 'null'
                previousCursor:
                  anyOf:
                    - type: number
                    - type: 'null'
              required:
                - nextCursor
                - previousCursor
              additionalProperties: false
          required:
            - products
            - pagination
          additionalProperties: false
        error:
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - refId
        - status
      additionalProperties: false
    productSearchGlobalInput:
      type: object
      properties:
        type:
          type: string
          const: global
        filters:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  const: text
                  description: Search using a text query
                  example: text
                query:
                  type: string
                  minLength: 1
                  description: Search query
                  example: Air Max Shoes
                country:
                  description: Country code for the search results
                  example: US
                  type: string
                price:
                  type: object
                  properties:
                    min:
                      description: Minimum price filter
                      example: 1
                      type: number
                      exclusiveMinimum: 0
                      maximum: 1000000
                    max:
                      description: Maximum price filter
                      example: 100
                      type: number
                      exclusiveMinimum: 0
                      maximum: 1000000
                    currency:
                      description: Currency code
                      example: USD
                      type: string
                sortBy:
                  description: Sort by price
                  example: price-low-to-high
                  type: string
                  enum:
                    - price-low-to-high
                    - price-high-to-low
              required:
                - type
                - query
            - type: object
              properties:
                type:
                  type: string
                  const: image
                  description: Search using an image input
                  example: image
                imageUrl:
                  type: string
                  minLength: 1
                  description: >-
                    Image input to search with Google Lens. Accepts a remote
                    HTTP(S) URL, data URL, or base64-encoded image payload.
                  example: >-
                    https://static.nike.com/a/images/t_web_pdp_535_v2/f_auto/example.png
                country:
                  description: Country code for the search results
                  example: US
                  type: string
              required:
                - type
                - imageUrl
          type: object
        mode:
          default: async
          type: string
          enum:
            - async
            - sync
        limit:
          default: 20
          description: Limit the number of results
          example: 20
          type: number
          minimum: 1
          maximum: 100
        cursor:
          description: Cursor returned from the previous response
          example: 0
          type: integer
          minimum: 0
          maximum: 9007199254740991
        skipCache:
          default: false
          description: >-
            When true, bypass any cached response and force a fresh search.
            Fresh results still repopulate the cache. Applies to both text and
            image searches.
          example: false
          type: boolean
      required:
        - type
        - filters
    productSearchMerchantInput:
      type: object
      properties:
        type:
          type: string
          const: merchant
        query:
          description: >-
            Optional text query to narrow the merchant-scoped search. When
            omitted, the merchant's catalog browse is returned (implementation
            varies per merchant).
          example: running shoes
          type: string
          minLength: 1
        filters:
          type: object
          properties:
            merchant:
              type: string
              minLength: 1
              description: >-
                Merchant to scope the search to. Accepts a case-insensitive
                merchant name (e.g. 'Nike'), a host (e.g. 'nike.com'), or any
                URL from which the host can be derived.
              example: nike.com
            country:
              description: >-
                Country code for the search results. Especially important for
                region-specific merchants (e.g. 'AU' for priceline.com.au).
              example: US
              type: string
          required:
            - merchant
        mode:
          default: async
          type: string
          enum:
            - async
            - sync
        limit:
          default: 20
          description: Limit the number of results
          example: 20
          type: number
          minimum: 1
          maximum: 100
        cursor:
          description: Cursor returned from the previous response
          example: 0
          type: integer
          minimum: 0
          maximum: 9007199254740991
        skipCache:
          default: false
          description: >-
            When true, bypass any cached response and force a fresh search.
            Fresh results still repopulate the cache. Applies to both text and
            image searches.
          example: false
          type: boolean
      required:
        - type
        - filters
    productSearchResponseData:
      type: object
      properties:
        link:
          type: string
          format: uri
        merchant:
          type: string
        host:
          type: string
        sku:
          type: string
        name:
          type: string
        description:
          type: string
        images:
          type: array
          items:
            type: object
            properties:
              isFeatured:
                type: boolean
              url:
                type: string
            required:
              - url
            additionalProperties: false
        price:
          type: object
          properties:
            value:
              type: number
            currency:
              type: string
              enum:
                - USD
                - EUR
                - AUD
                - SGD
                - TWD
                - GBP
                - CAD
                - MXN
                - NPR
                - INR
                - DKK
                - NOK
                - SEK
                - CHF
                - PLN
                - CZK
                - JPY
                - NZD
                - HKD
          required:
            - value
            - currency
          additionalProperties: false
        originalPrice:
          type: object
          properties:
            value:
              type: number
            currency:
              type: string
              enum:
                - USD
                - EUR
                - AUD
                - SGD
                - TWD
                - GBP
                - CAD
                - MXN
                - NPR
                - INR
                - DKK
                - NOK
                - SEK
                - CHF
                - PLN
                - CZK
                - JPY
                - NZD
                - HKD
          required:
            - value
            - currency
          additionalProperties: false
        availability:
          type: string
          enum:
            - in_stock
            - limited_stock
            - out_of_stock
            - preorder
            - backorder
        options:
          $ref: '#/components/schemas/__schema0'
        reviews:
          type: object
          properties:
            rating:
              type: number
            count:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            histogram:
              type: array
              items:
                type: object
                properties:
                  stars:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  count:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                required:
                  - stars
                  - count
                additionalProperties: false
            criticRatings:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  rating:
                    type: string
                  link:
                    type: string
                required:
                  - name
                  - rating
                additionalProperties: false
            userReviews:
              type: array
              items:
                type: object
                properties:
                  title:
                    type: string
                  text:
                    type: string
                  author:
                    type: string
                  rating:
                    type: number
                  date:
                    type: string
                  source:
                    type: string
                  images:
                    type: array
                    items:
                      type: string
                required:
                  - text
                additionalProperties: false
            insights:
              type: array
              items:
                type: object
                properties:
                  title:
                    type: string
                  snippets:
                    type: array
                    items:
                      type: string
                required:
                  - title
                  - snippets
                additionalProperties: false
          additionalProperties: false
      required:
        - link
        - merchant
        - host
        - name
      additionalProperties: false
    __schema0:
      anyOf:
        - type: object
          properties:
            status:
              type: string
              const: found
            label:
              type: string
            values:
              type: array
              items:
                type: object
                properties:
                  label:
                    type: string
                  value:
                    type: string
                  availability:
                    type: string
                    enum:
                      - in_stock
                      - limited_stock
                      - out_of_stock
                      - preorder
                      - backorder
                  images:
                    type: array
                    items:
                      type: object
                      properties:
                        isFeatured:
                          type: boolean
                        url:
                          type: string
                          format: uri
                      required:
                        - url
                      additionalProperties: false
                  link:
                    type: string
                  nextOption:
                    $ref: '#/components/schemas/__schema0'
                required:
                  - value
                additionalProperties: false
          required:
            - status
            - values
          additionalProperties: false
        - type: object
          properties:
            status:
              type: string
              const: unknown
            message:
              type: string
          required:
            - status
            - message
          additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````