---
title: "Search for nearest neighbors"
method: POST
path: "/api/v1/vector/search"
---

# Search for nearest neighbors

`POST /api/v1/vector/search`

Return the top `k` records for a query. Provide exactly one of `vector`
(approximate nearest neighbor search) or `bm25` (full-text BM25 search
over a text field); the two are mutually exclusive. Optionally filter
results by metadata attributes using a filter expression.

The `nprobe` parameter controls how many posting lists are searched for
ANN queries. Higher values improve recall at the cost of latency.

The `includeFields` parameter controls which attributes are returned
for each result. When omitted, all attributes are returned.

Supports both binary protobuf (`application/protobuf`) and ProtoJSON
(`application/protobuf+json`) request bodies.

## Response `200`

Search results ranked by similarity.

## Other responses

- `400` — Invalid input (empty vector, k is 0, malformed filter).
- `500` — Internal server error.

---

[API](https://skmtc.net/opendata-oss/apis/opendata-vector-api.md) · [All operations](https://skmtc.net/opendata-oss/apis/opendata-vector-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/opendata-oss/opendata-vector-api/versions/c2b4afb0cdb8/schema)
