You can iterate through entities using entitiyQuery. In this simple snippet you can see that the only condition is type. So using this exact one you can iterate through entities in a certain node type.
Source code viewer
$query = \Drupal::entityQuery('node') ->condition('type', 'my_node_bundle'); $results = $query->execute(); foreach ($results as $nid) { dpm($nid); }Programming Language: PHP