Skip to main content
GET
/
v1
/
lineage
/
export
GET /v1/lineage/export
from metadata.sdk import configure, get_client

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)
client = get_client()

# Export lineage as CSV
response = client.get("/lineage/export", params={
    "fqn": "sample_data.ecommerce_db.shopify.dim_customer",
    "type": "table",
    "upstreamDepth": 3,
    "downstreamDepth": 2,
})

print(response.text)
fromEntityFQN,fromEntityType,toEntityFQN,toEntityType,sqlQuery
sample_data.ecommerce_db.shopify.raw_customer,table,sample_data.ecommerce_db.shopify.dim_customer,table,"INSERT INTO dim_customer SELECT * FROM raw_customer"
sample_data.ecommerce_db.shopify.dim_customer,table,sample_superset.customer_dashboard,dashboard,

Export Lineage

Export the lineage graph for a given entity as a CSV file. Useful for auditing, reporting, and offline analysis of data lineage.

Query Parameters

fqn
string
required
Fully qualified name of the entity to export lineage for (e.g., sample_data.ecommerce_db.shopify.dim_customer).
type
string
required
Entity type. Options: table, dashboard, pipeline, topic, mlmodel, container, searchIndex, storedProcedure, dashboardDataModel, apiEndpoint.
upstreamDepth
integer
default:"1"
Number of hops to traverse upstream (min: 0, max: 3).
downstreamDepth
integer
default:"1"
Number of hops to traverse downstream (min: 0, max: 3).
GET /v1/lineage/export
from metadata.sdk import configure, get_client

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)
client = get_client()

# Export lineage as CSV
response = client.get("/lineage/export", params={
    "fqn": "sample_data.ecommerce_db.shopify.dim_customer",
    "type": "table",
    "upstreamDepth": 3,
    "downstreamDepth": 2,
})

print(response.text)
fromEntityFQN,fromEntityType,toEntityFQN,toEntityType,sqlQuery
sample_data.ecommerce_db.shopify.raw_customer,table,sample_data.ecommerce_db.shopify.dim_customer,table,"INSERT INTO dim_customer SELECT * FROM raw_customer"
sample_data.ecommerce_db.shopify.dim_customer,table,sample_superset.customer_dashboard,dashboard,

Returns

Returns a CSV string with one row per lineage edge in the graph.

Response

The CSV includes the following columns:
ColumnDescription
fromEntityFQNFully qualified name of the source entity
fromEntityTypeEntity type of the source
toEntityFQNFully qualified name of the destination entity
toEntityTypeEntity type of the destination
sqlQuerySQL query driving the transformation (if available)

Error Handling

CodeError TypeDescription
400BAD_REQUESTMissing required parameters
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission to export lineage
404NOT_FOUNDEntity with the given FQN does not exist