How can I use a view on site2 that consumes data from site1? We have a Drupal site that exposes a JSON API for users (http://site1/api/users).

We need to create on site2 a view of users based on the data provided by site1. (We cannot store the users on site2).

How can I use a view on site2 that consumes data from site1? Which hook should I use? What approach should I follow?
The External Entities module can help you in this task.


  This module allow you to connect to datasets from external databases
  and use it in your Drupal 8 website. While content lives external,
  Drupal sees those remote entities as internal. This makes it possible
  to alter the field displays, add references, comments, pathaliases,
  share buttons, webshop products and more.


You can read to Drupalize remote data with external entities.