---
title: "Search for Wikipedia context with natural language"
method: GET
path: "/v1/wiki/search"
tags: ["wiki"]
---

# Search for Wikipedia context with natural language

`GET /v1/wiki/search`

Search on Wikipedia content with natural language. Find exactly relevant chunks,
with contextual neighbor chunks, and the full articles they came from.

## Query parameters

- `query` string — Natural language query that can be any phrase, keyword, question, or paragraph.
- `neighbor_chunks` integer, nullable — Number of neighbor chunks to attach and return. If 0, then no neighbor chunks will be returned.
- `n_documents` integer, nullable — Number of documents to return. If 0, then no documents will be returned.
- `full_articles` boolean, nullable — If true, then full articles will be returned. If false, then only chunks and their neighbors will be returned. Beware that returning full articles increases data size which increases token usage downstream.
- `hybrid_search` boolean, nullable — If true, then hybrid search will be used. If false, then only vector search will be used.
- `string_guarantee` string[], nullable — List of strings that must be present in the results. If empty, then no string guarantee will be applied.
- `diversify` number, nullable — Diversity factor for MMR re-ranking. 0.0 means no diversity (pure relevance), 1.0 means full diversity.
- `include_main_section` boolean, nullable — If true, then the main section of the article will be included at the start of each chunk's content. If false, then only the chunk content will be returned. Useful because the main section often contains important context.

## Response `200`

A string or a list of dictionaries

- WikiSearchResponse
  - `documents` WikiResponseDictItem[], required
    - `content` string, required
    - `title` string, required
    - `url` string, required
    - `categories` string[], required
    - `timestamp` string, date-time, required
    - `cirrus_metadata` CirrusMetadata
      - `create_timestamp` string, date-time, required
      - `wikibase_item` string, required
      - `version` integer, required
      - `popularity_score` number, required
      - `text_bytes` integer, required
    - `point_id` string, nullable

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `405` — Method Not Allowed
- `422` — Unprocessable Entity
- `500` — Internal Server Error

---

[API](https://skmtc.dev/asknews/apis/asknews-api.md) · [All operations](https://skmtc.dev/asknews/apis/asknews-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/asknews/asknews-api/revisions/dd4286769887/schema)
