Skip to main content
POST
/
v3
/
graph
/
viewport
Get graph viewport data
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
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
viewport
object
required
containerTags
string[]
Maximum array length: 100
documentIds
string[]
Maximum array length: 50
limit
number
Required range: 1 <= x <= 500

Response

Documents with memories and edges within the viewport

documents
object[]
required
edges
object[]
required
viewport
object
required
totalCount
number
required