Skip to content

Get entity co-occurrence graph

GET /v1/default/banks/{bank_id}/entities/graph

Return a graph of entities (nodes) and their co-occurrences (edges) for visualization.

Authentication required — include an Authorization: Bearer hsk_... header. See Authentication for details.

Path Parameters

NameTypeRequiredDescription
bank_idstringYes

Query Parameters

NameTypeRequiredDescription
limitintegerNoMaximum number of co-occurrence edges to return
min_countintegerNoMinimum cooccurrence_count to include an edge

Example Request

bash
curl -X GET 'https://api.hindsight.vectorize.io/v1/default/banks/your-bank-id/entities/graph' \
  -H 'Authorization: Bearer hsk_your_api_key'

Responses

200 — Successful Response

json
{
  "edges": [
    {
      "data": {
        "color": "#ffd700",
        "id": "uuid-1-uuid-2",
        "lastCooccurred": "2024-02-01T14:00:00Z",
        "lineStyle": "solid",
        "linkType": "cooccurrence",
        "source": "uuid-1",
        "target": "uuid-2",
        "weight": 5
      }
    }
  ],
  "limit": 1000,
  "nodes": [
    {
      "data": {
        "color": "#42a5f5",
        "id": "uuid-1",
        "label": "Alice",
        "mentionCount": 12
      }
    },
    {
      "data": {
        "color": "#42a5f5",
        "id": "uuid-2",
        "label": "Google",
        "mentionCount": 8
      }
    }
  ],
  "total_edges": 1,
  "total_entities": 2
}

422 — Validation Error

json
{
  "detail": [
    {
      "loc": [
        null
      ],
      "msg": "Message",
      "type": "Error Type",
      "input": null,
      "ctx": {},
      "url": "URL"
    }
  ]
}

Source: /v1/default/banks/{bank_id}/entities/graph