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

# Recent Searches

> Returns recent search terms for a given shopper within a catalog.

The result count is capped at 50 server-side regardless of the requested `limit`. This is the only Search endpoint that identifies the shopper with a query parameter rather than a header.

Before calling this endpoint, make sure you've generated an API token and picked the correct domain. See [Authentication & Base URLs](/api-reference/authbaseurl).

<Note>This is the only Search endpoint that identifies the shopper with a query parameter (`user_id`) rather than a header. Results are capped at 50 regardless of `limit`.</Note>


## OpenAPI

````yaml GET /discovery/search/recent-searches
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://apis.experro.app
    description: Admin Server
  - url: https://{base-address}
    description: Custom Server
    variables:
      base-address:
        default: ''
        description: Enter your custom domain or server address.
security:
  - bearerAuth: []
paths:
  /discovery/search/recent-searches:
    get:
      summary: Get a Shopper's Recent Search Terms
      description: >-
        Returns recent search terms for a given shopper within a catalog.


        The result count is capped at 50 server-side regardless of the requested
        `limit`. This is the only Search endpoint that identifies the shopper
        with a query parameter rather than a header.
      parameters:
        - $ref: '#/components/parameters/StorefrontTenantIdHeader'
        - $ref: '#/components/parameters/StorefrontWorkspaceIdHeader'
        - $ref: '#/components/parameters/StorefrontEnvironmentIdHeader'
        - name: catalog_id
          in: query
          description: Catalog to return recent searches for.
          required: true
          schema:
            type: string
        - name: user_id
          in: query
          description: Shopper to return recent searches for.
          schema:
            type: string
        - name: limit
          in: query
          description: Maximum number of terms to return. Hard-capped at 50 server-side.
          schema:
            type: integer
            default: 5
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                description: Response payload.
        '400':
          description: >-
            The request could not be parsed or validated. `Invalid Input` almost
            always means a request-body problem rather than a bad field value:


            - The `Content-Type` is missing or is not `application/json`.

            - The body was sent as form data instead of raw JSON.

            - The body is empty, or is not valid JSON.

            - An optional field was sent **blank rather than omitted** — for
            example `"sort_order": ""`, `"hero_variant_option_override": {}`, or
            `"filters": [{}]`. Omit a field you are not using, or send `null` or
            `[]`; an empty string or empty object is rejected.

            - A numeric field was sent as a string, such as `"limit": "24"`
            instead of `"limit": 24`.


            A missing required query parameter returns a more specific message,
            for example `Query deserialize error: missing field \`catalog_id\``.
      security: []
      servers:
        - url: https://{base-address}
          description: Custom Server
          variables:
            base-address:
              default: ''
              description: Enter your custom domain or server address.
components:
  parameters:
    StorefrontTenantIdHeader:
      name: x-tenant-id
      in: header
      required: true
      schema:
        type: string
      description: Identifies your organization. Ensures data isolation per tenant.
    StorefrontWorkspaceIdHeader:
      name: x-workspace-id
      in: header
      required: true
      schema:
        type: string
      description: >-
        Identifies the workspace within your organization. Scopes resources to a
        specific workspace.
    StorefrontEnvironmentIdHeader:
      name: x-environment-id
      in: header
      required: true
      schema:
        type: string
      description: >-
        Identifies the environment you are targeting. Scopes the call to a
        specific deployment environment.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````