import org.openmetadata.sdk.api.Lineage;// Get lineage by entity type and IDLineage.LineageGraph graph = Lineage.of("table", tableId) .upstream(3) .downstream(2) .fetch();String raw = graph.getRaw();// Get lineage with default depth (1 upstream, 1 downstream)Lineage.LineageGraph graph = Lineage.of("table", tableId).fetch();
# Get lineage by entity type and IDcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3" \ -H "Authorization: Bearer {access_token}"# Get lineage with custom depthcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3?upstreamDepth=3&downstreamDepth=2" \ -H "Authorization: Bearer {access_token}"# Get lineage by fully qualified namecurl "{base_url}/api/v1/lineage/table/name/sample_data.ecommerce_db.shopify.dim_customer" \ -H "Authorization: Bearer {access_token}"
import org.openmetadata.sdk.api.Lineage;// Get lineage by entity type and IDLineage.LineageGraph graph = Lineage.of("table", tableId) .upstream(3) .downstream(2) .fetch();String raw = graph.getRaw();// Get lineage with default depth (1 upstream, 1 downstream)Lineage.LineageGraph graph = Lineage.of("table", tableId).fetch();
# Get lineage by entity type and IDcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3" \ -H "Authorization: Bearer {access_token}"# Get lineage with custom depthcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3?upstreamDepth=3&downstreamDepth=2" \ -H "Authorization: Bearer {access_token}"# Get lineage by fully qualified namecurl "{base_url}/api/v1/lineage/table/name/sample_data.ecommerce_db.shopify.dim_customer" \ -H "Authorization: Bearer {access_token}"
Retrieve the lineage graph for an entity, including upstream and downstream edges. You can query by entity ID or fully qualified name.
The Python examples on this page use the original client (metadata.ingestion.ometa.ometa_api.OpenMetadata) because SDK 2.0 (metadata.sdk) doesn’t include lineage operations. For more information, see Which Python SDK Should I Use?.
Get by Entity Type and ID
string
required
Type of the entity. Options: table, dashboard, pipeline, topic, mlmodel, container, searchIndex, storedProcedure, dashboardDataModel, apiEndpoint.
string
required
UUID of the entity to retrieve lineage for.
integer
default:"1"
Number of hops to traverse upstream (min: 0, max: 3).
integer
default:"1"
Number of hops to traverse downstream (min: 0, max: 3).
Get by Entity Type and FQN
Use GET /v1/lineage/{entityType}/name/{fqn} to retrieve lineage by fully qualified name.
string
required
Type of the entity. Options: table, dashboard, pipeline, topic, mlmodel, container, searchIndex, storedProcedure, dashboardDataModel, apiEndpoint.
string
required
Fully qualified name of the entity (e.g., sample_data.ecommerce_db.shopify.dim_customer).
integer
default:"1"
Number of hops to traverse upstream (min: 0, max: 3).
integer
default:"1"
Number of hops to traverse downstream (min: 0, max: 3).
import org.openmetadata.sdk.api.Lineage;// Get lineage by entity type and IDLineage.LineageGraph graph = Lineage.of("table", tableId) .upstream(3) .downstream(2) .fetch();String raw = graph.getRaw();// Get lineage with default depth (1 upstream, 1 downstream)Lineage.LineageGraph graph = Lineage.of("table", tableId).fetch();
# Get lineage by entity type and IDcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3" \ -H "Authorization: Bearer {access_token}"# Get lineage with custom depthcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3?upstreamDepth=3&downstreamDepth=2" \ -H "Authorization: Bearer {access_token}"# Get lineage by fully qualified namecurl "{base_url}/api/v1/lineage/table/name/sample_data.ecommerce_db.shopify.dim_customer" \ -H "Authorization: Bearer {access_token}"