Skip to main content
Question

Cognite Python sdk - Getting All Linked Timeseries of a Asset

  • February 27, 2025
  • 1 reply
  • 35 views

Hi Experts,

 

Need your help on Cognite Python sdk.

My goal

Get all linked timeseries of an Asset

I am using Asset class object https://cognite-sdk-python.readthedocs-hosted.com/en/latest/assets.html#cognite.client.data_classes.assets.Asset 

time_series function


​​
 

 

Problem

It is only giving me  the ‘Directly linked timeseries’ , not all the ‘Linked timeseries. 

 

 

Means in this case I only getting 13 timeseries objects , compared to 64 linked timeseries of the Asset.

 

Appreciate your help on adopting the correct approach

 

Thanks and Regards

Sree

1 reply

Ben Petree
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • 19 replies
  • March 7, 2025

You would need to use this function to get the “Linked timeseries”.

https://cognite-sdk-python.readthedocs-hosted.com/en/latest/time_series.html#cognite.client._api.time_series.TimeSeriesAPI.list

pass in that Asset’s external_id to asset_subtree_external_ids

Your snippet would look something like:

linked_timeseries = client.time_series.list(asset_subtree_external_ids=[“external_id of the Asset”], limit=Non

And here is the snippet for directly linked timeseries. This is what the Asset class object helper function does under the hood for you:

directly_linked_timeseries = client.time_series.list(asset_external_ids=[“external_id of the Asset”], limit=None)


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings