Drupal 8, "view ui query" to drupal code query api ?
No, there is not.

You're also not supposed to write a query directly against entity or field tables yourself. Use the entity query API instead:

https://www.sitepoint.com/drupal-8-version-entityfieldquery/

$uids = \Drupal::entityQuery('user')
  -&gt;condition('uid', 0, '&lt;&gt;',
  -&gt;range(0, 50)
  -&gt;execute();