Upstash Documentation

Fetch Vectors

Fetches the vectors with the provided ids.
2 min read
gethttps://{endpoint}/fetch/{namespace}
gethttps://{endpoint}/fetch/{namespace}

You can fetch vector values or metadata of one or more by providing their vector ids or id prefix.

Tip

Vectors will be fetched from the default namespace by default. You can use a different namespace by specifying it in the request path.

Request#

idsstring[]#

Array of vector ids to fetch.

prefixstring#

Prefix of vector ids to fetch.

Info
When you fetch vectors with an id prefix, at most 1000 vectors will be returned. If there are more vectors, please use the range API with an id prefix.
includeMetadataboolean#

Whether to include the metadata of the vectors in the response, if any. It is recommended to set this to true to easily identify vectors.

Default: "false"

includeVectorsboolean#

Whether to include the vector values in the response. It is recommended to set this to false as the vector values can be quite big, and not needed most of the time.

Default: "false"

includeDataboolean#

Whether to include the data of the vectors in the response, if any.

Default: "false"

Path#

namespacestring#

The namespace to use. When no namespace is specified, the default namespace will be used.

Default: ""

Response#

VectorsObject[]#

Array of vectors in the same order they provided in the ids array. Array elements can be null if no such vector exists with the provided id.

Show properties
idstringrequired#

The id of the vector.

vectornumber[]#

The dense vector value for dense and hybrid indexes.

sparseVectorObject[]#

The sparse vector value for sparse and hybrid indexes.

Show properties
indicesnumber[]#

Indices of the non-zero valued dimensions.

valuesnumber[]#

Values of the non-zero valued dimensions.

metadataObject#

The metadata of the vector, if any.

datastring#

The unstructured data of the vector, if any.