---
title: "Traverse an entity relationship graph"
description: "Traverses the ontology graph from `entityId` with breadth-first search. Returns nodes and edges to the requested depth, capped at 200 nodes. `relationKinds` limits traversed edge kinds."
canonical: https://y2.dev/docs/api/reference/intel/getEntityGraphV2/
---

Endpoint Reference[Intel](https://y2.dev/docs/api/reference/intel)

# Traverse an entity relationship graph

Traverses the ontology graph from \`entityId\` with breadth-first search. Returns nodes and edges to the requested depth, capped at 200 nodes. \`relationKinds\` limits traversed edge kinds.

`GET https://api.y2.dev/api/v2/entities/{entityId}/graph`

- Operation ID: `getEntityGraphV2`
- Required scopes: `intel:explorer`
- Accepts x402 pay-per-request payment
- Contract: https://y2.dev/openapi.json

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `entityId` | path | string | Yes | Root entity ID for the traversal |
| `depth` | query | integer | No | Maximum BFS depth (0–3) |
| `relationKinds` | query | string | No | Comma-separated list of relation kinds to traverse. Defaults to all kinds. Allowed values: `part_of`, `operates`, `located_in`, `ally_of`, `adversary_of`, `subsidiary_of`, `supplies`, `references`, `affects`, `targets`, `uses`. |

## Responses

| Status | Description | Body |
| --- | --- | --- |
| 200 | Entity graph (nodes + edges) | `EntityGraphResponse` |
| 400 | Invalid request parameters |  |
| 401 | Missing or invalid API key |  |
| 402 | x402 payment required | `X402PaymentRequiredResponse` |
| 403 | Insufficient permissions or access denied |  |
| 429 | Rate limit exceeded (per-key or per-account aggregate) |  |
| 500 | Internal server error |  |

### 200 response fields

| Field | Type | Description |
| --- | --- | --- |
| `data` | `IntelGraph` |  |
| `data.nodes[]` | array of `PublicEntity` |  |
| `data.edges[]` | array of `PublicEntityRelation` |  |
| `data.capped` | boolean | True when traversal stopped early (200-node cap or depth cap) |
| `data.depth` | integer | BFS depth traversed |
| `meta` | `PublicGraphMeta` |  |
| `meta.depth` | integer |  |
| `meta.capped` | boolean |  |
