This document describes how to look up multi-level, cross-regional data lineage
by using the searchLineageStreaming API.
The
searchLineageStreaming
API performs a breadth-first search in a specified direction (upstream or
downstream) starting from a defined set of root entities, and returns a unified
lineage graph as a real-time streaming response.
Unlike standard lineage lookup APIs that might time out on massive multi-project
graphs, searchLineageStreaming delivers real-time, chunked responses. Use this
API when building tools that need to traverse broad, deep, or cross-regional
data architectures without request timeouts.
For more information, see About multi-region lineage search.
Key capabilities
The searchLineageStreaming API includes the following capabilities:
Breadth-first search: Traverses the lineage graph layer by layer, accurately calculating the depth of each connected asset.
Streaming response: Returns subgraphs and lineage links as they are discovered by the backend system. This is highly efficient for broad or deep lineage graphs and prevents request timeouts.
Multi-location and multi-project traversal: Although you specify only one billing project in the request path, the API automatically discovers and traverses lineage links across multiple Google Cloud projects and geographical locations, provided you have the required permissions.
Fine-grained column-level lineage: Supports searching for column-level dependencies between assets.
Wildcard lookups: Lets you to retrieve all column-level lineage for a specific entity by suffixing the fully qualified name (FQN) with
*.Pipeline insights: Optionally retrieves metadata about the transformation pipelines (processes) that created the lineage links.
Before you begin
Before you make requests to the API, ensure that you have met the following security and environmental prerequisites:
Required roles
To get the permissions that
you need to search for data lineage links,
ask your administrator to grant you the
Data Lineage Viewer (roles/datalineage.viewer) IAM role on the projects where the lineage links and processes are stored.
For more information about granting roles, see Manage access to projects, folders, and organizations.
This predefined role contains the permissions required to search for data lineage links. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to search for data lineage links:
-
Search entity-level lineage:
datalineage.events.geton the project where the link is stored -
Search column-level lineage:
datalineage.events.getFieldson the project where the link is stored -
Retrieve full pipeline process details:
datalineage.processes.geton the project where the process is stored
You might also be able to get these permissions with custom roles or other predefined roles.
Resource scoping
When you configure your API request, you must distinguish between the resource used for administrative billing and the actual locations scanned by the API:
Billing parent path: The
parentpath in the URL request must use the formatprojects/project/locations/location. This specific project-location pair is used exclusively to evaluate billing quotas and API rate limits.Target locations: Explicitly define the regions you want the backend to scan in the
locationsarray inside the request body.
Authentication setup
Initialize an environment variable with a Google Cloud access token to
authenticate your curl commands:
export ACCESS_TOKEN=$(gcloud auth print-access-token)
Usage examples
The following examples use the endpoint datalineage.googleapis.com.
Search multi-level, multi-project lineage
To execute a deep lineage search that traverses across multiple depths of the graph and scans across distinct Google Cloud projects, define the following variables:
Set
limits.maxDepthto your target traversal depth (accepts values from1to100).Populate the
locationsarray with the target regions you want the backend to cross-reference (for example,["us", "us-east1"]).
C#
Before trying this sample, follow the C# setup instructions in the
Data Lineage quickstart using
client libraries.
For more information, see the
Data Lineage C# API
reference documentation.
To authenticate to Data Lineage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
C#
Java
Before trying this sample, follow the Java setup instructions in the
Data Lineage quickstart using
client libraries.
For more information, see the
Data Lineage Java API
reference documentation.
To authenticate to Data Lineage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
Java
Node.js
Before trying this sample, follow the Node.js setup instructions in the
Data Lineage quickstart using
client libraries.
For more information, see the
Data Lineage Node.js API
reference documentation.
To authenticate to Data Lineage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
Node.js
Python
Before trying this sample, follow the Python setup instructions in the
Data Lineage quickstart using
client libraries.
For more information, see the
Data Lineage Python API
reference documentation.
To authenticate to Data Lineage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
Python
Ruby
Before trying this sample, follow the Ruby setup instructions in the
Data Lineage quickstart using
client libraries.
For more information, see the
Data Lineage Ruby API
reference documentation.
To authenticate to Data Lineage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
Ruby
REST
To search for data lineage, use the
searchLineageStreaming method.
Before using any of the request data, make the following replacements:
PROJECT_ID: your Google Cloud project ID used for administrative billing and quota evaluation.LOCATION_ID: the Google Cloud location, such asus-central1.SOURCE_PROJECT_ID: the Google Cloud project ID where the source table is located.DATASET_ID: the BigQuery dataset ID.TABLE_ID: the BigQuery table ID.
HTTP method and URL:
POST https://datalineage.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID:searchLineageStreaming
Request JSON body:
{
"parent": "projects/PROJECT_ID/locations/LOCATION_ID",
"locations": [
"LOCATION_ID",
"us-east1",
"us-central1"
],
"rootCriteria": {
"entities": {
"entities": [
{
"fullyQualifiedName": "bigquery:SOURCE_PROJECT_ID.DATASET_ID.TABLE_ID"
}
]
}
},
"direction": "DOWNSTREAM",
"limits": {
"maxDepth": 10,
"maxResults": 5000
}
}
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{
"links": [
{
"source": {
"fullyQualifiedName": "bigquery:project-prod.dataset.source_table"
},
"target": {
"fullyQualifiedName": "bigquery:project-prod.dataset.target_table"
},
"depth": 1,
"location": "us"
}
]
}
Search multiple geographical locations
You can limit or expand your lineage graph scan by modifying the geographical
regions passed inside the locations repeated array field.
C#
Before trying this sample, follow the C# setup instructions in the
Data Lineage quickstart using
client libraries.
For more information, see the
Data Lineage C# API
reference documentation.
To authenticate to Data Lineage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
C#
Java
Before trying this sample, follow the Java setup instructions in the
Data Lineage quickstart using
client libraries.
For more information, see the
Data Lineage Java API
reference documentation.
To authenticate to Data Lineage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
Java
Node.js
Before trying this sample, follow the Java setup instructions in the
Data Lineage quickstart using
client libraries.
To authenticate to Data Lineage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
Java
Python
Before trying this sample, follow the Python setup instructions in the
Data Lineage quickstart using
client libraries.
For more information, see the
Data Lineage Python API
reference documentation.
To authenticate to Data Lineage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
Python
Ruby
Before trying this sample, follow the Ruby setup instructions in the
Data Lineage quickstart using
client libraries.
For more information, see the
Data Lineage Ruby API
reference documentation.
To authenticate to Data Lineage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
Ruby