How to get a list of projects with the most stars using the Github API(v4)?

*How to get a list of projects with the most stars using the Github API(v4)?
(It seems this has already been implemented in the GUI version of Gitlab.
(Link: Projects · Explore · GitLab)

I am using V4 of the Gitlab API.
(My Query:
curl --request GET --header “PRIVATE-TOKEN: <my_access_token>” “https://gitlab.com/api/v4/projects?pagination=keyset&per_page=50&order_by=id&sort=stars_desc” )
taken from API Docs | GitLab
*

  • I was getting {“error”:“sort does not have a valid value”} as reply from the query unlike project_id list when making a valid query. It is said that sort has only asc or desc value. So is there any alternative way to do the task I mentioned in the question.

  • I am using Version 4 of the official Gitlab API and querying on gitlab.com.

  • *Thank You very much and Have a good day *