Index
WebSearchService(interface)ClientContext(message)SearchInfo(message)SearchQuery(message)SearchQuery.SafeSearchLevel(enum)SearchRequest(message)SearchResponse(message)SearchResult(message)UserContext(message)WebSearch(message)
WebSearchService
WebSearchService provides a unified interface for web search.
| Search |
|---|
|
Performs a full web search based on the provided request parameters. |
ClientContext
Configuration for the Search Engine instance.
| Fields | |
|---|---|
client_id |
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 |
The time taken for the server to return search results. |
total_results |
The estimated total number of search results available for the query. |
formatted_total_results |
The estimated total number of search results, formatted according to locale style. |
corrected_query |
The correctly spelled query. |
html_corrected_query |
The correctly spelled query, formatted in HTML. |
SearchQuery
Common query parameters for standard search operations.
| Fields | |
|---|---|
query |
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 |
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 |
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 |
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. |
safe_search |
Optional. The search safety level. |
sort_expression |
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 |
Optional. Requests results from the specified number of past days. |
weeks |
Optional. Requests results from the specified number of past weeks. |
months |
Optional. Requests results from the specified number of past months. |
years |
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 |
Required. Context surrounding the client. |
user_context |
Required. Context provided about the end user. |
search_query |
Required. Common query parameters for standard search operations. |
page_size |
Optional. Number of search results to return (1-20). Default is 10. |
page_token |
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: |
|
web_search |
Optional. Parameters specific to web search results. |
SearchResponse
Response to a WSS API search request.
| Fields | |
|---|---|
search_results[] |
The set of search results. |
search_info |
Metadata about this search, including timing, total results, and corrections. |
next_page_token |
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 |
The title of the search result, in plain text. |
html_title |
The title of the search result, in HTML. |
display_url |
The full URL to which the search result is pointing, e.g. http://www.example.com/foo/bar. |
shortened_display_url |
A shortened version of this search result's URL, e.g. www.example.com. |
snippet |
The snippet of the search result, in plain text. |
html_snippet |
The snippet of the search result, in HTML. |
mime_type |
The MIME type of the search result. |
file_format |
The file format of the search result. |
UserContext
Context provided about the end user.
| Fields | |
|---|---|
ip_address |
Required. IP address of the end user. |
region_code |
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.