그래프 API
그래프 API는 노션 워크스페이스의 그래프, 즉 노드(페이지, 데이터베이스, 사용자)와 노드 간의 관계(엣지)를 반환해요. IVGraph의 3D 시각화에 사용되는 주요 엔드포인트예요. Free 요금제에서 노드가 500개를 초과하는 워크스페이스는 5분 동안 전체가 표시된 후, 연결이 가장 많은 500개 노드만 표시돼요(아래 참고).
IVGraph 로그인(JWT)을 사용해요. 여기서는 서비스 토큰(ivg_…)을 사용할 수 없어요. AI 에이전트는 Pro 및 Max 요금제에서 V1 LLM API를 사용해요.
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
}
}
그래프가 요금제의 노드 한도를 초과할 때의 응답:
유료 요금제(Plus, Pro, Max 및 Pro 1주 이용권)에서는 한도를 초과해도 안내와 함께 전체 그래프가 반환돼요. Free 요금제에서는 그래프를 처음 연 후 5분 동안 전체 그래프가 반환돼요(graph_preview.active가 true). 그 이후에는 연결이 가장 많은 500개 노드와 그 사이의 링크만 반환돼요. node_count는 항상 전체 노드 수예요. Free 요금제에서 한도를 초과한 경우, 응답에는 앱에 표시되는 US$1.99 Pro 1주 이용권 제안 정보인 pro_week도 포함돼요.
유료 요금제의 노드 한도 초과 시:
{
"nodes": ["..."],
"links": ["..."],
"metadata": {},
"stats": {},
"node_limit_exceeded": true,
"node_limit": 3000,
"node_count": 3420,
"nodes_shown": 3420,
"node_limit_truncated": false
}
Free 요금제의 5분 미리보기 종료 후:
{
"nodes": ["... 500 most connected nodes ..."],
"links": ["... links between them ..."],
"metadata": {},
"stats": {},
"node_limit_exceeded": true,
"node_limit": 500,
"node_count": 742,
"nodes_shown": 500,
"node_limit_truncated": true,
"node_count_by_type": {"page": 690, "database": 40, "user": 12},
"graph_preview": {"active": false, "started_at": "2026-10-27T09:00:00Z", "ends_at": "2026-10-27T09:05:00Z", "seconds_left": 0, "seconds": 300}
}
연결이 없을 때의 응답:
{
"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 |
데이터베이스의 관계형 속성 |