curl https://hardy-cricket-48359-us1-vector.upstash.io/range \
-H "Authorization: Bearer ABcFMGhhcmR5LWNyaWNrZXQtNDgzNTktdXMxYWRtaW5PREE0TkdVME5XUXRaV0poTWkwME9UVTFMVGxrTm1NdE9USTROR0ppWkRsak56ZGs=" \
-d '{ "cursor": "0",
"limit" : 2,
"includeVectors": false,
"includeMetadata": true }'
const url = "https://better-dodo-20522-us1-vector.upstash.io/fetch"; // Replace with your index endpoint.
const token = "YOUR_TOKEN"; // Replace with your actual token
const data = {
cursor: "0",
limit: 2,
includeVectors: false,
includeMetadata: true,
};
fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify(data),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
import requests
import json
url = 'https://better-dodo-20522-us1-vector.upstash.io/fetch' # Replace with your index endpoint.
token = 'YOUR_TOKEN' # Replace with your actual token
headers = {
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
}
data = {
'cursor': "0",
'limit': 2,
'includeVectors': False,
'includeMetadata': True
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
{
"result" : {
"nextCursor" : "2",
"vectors" : [
{
"id" : "1",
"metadata" : {"genre":"comedy","year":2020}
},
{
"id" : "2",
"metadata" : {"genre":"comedy","year":2020}
}
]
}
}
Endpoints
Range Vectors
This endpoint returns a range of vectors starting with(including) cursor until the end of the vectors in the index or given limit.
GET
/
range
curl https://hardy-cricket-48359-us1-vector.upstash.io/range \
-H "Authorization: Bearer ABcFMGhhcmR5LWNyaWNrZXQtNDgzNTktdXMxYWRtaW5PREE0TkdVME5XUXRaV0poTWkwME9UVTFMVGxrTm1NdE9USTROR0ppWkRsak56ZGs=" \
-d '{ "cursor": "0",
"limit" : 2,
"includeVectors": false,
"includeMetadata": true }'
const url = "https://better-dodo-20522-us1-vector.upstash.io/fetch"; // Replace with your index endpoint.
const token = "YOUR_TOKEN"; // Replace with your actual token
const data = {
cursor: "0",
limit: 2,
includeVectors: false,
includeMetadata: true,
};
fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify(data),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
import requests
import json
url = 'https://better-dodo-20522-us1-vector.upstash.io/fetch' # Replace with your index endpoint.
token = 'YOUR_TOKEN' # Replace with your actual token
headers = {
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
}
data = {
'cursor': "0",
'limit': 2,
'includeVectors': False,
'includeMetadata': True
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
{
"result" : {
"nextCursor" : "2",
"vectors" : [
{
"id" : "1",
"metadata" : {"genre":"comedy","year":2020}
},
{
"id" : "2",
"metadata" : {"genre":"comedy","year":2020}
}
]
}
}
Request
string
required
The offset to the last retrieved vector. Should be set to
"0" in the initial
range.number
required
The number of maximum vectors that you want in the response of range. (page
size)
boolean
Whether to include the metadata of the vectors in the response. Setting this
true would be the best practice, since it will make it easier to identify
the vectors.boolean
The metadata of the vector. This is used to make it easier to identify the
vector on queries.
Response
string
required
The offset for the next range. You should place this in the
cursor field for
the next range.Empty if there are no other vectors in the index.Object[]
required
curl https://hardy-cricket-48359-us1-vector.upstash.io/range \
-H "Authorization: Bearer ABcFMGhhcmR5LWNyaWNrZXQtNDgzNTktdXMxYWRtaW5PREE0TkdVME5XUXRaV0poTWkwME9UVTFMVGxrTm1NdE9USTROR0ppWkRsak56ZGs=" \
-d '{ "cursor": "0",
"limit" : 2,
"includeVectors": false,
"includeMetadata": true }'
const url = "https://better-dodo-20522-us1-vector.upstash.io/fetch"; // Replace with your index endpoint.
const token = "YOUR_TOKEN"; // Replace with your actual token
const data = {
cursor: "0",
limit: 2,
includeVectors: false,
includeMetadata: true,
};
fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify(data),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
import requests
import json
url = 'https://better-dodo-20522-us1-vector.upstash.io/fetch' # Replace with your index endpoint.
token = 'YOUR_TOKEN' # Replace with your actual token
headers = {
'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'
}
data = {
'cursor': "0",
'limit': 2,
'includeVectors': False,
'includeMetadata': True
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
{
"result" : {
"nextCursor" : "2",
"vectors" : [
{
"id" : "1",
"metadata" : {"genre":"comedy","year":2020}
},
{
"id" : "2",
"metadata" : {"genre":"comedy","year":2020}
}
]
}
}
Was this page helpful?