그래프 API
그래프 API로 노션 워크스페이스의 모든 노드(페이지, 데이터베이스, 사용자)와 노드 간 관계(엣지)를 포함하는 전체 그래프에 접근할 수 있어요. IVGraph의 3D 시각화에 사용되는 주요 엔드포인트예요.
GET /api/notion-graph/
인증된 사용자의 워크스페이스 전체 그래프를 반환해요.
인증: JWT (데모 모드에서는 인증 불필요)
매개변수:
| 매개변수 | 타입 | 필수 여부 | 기본값 | 설명 |
|---|---|---|---|---|
| demo | string | 아니요 | — | 데모 데이터를 사용하려면 true로 설정 (인증 불필요) |
| workspace_id | UUID | 아니요 | primary | 불러올 특정 워크스페이스 |
| connection_id | UUID | 아니요 | — | 특정 Airbyte 연결 |
| admin_user | int | 아니요 | — | 사용자 ID 재정의 (직원 전용) |
요청 예시:
# Authenticated user's graph
curl -H "Authorization: Bearer <jwt_token>" \
"https://ivgraph.com/api/notion-graph/"
# Demo mode (no auth)
curl "https://ivgraph.com/api/notion-graph/?demo=true"
# Specific workspace
curl -H "Authorization: Bearer <jwt_token>" \
"https://ivgraph.com/api/notion-graph/?workspace_id=abc-123"
import requests
resp = requests.get(
"https://ivgraph.com/api/notion-graph/",
headers={"Authorization": "Bearer <jwt_token>"}
)
graph = resp.json()
print(f"{graph['stats']['nodes']} nodes, {graph['stats']['links']} edges")
const resp = await fetch("https://ivgraph.com/api/notion-graph/", {
headers: { Authorization: "Bearer <jwt_token>" }
});
const graph = await resp.json();
console.log(`${graph.stats.nodes} nodes, ${graph.stats.links} edges`);
응답:
{
"nodes": [
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"type": "page",
"title": "Project Alpha",
"url": "https://www.notion.so/Project-Alpha-550e8400...",
"icon": {"type": "emoji", "emoji": "\ud83d\ude80"},
"connections_in": 5,
"connections_out": 12,
"connections_total": 17,
"pagerank": 0.42
}
],
"links": [
{
"id": "edge-uuid",
"source": "550e8400-e29b-41d4-a716-446655440001",
"target": "550e8400-e29b-41d4-a716-446655440002",
"type": "reference"
}
],
"metadata": {
"generated_at": "2026-04-10T12:00:00Z",
"user": "username",
"connection_id": "conn-uuid",
"sync_time": "2026-04-10T10:00:00Z"
},
"stats": {
"nodes": 342,
"links": 1205,
"total_blocks": 4500
}
}
구독에 따른 노드 한도를 초과했을 때의 응답 (정보 제공용이며 그래프는 계속 반환됨):
{
"nodes": ["..."],
"links": ["..."],
"metadata": {},
"stats": {},
"node_limit_exceeded": true,
"node_limit": 500,
"node_count": 742
}
연결이 없을 때의 응답:
{
"nodes": [],
"links": [],
"metadata": {"status": "no_connection"},
"stats": {"nodes": 0, "links": 0, "total_blocks": 0}
}
데이터 스키마
노드
| 필드 | 타입 | 설명 |
|---|---|---|
| id | UUID | 노션 페이지/데이터베이스/사용자 ID |
| type | string | page, database 또는 user |
| title | string | 페이지 제목 또는 데이터베이스 이름 |
| url | string | 노션 URL |
| icon | object|null | 아이콘 데이터 (아래 참조) |
| connections_in | int | 들어오는 엣지 수 |
| connections_out | int | 나가는 엣지 수 |
| connections_total | int | 전체 엣지 수 |
| pagerank | float | PageRank 점수 (0.0 — 1.0) |
아이콘
| 필드 | 타입 | 설명 |
|---|---|---|
| type | string | emoji, file 또는 external |
| emoji | string | 이모지 문자 (type=emoji인 경우) |
| file.url | string | 파일 URL (type=file인 경우) |
| external.url | string | 외부 URL (type=external인 경우) |
엣지
| 필드 | 타입 | 설명 |
|---|---|---|
| id | UUID | 엣지 식별자 |
| source | UUID | 출발 노드 ID |
| target | UUID | 대상 노드 ID |
| type | string | reference, parent, mention 또는 relation |
엣지 유형
| 유형 | 설명 |
|---|---|
reference |
페이지가 다른 페이지로 링크됨 |
parent |
페이지가 데이터베이스/페이지의 하위 항목임 |
mention |
페이지가 다른 페이지 또는 사용자를 멘션함 |
relation |
데이터베이스의 관계형 속성 |