GET
/v1/graph/entity-network
v1Get entity relationship network
Retrieve the ego-network around an entity up to a specified depth. Returns nodes (entities) and edges (relationships) for graph visualization.
Parameters
| Name | Type | Description |
|---|---|---|
entity_id required | integer | The entity ID to center the network on e.g. 892 |
depth | integer | Number of hops from the center entity (1-3) Default: 2 e.g. 2 |
limit | integer | Maximum number of edges to return (max 200) Default: 50 e.g. 50 |
entity_id required integerThe entity ID to center the network on
e.g. 892
depth integerNumber of hops from the center entity (1-3)
Default: 2
e.g. 2
limit integerMaximum number of edges to return (max 200)
Default: 50
e.g. 50
Request Examples
bash
curl "https://api.newsrank.ai/v1/graph/entity-network?entity_id=892&depth=2&limit=50" \
-H "Authorization: Bearer nrf_your_api_key"Response
json
{
"nodes": [
{
"id": 892,
"name": "John Roberts",
"type": "person",
"slug": "john-roberts"
}
],
"edges": [
{
"id": 1,
"source_entity_id": 892,
"target_entity_id": 45,
"relationship_type": "works_for",
"confidence": 0.95,
"article_count": 12,
"source_entity": {
"id": 892,
"name": "John Roberts",
"type": "person",
"slug": "john-roberts"
},
"target_entity": {
"id": 892,
"name": "John Roberts",
"type": "person",
"slug": "john-roberts"
}
}
]
}Try it
Server
Using sandbox demo key (5 req/min) — no signup required
Authentication
Demo key (sandbox)
Endpoint
GET /v1/graph/entity-network
Default: 2
Default: 50