Using the menu API, how do I get only the enabled links?
Set onlyEnabledLinks() on the menu tree parameters:

$parameters = new MenuTreeParameters();
$parameters-&gt;onlyEnabledLinks();
$tree = \Drupal::menuTree()-&gt;load('main', $parameters);