searchListings

Returns a list of product listings based on search criteria and filters. You can search by keyword, filter by category, pricing model, fulfillment type, and other attributes, and sort results by relevance or customer rating.

Samples

import aws.sdk.kotlin.services.marketplacediscovery.model.SearchFilter
import aws.sdk.kotlin.services.marketplacediscovery.model.SearchFilterType
import aws.sdk.kotlin.services.marketplacediscovery.model.SearchListingsSortBy
import aws.sdk.kotlin.services.marketplacediscovery.model.SearchListingsSortOrder

fun main() { 
   //sampleStart 
   // Search for SaaS listings in the machine learning category with sorting by relevance
val resp = marketplaceDiscoveryClient.searchListings {
    searchText = "computer vision"
    filters = listOf<SearchFilter>(
        SearchFilter {
            filterType = SearchFilterType.fromValue("CATEGORY")
            filterValues = listOf<String>(
                "machine-learning"
            )
        },
        SearchFilter {
            filterType = SearchFilterType.fromValue("FULFILLMENT_OPTION_TYPE")
            filterValues = listOf<String>(
                "SAAS"
            )
        }            
    )
    maxResults = 25
    sortBy = SearchListingsSortBy.fromValue("RELEVANCE")
    sortOrder = SearchListingsSortOrder.fromValue("DESCENDING")
} 
   //sampleEnd
}