Relations (Graph)
Get company relations and affiliations as a graph.
View as MarkdownReturns company relations and affiliations in a graph format with nodes and links. Useful for visualizing corporate connections.
Endpoint
GET /api/v1/companies/:company_id/relationsParameters
| Parameter | Type | In | Description |
|---|---|---|---|
company_id | integer | path | The unique identifier of the company. |
page | integer | body | Page number (default: 1). |
limit | integer | body | Records per page (default: 100). |
Code Examples
Get relations graph
import requests
url = 'https://api.statsnet.co/api/v1/companies/12345/relations'
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers).json()
print(response)Response
Success response
{
"ok": true,
"nodes": {
"1": { "id": 12345, "name": "Company A", "type": "company" },
"2": { "id": 67890, "name": "Company B", "type": "company" },
"3": { "id": 0, "name": "Ivanov I.I.", "type": "person" }
},
"links": [
{
"source": "1",
"company_id": 12345,
"target": "3",
"connection": "director",
"connection_value": "CEO"
},
{
"source": "2",
"company_id": 67890,
"target": "3",
"connection": "shareholder",
"connection_value": "50%"
}
],
"meta": {
"directors": 1,
"shareholders": 1
},
"total": 3
}Error Handling
Error response
{
"ok": false,
"error": {
"code": 403,
"message": "Forbidden"
}
}