MarketplaceDiscovery / Client / search_facets

search_facets

MarketplaceDiscovery.Client.search_facets(**kwargs)

Returns available facet values for filtering listings, such as categories, pricing models, fulfillment option types, publishers, and customer ratings. Each facet value includes a count of matching listings.

See also: AWS API Documentation

Request Syntax

response = client.search_facets(
    searchText='string',
    filters=[
        {
            'filterType': 'MIN_AVERAGE_CUSTOMER_RATING'|'MAX_AVERAGE_CUSTOMER_RATING'|'CATEGORY'|'PUBLISHER'|'FULFILLMENT_OPTION_TYPE'|'PRICING_MODEL'|'PRICING_UNIT'|'DEPLOYED_ON_AWS'|'NUMBER_OF_PRODUCTS',
            'filterValues': [
                'string',
            ]
        },
    ],
    facetTypes=[
        'AVERAGE_CUSTOMER_RATING'|'CATEGORY'|'PUBLISHER'|'FULFILLMENT_OPTION_TYPE'|'PRICING_MODEL'|'PRICING_UNIT'|'DEPLOYED_ON_AWS'|'NUMBER_OF_PRODUCTS',
    ],
    nextToken='string'
)
Parameters:
  • searchText (string) – The search query text to filter listings before retrieving facets.

  • filters (list) –

    Filters to apply before retrieving facets. Multiple filters are combined with AND logic. Multiple values within the same filter are combined with OR logic.

    • (dict) –

      A filter used to narrow search results by attribute, such as category, pricing model, or fulfillment type.

      • filterType (string) – [REQUIRED]

        The type of filter to apply.

      • filterValues (list) – [REQUIRED]

        The values to filter by. Term filters accept multiple values (OR logic). Range filters (MIN/MAX_AVERAGE_CUSTOMER_RATING) accept a single value between 0.0 and 5.0.

        • (string) –

  • facetTypes (list) –

    A list of specific facet types to retrieve. If empty or null, all available facets are returned.

    • (string) –

  • nextToken (string) – If nextToken is returned, there are more results available. Make the call again using the returned token to retrieve the next page.

Return type:

dict

Returns:

Response Syntax

{
    'totalResults': 123,
    'listingFacets': {
        'string': [
            {
                'value': 'string',
                'displayName': 'string',
                'parent': 'string',
                'count': 123
            },
        ]
    },
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • totalResults (integer) –

      The total number of listings matching the search criteria.

    • listingFacets (dict) –

      A map of facet types to their corresponding facet values. Each facet value includes a display name, internal value, and count of matching listings.

      • (string) –

        • (list) –

          • (dict) –

            A facet value with display information and a count of matching listings. Used to build filter and browse experiences.

            • value (string) –

              The internal value used for filtering when passed back in a search filter.

            • displayName (string) –

              The human-readable name of the facet value, suitable for display in a user interface.

            • parent (string) –

              The parent facet value for hierarchical facets, such as subcategories.

            • count (integer) –

              The number of listings matching this facet value.

    • nextToken (string) –

      If nextToken is returned, there are more results available. Make the call again using the returned token to retrieve the next page.

Exceptions

  • MarketplaceDiscovery.Client.exceptions.ThrottlingException

  • MarketplaceDiscovery.Client.exceptions.AccessDeniedException

  • MarketplaceDiscovery.Client.exceptions.ValidationException

  • MarketplaceDiscovery.Client.exceptions.InternalServerException