API Reference
Get an entity's neighborhood
BFS from an entity over call / inheritance / definition edges.
GET
/graph/{project}/neighborhoodanyBFS from the entity's node over CALLS, INHERITS, IMPLEMENTS, OVERRIDES, DEFINES and DEFINES_METHOD edges only — never IMPORTS or containment edges.
Returned nodes carry a hop field (0 = the center entity); the center is also returned separately as center.
Path parameters
projectstringrequiredThe project_name.
Query parameters
entitystringrequiredQualified name to center the neighborhood on.
depthintegerNumber of hops to expand. Default 1.
directionenumin | out | both. Which edge direction to follow. Default both.
limitintegerMax nodes to return, root included, closest-first. Default 200.
Responses
200The entity's neighborhood
json
{
"project": "your-repo",
"entity": "src.http.RequestHandler",
"center": { "id": 42, "kind": "Class" },
"nodes": [ { "id": 42, "hop": 0 }, { "id": 51, "hop": 1 } ],
"edges": [ { "source": 42, "target": 51, "type": "CALLS" } ],
"stats": { "depth": 1, "direction": "both", "limit": 200, "returned_nodes": 2, "returned_edges": 1, "truncated": false }
}404No graph, or entity not found
json
{ "detail": "entity '...' not found in project 'your-repo' graph" }