Web Search API, REST: WebSearchAsync.Search
HTTP request
POST https://searchapi.api.cloud.yandex.net/v2/web/searchAsync
Body parameters
{
"query": {
"searchType": "string",
"queryText": "string",
"familyMode": "string",
"page": "string"
},
"sortSpec": {
"sortMode": "string",
"sortOrder": "string"
},
"groupSpec": {
"groupMode": "string",
"groupsOnPage": "string",
"docsInGroup": "string"
},
"maxPassages": "string",
"region": "string",
"l10n": "string",
"folderId": "string"
}
Field |
Description |
query |
Required field. Search query. |
sortSpec |
The rules for sorting search results that define the sequence of the returned search results. |
groupSpec |
Grouping settings that are used to group documents from a single domain into a container. |
maxPassages |
string (int64) The maximum number of passages that can be used when generating a document snippet. |
region |
string ID of the search country or region that impacts the document ranking rules. |
l10n |
enum (Localization) The notification language for a search response.
|
folderId |
string ID of the folder. |
SearchQuery
Field |
Description |
searchType |
enum (SearchType) Required field. Search type that determines the domain name that will be used for the search queries.
|
queryText |
string Required field. Search query text |
familyMode |
enum (FamilyMode) Rule for filtering search results and determines whether any documents should be excluded.
|
page |
string (int64) The number of a requested page with search results |
SortSpec
Field |
Description |
sortMode |
enum (SortMode) Documents sorting mode.
|
sortOrder |
enum (SortOrder) Documents sorting order.
|
GroupSpec
Field |
Description |
groupMode |
enum (GroupMode) Grouping method.
|
groupsOnPage |
string (int64) Maximum number of groups that can be returned per page with search results. |
docsInGroup |
string (int64) Maximum number of documents that can be returned per group. |
Response
HTTP Code: 200 - OK
{
"id": "string",
"description": "string",
"createdAt": "string",
"createdBy": "string",
"modifiedAt": "string",
"done": "boolean",
"metadata": "object",
// Includes only one of the fields `error`, `response`
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
},
"response": {
"rawData": "string"
}
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
Field |
Description |
id |
string ID of the operation. |
description |
string Description of the operation. 0-256 characters long. |
createdAt |
string (date-time) Creation timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
createdBy |
string ID of the user or service account who initiated the operation. |
modifiedAt |
string (date-time) The time when the Operation resource was last modified. String in RFC3339 To work with values in this field, use the APIs described in the |
done |
boolean If the value is |
metadata |
object Service-specific metadata associated with the operation. |
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
response |
The normal response of the operation in case of success. Includes only one of the fields The operation result. |
Status
The error result of the operation in case of failure or cancellation.
Field |
Description |
code |
integer (int32) Error code. An enum value of google.rpc.Code |
message |
string An error message. |
details[] |
object A list of messages that carry the error details. |
WebSearchResponse
Field |
Description |
rawData |
string (bytes) Required field. Search results, usually in XML format. |