Thank you so much for the reply, it has now guide me to the right path, is it possible to to use that query with the wordpress REST API?
Update: I got the REST API request working using this plugin
Really helpful tutorial! Thanks a lot! but I got only one question, I made this request: http://myWebSite.com/wp-json/wp/v2/posts/?meta_key=views&orderby=meta_value_num
And I got this response: