JavaScript
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, "forgetAfter": "<string>", "forgetReason": "<string>", "version": 123, "parentMemoryId": "<string>", "rootMemoryId": "<string>", "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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Show child attributes
100
50
1 <= x <= 500
Documents with memories and edges within the viewport
Was this page helpful?