---
title: "Get wiki link graph"
method: GET
path: "/knowledgebase/{kb_id}/wiki/graph"
tags: ["Wiki"]
---

# Get wiki link graph

`GET /knowledgebase/{kb_id}/wiki/graph`

Returns a slice of the wiki link graph for visualization. Supports
`mode=overview` (top-N most-connected pages, default) and
`mode=ego` (BFS neighborhood of a center slug) to keep response
size tractable for knowledge bases with tens of thousands of pages.

## Path parameters

- `kb_id` string, required

## Query parameters

- `mode` string
- `center` string
- `depth` integer
- `types` string
- `limit` integer

## Response `200`

OK

- GithubComTencentWeKnoraInternalTypesWikiGraphData
  - `edges` GithubComTencentWeKnoraInternalTypesWikiGraphEdge[]
    - `source` string — source slug
    - `target` string — target slug
  - `meta` GithubComTencentWeKnoraInternalTypesWikiGraphMeta
    - `center` string — populated in ego mode
    - `depth` integer — populated in ego mode
    - `mode` string
    - `returned` integer — number of nodes actually returned
    - `total` integer — total node count in the KB before filtering/limit
    - `truncated` boolean — true when Returned < Total (after filters)
  - `nodes` GithubComTencentWeKnoraInternalTypesWikiGraphNode[]
    - `link_count` integer — Number of inbound + outbound links
    - `page_type` string
    - `slug` string
    - `title` string

---

[API](https://skmtc.net/tencentblueking/apis/weknora-api.md) · [All operations](https://skmtc.net/tencentblueking/apis/weknora-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tencentblueking/weknora-api/revisions/d6921ae22ce0/schema)
