const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({viewport: {minX: 500000, maxX: 500000, minY: 500000, maxY: 500000}})
};
fetch('https://api.supermemory.ai/v3/graph/viewport', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"documents": [
{
"id": "<string>",
"title": "<string>",
"summary": "<string>",
"documentType": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"x": 123,
"y": 123,
"memories": [
{
"id": "<string>",
"memory": "<string>",
"isStatic": true,
"spaceId": "<string>",
"isLatest": true,
"isForgotten": true,
"isInference": true,
"forgetAfter": "<string>",
"forgetReason": "<string>",
"version": 123,
"parentMemoryId": "<string>",
"rootMemoryId": "<string>",
"sourceCount": 123,
"memoryRelations": {},
"changeType": "created",
"createdAt": "<string>",
"updatedAt": "<string>"
}
]
}
],
"edges": [
{
"source": "<string>",
"target": "<string>",
"similarity": 0.5
}
],
"viewport": {
"minX": 500000,
"maxX": 500000,
"minY": 500000,
"maxY": 500000
},
"totalCount": 123
}Fetch documents (with memories) and memory edges within a viewport
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({viewport: {minX: 500000, maxX: 500000, minY: 500000, maxY: 500000}})
};
fetch('https://api.supermemory.ai/v3/graph/viewport', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"documents": [
{
"id": "<string>",
"title": "<string>",
"summary": "<string>",
"documentType": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"x": 123,
"y": 123,
"memories": [
{
"id": "<string>",
"memory": "<string>",
"isStatic": true,
"spaceId": "<string>",
"isLatest": true,
"isForgotten": true,
"isInference": true,
"forgetAfter": "<string>",
"forgetReason": "<string>",
"version": 123,
"parentMemoryId": "<string>",
"rootMemoryId": "<string>",
"sourceCount": 123,
"memoryRelations": {},
"changeType": "created",
"createdAt": "<string>",
"updatedAt": "<string>"
}
]
}
],
"edges": [
{
"source": "<string>",
"target": "<string>",
"similarity": 0.5
}
],
"viewport": {
"minX": 500000,
"maxX": 500000,
"minY": 500000,
"maxY": 500000
},
"totalCount": 123
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Was this page helpful?