Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

github users API Paging not work

Tags:

github

when using github users api to return users data through https://api.github.com/users?page=6&per_page=2

return the same data every one although change page parameter value and per_page why this and how to fix to change different data

i try to edit header request and add this header

Name Link
Value <https://api.github.com/users?page=1&per_page=2>; rel="next",<https://api.github.com/users?page=50&per_page=2>; rel="last"

But Still not working

like image 895
Ahmed Abd Ellatif Avatar asked Sep 07 '26 13:09

Ahmed Abd Ellatif


1 Answers

After my search

now Github use API V3 and if you want return users with paging you can use this https://api.github.com/users?since=1&per_page=100

Instead of using "page" and "per_page", that endpoint uses "since" and "per_page".

The since parameter says from which user ID the API should start listing users. For example:

https://api.github.com/users?since=1&per_page=100

will start listing users from the user with ID 1, and

https://api.github.com/users?since=10001&per_page=100

will start listing users from the user with ID 10001.

like image 111
Ahmed Abd Ellatif Avatar answered Sep 20 '26 03:09

Ahmed Abd Ellatif



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!