Skip to main content

Nearest Neighbors By Ids

posthttps://api-atlas.nomic.ai/v1/dataset/data/get/nearest_neighbors/by_id

⚠️ WARNING

This endpoint is unstable & not officially supported. It may be deprecated and removed in future API versions.

Nearest Neighbors By Ids

Request​

Body (required) application/json

atlas_index_idstring*required

Unique atlas index id

datum_idsarray<string>

The datum ids to query.

atom_idsarray<string>

The atom ids to query.

kinteger

The number of neighbors to return

Default: 4

Responses​

200Successful Response
neighborsarray<array<string>>*required

nested list of nearest neighbors

distancesarray<array<number>>*required

distances of the neighbors to queries

422Validation Error

Examples​

curl
curl -X 'POST' \
'https://api-atlas.nomic.ai/v1/dataset/data/get/nearest_neighbors/by_id' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"atlas_index_id": "string",
"datum_ids": [
"string"
],
"atom_ids": [
"string"
],
"k": 4
}'