search_listings
async
¶
search_listings(
*,
config_overrides: Optional[AsyncMarketplaceDiscoveryClientConfig] = None,
locale: Optional[Locale] = None,
search_text: Optional[SearchText] = None,
filters: Optional[SearchFilterList] = None,
max_results: Optional[MaxResults] = None,
sort_by: Optional[SearchListingsSortBy] = None,
sort_order: Optional[SearchListingsSortOrder] = None,
next_token: Optional[NextToken] = None,
) -> SearchListingsOutput
Searches for listings that match your 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. The operation returns results in pages. Use nextToken to retrieve the next page.
Parameters:
-
locale(Optional[Locale], default:None) –The preferred locale for response content, as a Best Current Practice 47 (BCP 47) language tag or a comma-separated priority list of language tags. See
Localefor supported values, constraints, fallback behavior, and the default locale. If you omit this field, the service returns content in the default locale. -
search_text(Optional[SearchText], default:None) –The search query text to find relevant listings.
-
filters(Optional[SearchFilterList], default:None) –Filters to narrow search results. A result must match every filter. Within one filter, a result matches if it has any of the values.
-
max_results(Optional[MaxResults], default:None) –The maximum number of listings to return in each call. If you omit this field, the default is 25. Use
nextTokento retrieve the next page. -
sort_by(Optional[SearchListingsSortBy], default:None) –The field to sort results by. If you do not specify a value, the service sorts by
RELEVANCE. This field has one of the following values:- AVERAGE_CUSTOMER_RATING
-
Sorts by average customer rating.
- RELEVANCE
-
Sorts by relevance to the search query.
-
sort_order(Optional[SearchListingsSortOrder], default:None) –The sort direction. If you do not specify a value, the service sorts in
DESCENDINGorder. This field has one of the following values:- ASCENDING
-
Sorts from lowest to highest.
- DESCENDING
-
Sorts from highest to lowest.
-
next_token(Optional[NextToken], default:None) –If the service returns
nextToken, more results are available. The value ofnextTokenis a unique pagination token for each page. Make the call again with the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. An expired pagination token returns aValidationException.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this action. Verify that you have the required permissions.
-
InternalServerException–Unexpected error during processing of the request.
-
ThrottlingException–The request was denied due to request throttling. Reduce the frequency of your requests and retry.
-
ValidationException–The input fails to satisfy the constraints specified by the service. Check the
reasonfield for the constraint that failed. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Search for machine learning listings Search for ISO 27001 certified SaaS listings in the machine learning category, sorted by relevance
>>> await client.search_listings(locale='en-US', search_text='computer vision', filters=[{'filterType': 'CATEGORY', 'filterValues': ['machine-learning']}, {'filterType': 'FULFILLMENT_OPTION_TYPE', 'filterValues': ['SAAS']}, {'filterType': 'CERTIFICATES', 'filterValues': ['ISO_27001']}], max_results=25, sort_by='RELEVANCE', sort_order='DESCENDING')
Search listings with a Trust Center source and no certifications
Return Trust Center source information when no certifications are available
>>> await client.search_listings(locale='en-US', search_text='security', filters=[{'filterType': 'TRUST_CENTER', 'filterValues': ['HAS_TRUST_CENTER']}], max_results=1)
Source code in docs_src/capo_marketplace_discovery/_services/async_marketplace_discovery.py
1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 | |