How to use the flag counter in a twig template of a node?
This will return an array of all the flag counts on a node:

\Drupal::service('flag.count')-&gt;getEntityFlagCounts($node)


(For all flags set for that node)
Via: https://www.drupal.org/node/2476349

You can use that in a preprocess function to get your flag counts and send it as a new variable to your template file. Like so:

function yourtheme_preprocess_node(&amp;$variables) {

  $flag_counts = \Drupal::service('flag.count')-&gt;getEntityFlagCounts($node);
  $variables['like_count'] = $flag_counts['like'];

}


Then in your theme file you can output:

{{ like_count }} 


The problem with this is that it doesn't ajax update when someone clicks the flag link. For that to work you have to put the count in the flag template.