Searching Wiki

Search wiki page text.

For common headers and authentication methods, see Access to the API. For sample scenarios, see API usage examples.

Request

POST

https://api.wiki.yandex.net/v1/search

Body

application/json
{
  "query": "example",
  "filters": {
    "type": "file",
    "authors": [
      {}
    ],
    "cluster": "example",
    "created_at": {
      "from": null,
      "to": null
    },
    "modified_at": null,
    "show_obsolete": false
  },
  "cursor": 1,
  "limit": 10,
  "order_by": "relevancy",
  "highlight": false
}

Name

Description

query

Type: string

Search query text.

Example: example

cursor

Type: integer

The page number, starting from 1.

Default: 1

Min value: 1

Max value: 500

filters

Any of 2 types
  • SearchFilters

    Type: SearchFilters

    Search query conditions.

    Example
    {
      "type": "file",
      "authors": [
        {
          "uid": "example",
          "cloud_uid": "example"
        }
      ],
      "cluster": "example",
      "created_at": {
        "from": "2025-01-01T00:00:00Z",
        "to": "2025-01-01T00:00:00Z"
      },
      "modified_at": null,
      "show_obsolete": false
    }
    
  • Type: null

    Example: null

Filters for the search results.

Example
{
  "type": "file",
  "authors": [
    {
      "uid": null,
      "cloud_uid": null
    }
  ],
  "cluster": "example",
  "created_at": {
    "from": "2025-01-01T00:00:00Z",
    "to": "2025-01-01T00:00:00Z"
  },
  "modified_at": null,
  "show_obsolete": false
}

highlight

Type: boolean

Highlight text fragments that match the query

Default: false

limit

Type: integer

Number of results per page of results

Default: 10

Min value: 1

Max value: 50

order_by

All of 1 type
  • OrderType

    Type: OrderType

    Sort order for the results.

    Enum: relevancy, creation_date, modified_date

Sort order for search results.

Default: relevancy

SearchDocumentType

Resource type for search.

Type: string

Enum: file, page

UserIdentity

User ID

Name

Description

cloud_uid

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

User identifier in the cloud

Example: example

uid

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

Yandex user ID

Example: example

Example
{
  "uid": "example",
  "cloud_uid": "example"
}

DateInterval

Name

Description

from

Any of 2 types
  • Type: string<date-time>

    Example: 2025-01-01T00:00:00Z

  • Type: null

    Example: null

The start of the date and time interval.

Example: 2025-01-01T00:00:00Z

to

Any of 2 types
  • Type: string<date-time>

    Example: 2025-01-01T00:00:00Z

  • Type: null

    Example: null

The end of the date and time interval.

Example: 2025-01-01T00:00:00Z

Example
{
  "from": "2025-01-01T00:00:00Z",
  "to": "2025-01-01T00:00:00Z"
}

SearchFilters

Search query conditions.

Name

Description

authors

Any of 2 types
  • Type: UserIdentity[]

    Example
    [
      {
        "uid": "example",
        "cloud_uid": "example"
      }
    ]
    
  • Type: null

    Example: null

Resource authors to filter by.

Example
[
  {
    "uid": "example",
    "cloud_uid": "example"
  }
]

cluster

Any of 2 types
  • Type: string

    Min length: 1

    Max length: 255

    Example: example

  • Type: null

    Example: null

Page cluster to search in.

Example: example

created_at

Any of 2 types
  • DateInterval

    Type: DateInterval

    Example
    {
      "from": "2025-01-01T00:00:00Z",
      "to": "2025-01-01T00:00:00Z"
    }
    
  • Type: null

    Example: null

Date and time range for resource creation.

Example
{
  "from": "2025-01-01T00:00:00Z",
  "to": "2025-01-01T00:00:00Z"
}

modified_at

Any of 2 types
  • DateInterval

    Type: DateInterval

    Example
    {
      "from": "2025-01-01T00:00:00Z",
      "to": "2025-01-01T00:00:00Z"
    }
    
  • Type: null

    Example: null

Date and time range for the last update to the resource.

Example
{
  "from": "2025-01-01T00:00:00Z",
  "to": "2025-01-01T00:00:00Z"
}

show_obsolete

Type: boolean

Include pages marked as obsolete in the results.

Default: false

type

Any of 2 types
  • SearchDocumentType

    Type: SearchDocumentType

    Resource type for search.

    Enum: file, page

  • Type: null

    Example: null

Type of resource to find.

Example: file

Example
{
  "type": "file",
  "authors": [
    {
      "uid": "example",
      "cloud_uid": "example"
    }
  ],
  "cluster": "example",
  "created_at": {
    "from": "2025-01-01T00:00:00Z",
    "to": "2025-01-01T00:00:00Z"
  },
  "modified_at": null,
  "show_obsolete": false
}

OrderType

Sort order for the results.

Type: string

Enum: relevancy, creation_date, modified_date

Responses

200 OK

OK

Body

application/json
{
  "results": [
    {
      "url": "example",
      "slug": "example",
      "title": "example",
      "content": "example",
      "type": "file",
      "modified_at": "2025-01-01T00:00:00Z"
    }
  ],
  "next_cursor": "example",
  "prev_cursor": "example"
}

Name

Description

results

Type: SearchQueryResponseResult[]

Items on the current page of results

Example
[
  {
    "url": "example",
    "slug": "example",
    "title": "example",
    "content": "example",
    "type": "file",
    "modified_at": "2025-01-01T00:00:00Z"
  }
]

next_cursor

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

A cursor for requesting the next page of results

Example: example

prev_cursor

Any of 2 types
  • Type: string

    Example: example

  • Type: null

    Example: null

Cursor for requesting the previous page of results

Example: example

SearchQueryResponseResult

Name

Description

content

Type: string

Text of the matching resource in the search results.

Example: example

modified_at

Type: string<date-time>

The date and time when the matching resource was last modified.

Example: 2025-01-01T00:00:00Z

slug

Type: string

The address (slug) of the matching resource in Wiki.

Example: example

title

Type: string

Name of the matching resource.

Example: example

type

Type: SearchDocumentType

Type of the resource found.

Resource type for search.

Enum: file, page

url

Type: string

URL of the matching resource.

Example: example

Example
{
  "url": "example",
  "slug": "example",
  "title": "example",
  "content": "example",
  "type": "file",
  "modified_at": "2025-01-01T00:00:00Z"
}
Previous