taxonomy_term entity loadByProperties depth not found The terms returned contain depth as a Term object attribute.
$vocabulary = 'category';
$entity_manager = \Drupal::entityTypeManager();
$entity_storage = $entity_manager-&gt;getStorage('taxonomy_term');
$terms = $entity_storage-&gt;loadTree($vocabulary);

However, when I try to load terms by depth, I get an error.
$entity_manager = \Drupal::entityTypeManager();
$entity_storage = $entity_manager-&gt;getStorage('taxonomy_term');
$terms = $entity_storage-&gt;loadByProperties([
  'vid' =&gt; $vocabulary,
  'depth' =&gt; 0,
]);

The error is the following.

Uncaught PHP Exception Drupal\Core\Entity\Query\QueryException: &quot;'depth' not found

What is the way to find attributes I can use on loadByProperties()?
What is the way to find attributes I can use on loadByProperties()?

I guess with Devel's Kint, loading one and then looking at the &quot;iterator contents&quot; tab
  $entity_manager = \Drupal::entityTypeManager();
  $entity_storage = $entity_manager-&gt;getStorage('taxonomy_term');
  $term = $entity_storage-&gt;load(1);
  kint($term);