Package google.search.wss.v1

Index

WebSearchService

WebSearchService provides a unified interface for web search.

Search

rpc Search(SearchRequest) returns (SearchResponse)

Performs a full web search based on the provided request parameters.

ClientContext

Configuration for the Search Engine instance.

Fields
client_id

string

Required. Client web property. The standard format is: partner-[name]-[product]-[feature set] Example: partner-example-wss-standard for an example using standard web search.

SearchInfo

Metadata about the search operation.

Fields
search_duration

Duration

The time taken for the server to return search results.

total_results

int64

The estimated total number of search results available for the query.

formatted_total_results

string

The estimated total number of search results, formatted according to locale style.

corrected_query

string

The correctly spelled query.

html_corrected_query

string

The correctly spelled query, formatted in HTML.

SearchQuery

Common query parameters for standard search operations.

Fields
query

string

Required. The search query string.

Many search features can be represented directly in the query string using Google Search operators (see https://support.google.com/websearch/answer/2466433):

language_code

string

Optional. --- Language & Region --- Sets the user interface language. See https://developers.google.com/web-search-service/xml/web-search/reference/appendixes.html#supported_interface_languages for a list of supported languages.

restrict_language_code

string

Optional. Restricts search to documents written in a particular language. See https://developers.google.com/web-search-service/xml/web-search/reference/appendixes.html#language_collection_values for a list of supported languages.

restrict_region_code

string

Optional. Restricts search results to documents originating in a particular country. Only two letter country codes (ISO 3166) are valid. See https://developers.google.com/web-search-service/xml/web-search/reference/appendixes.html#supported_country_codes for a list of supported countries.

sort_expression

string

Optional. --- Sorting & Range --- The sort expression to apply to the results (e.g., sort=date).

Union field date_restrict. Restricts results to URLs based on date. date_restrict can be only one of the following:
days

int32

Optional. Requests results from the specified number of past days.

weeks

int32

Optional. Requests results from the specified number of past weeks.

months

int32

Optional. Requests results from the specified number of past months.

years

int32

Optional. Requests results from the specified number of past years.

SafeSearchLevel

--- Safety & Filters ---

Enums
SAFE_SEARCH_LEVEL_UNSPECIFIED The safe search level is not specified.
OFF Turns off SafeSearch.
ON Turns on SafeSearch.

SearchRequest

Request message for WebSearchService.Search.

Fields
client_context

ClientContext

Required. Context surrounding the client.

user_context

UserContext

Required. Context provided about the end user.

search_query

SearchQuery

Required. Common query parameters for standard search operations.

page_size

int32

Optional. Number of search results to return (1-20). Default is 10.

page_token

string

Optional. The next page token from the Web Search response.

Union field search_mode. One search mode must be populated. An empty proto can be a valid selection. search_mode can be only one of the following:

SearchResponse

Response to a WSS API search request.

Fields
search_results[]

SearchResult

The set of search results.

search_info

SearchInfo

Metadata about this search, including timing, total results, and corrections.

next_page_token

string

Token to retrieve the next page of results. Include this token in the subsequent SearchRequest.page_token field. Will be empty if there are no more results.

SearchResult

Represents a single search result item.

Fields
title

string

The title of the search result, in plain text.

html_title

string

The title of the search result, in HTML.

display_url

string

The full URL to which the search result is pointing, e.g. http://www.example.com/foo/bar.

shortened_display_url

string

A shortened version of this search result's URL, e.g. www.example.com.

snippet

string

The snippet of the search result, in plain text.

html_snippet

string

The snippet of the search result, in HTML.

mime_type

string

The MIME type of the search result.

file_format

string

The file format of the search result.

UserContext

Context provided about the end user.

Fields
ip_address

string

Required. IP address of the end user.

region_code

string

Optional. Region code of end user. Only two letter country codes (ISO 3166) are valid.

WebSearch

This type has no fields.

Parameters specific to web page search.