SearchListings
Searches listings in Amazon DataZone.
SearchListings is a powerful capability that enables users to discover and explore published assets and data products across their organization. It provides both basic and advanced search functionality, allowing users to find resources based on names, descriptions, metadata, and other attributes. SearchListings also supports filtering using various criteria such as creation date, owner, or status. This API is essential for making the wealth of data resources in an organization discoverable and usable, helping users find the right data for their needs quickly and efficiently.
SearchListings returns results in a paginated format. When the result set is large, the response will include a nextToken, which can be used to retrieve the next page of results.
The SearchListings API gives users flexibility in specifying what kind of search is run.
To run a free-text search, the searchText parameter must be supplied. By default, all searchable fields are indexed for semantic search and will return semantic matches for SearchListings queries. To prevent semantic search indexing for a custom form attribute, see the CreateFormType API documentation. To run a lexical search query, enclose the query with double quotes (""). This will disable semantic search even for fields that have semantic search enabled and will only return results that contain the keywords wrapped by double quotes (order of tokens in the query is not enforced). Free-text search is supported for all attributes annotated with @amazon.datazone#searchable.
To run a filtered search, provide filter clause using the filters parameter. To filter on glossary terms, use the special attribute __DataZoneGlossaryTerms.
To find out whether an attribute has been annotated and indexed for a given search type, use the GetFormType API to retrieve the form containing the attribute.
Request Syntax
POST /v2/domains/domainIdentifier/listings/search HTTP/1.1
Content-type: application/json
{
"additionalAttributes": [ "string" ],
"aggregations": [
{
"attribute": "string",
"displayValue": "string"
}
],
"filters": { ... },
"maxResults": number,
"nextToken": "string",
"searchIn": [
{
"attribute": "string"
}
],
"searchText": "string",
"sort": {
"attribute": "string",
"order": "string"
}
}
URI Request Parameters
The request uses the following URI parameters.
- domainIdentifier
-
The identifier of the domain in which to search listings.
Pattern:
dzd[-_][a-zA-Z0-9_-]{1,36}Required: Yes
Request Body
The request accepts the following data in JSON format.
- additionalAttributes
-
Specifies additional attributes for the search.
Type: Array of strings
Valid Values:
FORMS | TIME_SERIES_DATA_POINT_FORMS | TEXT_MATCH_RATIONALERequired: No
- aggregations
-
Enables you to specify one or more attributes to compute and return counts grouped by field values.
Type: Array of AggregationListItem objects
Array Members: Minimum number of 1 item. Maximum number of 10 items.
Required: No
- filters
-
Specifies the filters for the search of listings.
Type: FilterClause object
Note: This object is a Union. Only one member of this object can be specified or returned.
Required: No
- maxResults
-
The maximum number of results to return in a single call to
SearchListings. When the number of results to be listed is greater than the value ofMaxResults, the response contains aNextTokenvalue that you can use in a subsequent call toSearchListingsto list the next set of results.Type: Integer
Valid Range: Minimum value of 1. Maximum value of 50.
Required: No
- nextToken
-
When the number of results is greater than the default value for the
MaxResultsparameter, or if you explicitly specify a value forMaxResultsthat is less than the number of results, the response includes a pagination token namedNextToken. You can specify thisNextTokenvalue in a subsequent call toSearchListingsto list the next set of results.Type: String
Length Constraints: Minimum length of 1. Maximum length of 8192.
Required: No
- searchIn
-
The details of the search.
Type: Array of SearchInItem objects
Array Members: Minimum number of 1 item. Maximum number of 10 items.
Required: No
- searchText
-
Specifies the text for which to search.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 512.
Required: No
- sort
-
Specifies the way for sorting the search results.
Type: SearchSort object
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"aggregates": [
{
"attribute": "string",
"displayValue": "string",
"items": [
{
"count": number,
"displayValue": "string",
"value": "string"
}
]
}
],
"items": [
{ ... }
],
"nextToken": "string",
"totalMatchCount": number
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- aggregates
-
Contains computed counts grouped by field values based on the requested aggregation attributes for the matching listings.
Type: Array of AggregationOutput objects
- items
-
The results of the
SearchListingsaction.Type: Array of SearchResultItem objects
- nextToken
-
When the number of results is greater than the default value for the
MaxResultsparameter, or if you explicitly specify a value forMaxResultsthat is less than the number of results, the response includes a pagination token namedNextToken. You can specify thisNextTokenvalue in a subsequent call toSearchListingsto list the next set of results.Type: String
Length Constraints: Minimum length of 1. Maximum length of 8192.
- totalMatchCount
-
Total number of search results.
Type: Integer
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You do not have sufficient access to perform this action.
HTTP Status Code: 403
- InternalServerException
-
The request has failed because of an unknown error, exception or failure.
HTTP Status Code: 500
- ThrottlingException
-
The request was denied due to request throttling.
HTTP Status Code: 429
- UnauthorizedException
-
You do not have permission to perform this action.
HTTP Status Code: 401
- ValidationException
-
The input fails to satisfy the constraints specified by the AWS service.
HTTP Status Code: 400
Examples
Example
This example illustrates a lexical search.
Sample Request
aws datazone search-listings \
--domain-identifier "dzd_4q2el0k35ngqa8" \
--search-in '[{"attribute":"DataProductMetadataForm.name"}]' \
--search-text "\"car\"" \
--additional-attributes '["FORMS"]'
Sample Response
{
"items": [
{
"assetListing": {
"additionalAttributes": {
"forms": "{\"S3ObjectCollectionForm\":{\"bucketArn\":\"arn:aws:s3:::bucket/prefix\"},\"DataProductMetadataForm\":{\"name\":\"car\"}}"
},
"createdAt": "2025-08-28T21:41:17.026000+00:00",
"entityId": "asl5ff7g6psoi8",
"entityRevision": "4",
"entityType": "S3ObjectCollectionAssetType",
"glossaryTerms": [],
"listingCreatedBy": "f697efa1-8b40-41c1-b1ef-977412f9d3d4",
"listingId": "3tgx25pz22pic0",
"listingRevision": "6",
"listingUpdatedBy": "f697efa1-8b40-41c1-b1ef-977412f9d3d4",
"name": "test",
"owningProjectId": "4mo2oiauaqbrtc"
}
}
],
"totalMatchCount": 1
}
Example
This example illustrates the filtering capabilities of the SearchListings APIs.
Note: __DataZoneGlossaryTerms is a special keyword for getting all aggregated glossary terms across assets, custom metadata forms and columns.
Sample Request
aws datazone search-listings \
--domain-identifier "dzd_4q2el0k35ngqa8" \
--filters '{ "or": [
{ "filter": { "attribute": "__DataZoneGlossaryTerms", "value": "cxjyge917oaaa8" } },
{ "filter": { "attribute": "__DataZoneGlossaryTerms", "value": "46i8vpwe0s0t9j" } }
] }'
Sample Response
{
"items": [
{
"assetListing": {
"createdAt": "2025-09-05T16:53:55.563000+00:00",
"entityId": "dgutcpgqbkbcsw",
"entityRevision": "2",
"entityType": "S3ObjectCollectionAssetType",
"glossaryTerms": [
{
"name": "artist"
}
],
"listingCreatedBy": "f697efa1-8b40-41c1-b1ef-977412f9d3d4",
"listingId": "anj2uue0h4qd1s",
"listingRevision": "2",
"listingUpdatedBy": "f697efa1-8b40-41c1-b1ef-977412f9d3d4",
"name": "blab",
"owningProjectId": "4mo2oiauaqbrtc"
}
}
],
"totalMatchCount": 1
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: