Migrate from Custom Search Site Restricted JSON API

If you use theCustom Search Site Restricted JSON API of Programmable Search Engine, you can create anddeploy Google-quality, site-restricted search in minutes, usingVertex AI Search. To deploy your app, you can use thesearchwidget by copying code from the Google Cloud console directly into aweb page—no coding required. Or, you can implement an APIdeployment to have control over how search functionality looks on your website.For more information about using the API, see the REST tab ofGet searchresults for an app with website data and theservingConfigs.search method in the REST reference.

In addition to the standard short snippets thatVertex AI Search returns with search results, you can addadvanced features to your search. These include generatedsummaries of search results,search with follow-ups for context-aware search that allows follow-up questions,andextractive answers for extracted text returned witheach search result. Getting these advanced features for your web search requiresdomain verification and incurs additional indexing costs.

You can alsofilter ororder yoursearch results and applypromote controls to display a link as a promoted result.

For more information, see theVertex AI Search pricing page.

Set up Vertex AI Search

To set up Vertex AI Search, follow these steps:

  1. In the Google Cloud console, on theproject selectorpage, select the project that you've beenusing for the Custom Search Site Restricted JSON API.

  2. Turn on Vertex AI Search.

Create a search app

To create a search app, follow these steps:

  1. In the Google Cloud console, go to theAI Applications page.

    AI Applications

  2. ClickCreate app.

  3. On theCreate App page, underSite search with AI mode, clickCreate.

  4. Make sureEnterprise edition features is turned on. This is requiredfor website search. For more information, seeEnterprise editionfeatures.

  5. Turn offGenerative Responses. Turning this off gives youfunctionality similar to the Custom Search Site Restricted JSON API ofProgrammable Search Engine. Turn this off if you don't need searchsummarization or search with follow-ups. For more information, seeGenerative responses.

  6. In theYour app name field, enter a name for your app.

  7. In theExternal name of your company or organization field, enterthe common name for your company or organization.

  8. Selectglobal (Global) as the location for your app, and then clickContinue.

  9. On theData Stores page, clickCreate data store.

  10. In theSelect a data source pane, selectWebsite Content.

  11. Turn offAdvanced website indexing indexing. Turning this off givesyou functionality similar to the Custom Search Site Restricted JSON APIof Programmable Search Engine. Turn this off if you don't need searchsummarization or search with follow-ups, or if you don't own thedomains that you specify. For more information, seeAdvanced website indexing.

  12. In theSpecify URL patterns to index pane, in theSitesto include field, enter the URL patterns of the websites that you wantto search, and then clickContinue.

  13. In theConfigure your data store pane, enter a display name for yourdata store, and then clickCreate.

  14. On theData Stores page, select your new data store, and then clickCreate.

Deploy the search app

Decide how you plan to authenticate your Vertex AI Search searchapp: using OAuth 2.0 or an API key. For information about the advantages anddisadvantages of each method, seeAboutauthentication.

Deploy the search app (OAuth 2.0)

To deploy your search app using OAuth 2.0 authentication, follow these steps:

  1. To set up OAuth 2.0, seeOn Google Cloud inAuthenticate toVertex AI Search. Make sure to add theDiscovery EngineUser or theDiscovery EngineViewer role to the service account.

  2. Deploy your search app in one of the following ways:

Deploy the search app (API key)

To deploy your search app using an API key for authentication, follow thesesteps:

  1. Create the API key:

    1. In the Google Cloud console, go to theCredentials page.

      Credentials

    2. If you're not already in your project, in the project list at the top ofthe Google Cloud console page, select your project.

    3. ClickCreate credentials and then selectAPI key.Don't add any referrer restrictions. Some user privacy settings don'tpass the referrer URL.

      • Take note of the generated API key, which you will use when callingthesearchLite method.
    4. For increased security, add anHTTP restrictionto your API Key to restrict access to the Vertex AI Search serviceathttps://discoveryengine.googleapis.com/*.

  2. Deploy your search app using the API.SeeGet search results for an app with website data (APIkey) and theservingConfigs.searchLite method in theREST reference. To order the results of your web search queries, seeOrderweb search results.

About authentication

TheCustom Search Site Restricted JSON API ofProgrammable Search Engine authenticates using an API key. While, with acouple of exceptions, Vertex AI Search requires OAuth 2.0.If you want to carry on using an API key for authentication, then you need touse thesearchLite method through API calls.

If you choose to authenticate through OAuth 2.0, then you need to use thesearch method and theanswer method to queryyour website, furthermore, you can deploy your search app through the no-codesearch widget.

The following table lists differences between using thesearchLite method withAPI key authentication and thesearch andanswer methods with OAuth 2.0authentication.

Feature/MethodssearchLite methodsearch method
AuthenticationAPI keyOAuth 2.0
Search widget available
Search summaries
Search public websites

Next steps

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.