Search API resources using semantic search

This page applies to Apigee and Apigee hybrid.

The Semantic search add-on helps you quickly find and view the details of your API resources registered in API hub. With its AI-powered search engine, Semantic search can go beyond term "matching" and return results containing terms found anywhere in the detailed API resource entries that are semantically similar to the free text search queries entered.

Free-text search returns the following categories of results:

Console

To search for APIs containing a specific term:

  1. In the Google Cloud console, go to the API hub Semantic search page.

    Go to API hub

  2. Type a search query in the search box.

    For example, you could enter "Order management APIs" or "Spec file for wireless carrier settings".

    You can refine your search by using system attributes within your search query prompt. If you created user attributes when registering your APIs in API hub, you can also incorporate these attributes in your search query prompts.

  3. The Search results are categorized under the following tabs: APIs, Versions, Specifications, Operations, and Deployments. Click one of the tabs to see results for a category. The results display API resources that contain terms semantically similar to the search query you entered.
  4. Click the API resource name to view the detail page for the resource.
  5. To clear the current query, click Clear results.

API

To search your API hub resources using the API hub API, use the searchResources method:

      curl -X POST https://apihub.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION:searchResources \
      -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" \
      -d '{
        "query":"QUERY",
        "filter":"resource_type = RESOURCE_TYPE"
       }'
    

Where:

For example:

      curl -X POST https://apihub.googleapis.com/v1/projects/{project-id}/locations/{location}:searchResources \
      -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" \
      -d '{
        "query":"dog status in the store",
        "filter":"resource_type = SPEC"
        }'

This call returns a paginated list of API hub resources, with resource-specific metadata.

For more information on free-text search with the API hub API, see the API reference documentation for Method:project.locations.searchResources.

To disable the semantic search add-on, do the following:

  1. In the Google Cloud console, go to the API hub > Add-on management page.

    Go to Add-on management

  2. Locate the Semantic search card and click Manage.

    The Semantic search pane appears.

    To disable the add-on, click Disable semantic search, and then click Disable in the confirmation dialog.

  3. Click Save.

To re-enable the semantic search add-on, go to the API hub > Add-on management page, locate the Semantic search card, and click Enable add-on.