Required. The resource name of the location which will be of the type projects/{projectId}/locations/{locationId}. This field is used to identify the instance of API-Hub in which resources should be searched.
Request body
The request body contains data with the following structure:
Required. The free text search query. This query can contain keywords which could be related to any detail of the API-Hub resources such display names, descriptions, attributes etc.
filter
string
Optional. An expression that filters the list of search results.
A filter expression consists of a field name, a comparison operator, and a value for filtering. The value must be a string, a number, or a boolean. The comparison operator must be =. Filters are not case sensitive.
The following field names are eligible for filtering: * resource_type - The type of resource in the search results. Must be one of the following: Api, ApiOperation, Deployment, Definition, Spec or Version. This field can only be specified once in the filter.
Here are is an example:
resource_type = Api - The resource_type is Api.
pageSize
integer
Optional. The maximum number of search results to return. The service may return fewer than this value. If unspecified at most 10 search results will be returned. If value is negative then INVALID_ARGUMENT error is returned. The maximum value is 25; values above 25 will be coerced to 25. While paginating, you can specify a new page size parameter for each page of search results to be listed.
pageToken
string
Optional. A page token, received from a previous [locations.searchResources][locations.searchResources] call. Specify this parameter to retrieve the next page of transactions.
When paginating, you must specify the pageToken parameter and all the other parameters except pageSize should be specified with the same value which was used in the previous call. If the other fields are set with a different value than the previous call then INVALID_ARGUMENT error is returned.
List of search results according to the filter and search query specified. The order of search results represents the ranking.
nextPageToken
string
Pass this token in the SearchResourcesRequest to continue to list results. If all results have been returned, this field is an empty string or not present in the response.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
IAM Permissions
Requires the following IAM permission on the location resource:
This represents the ApiHubResource. Note: Only selected fields of the resources are populated in response.
ApiHubResource
ApiHubResource is one of the resources such as Api, Operation, Deployment, Definition, Spec and Version resources stored in API-Hub.
JSON representation
{// Union field resource can be only one of the following:"api": {object (Api)},"operation": {object (ApiOperation)},"deployment": {object (Deployment)},"spec": {object (Spec)},"definition": {object (Definition)},"version": {object (Version)}// End of list of possible types for union field resource.}
This represents Deployment resource in search results. Only name, displayName, description, deploymentType and apiVersions fields are populated in search results.
This represents Spec resource in search results. Only name, displayName, description, specType and documentation fields are populated in search results.
This represents Version resource in search results. Only name, displayName, description, lifecycle, compliance and accreditation fields are populated in search results.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-28 UTC."],[[["\u003cp\u003eThis API enables searching across API-Hub resources using a \u003ccode\u003ePOST\u003c/code\u003e request to a specific URL, requiring the \u003ccode\u003elocation\u003c/code\u003e path parameter to identify the API-Hub instance.\u003c/p\u003e\n"],["\u003cp\u003eThe request body includes a mandatory \u003ccode\u003equery\u003c/code\u003e field for free text search, an optional \u003ccode\u003efilter\u003c/code\u003e field for refining results by resource type, and optional pagination fields (\u003ccode\u003epageSize\u003c/code\u003e, \u003ccode\u003epageToken\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe API response contains a list of \u003ccode\u003esearchResults\u003c/code\u003e, which are ranked, and can be further navigated using the \u003ccode\u003enextPageToken\u003c/code\u003e for paginated results.\u003c/p\u003e\n"],["\u003cp\u003eThe result will be a \u003ccode\u003eApiHubResource\u003c/code\u003e object, such as \u003ccode\u003eApi\u003c/code\u003e, \u003ccode\u003eOperation\u003c/code\u003e, \u003ccode\u003eDeployment\u003c/code\u003e, \u003ccode\u003eSpec\u003c/code\u003e, \u003ccode\u003eDefinition\u003c/code\u003e, or \u003ccode\u003eVersion\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization for this API requires the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope and the \u003ccode\u003eapihub.apis.list\u003c/code\u003e IAM permission on the specified location.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.searchResources\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.SearchResourcesResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [IAM Permissions](#body.aspect_1)\n- [SearchResult](#SearchResult)\n - [JSON representation](#SearchResult.SCHEMA_REPRESENTATION)\n- [ApiHubResource](#ApiHubResource)\n - [JSON representation](#ApiHubResource.SCHEMA_REPRESENTATION)\n\nSearch across API-Hub resources.\n\n### HTTP request\n\n`POST https://apihub.googleapis.com/v1/{location=projects/*/locations/*}:searchResources`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nResponse for the [locations.searchResources](/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/searchResources#google.cloud.apihub.v1.ApiHub.SearchResources) method.\n\nIf successful, the response body contains data with the following structure:\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `location` resource:\n\n- `apihub.apis.list`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs).\n\nSearchResult\n------------\n\nRepresents the search results.\n\nApiHubResource\n--------------\n\nApiHubResource is one of the resources such as Api, Operation, Deployment, Definition, Spec and Version resources stored in API-Hub."]]