1

When I want to fetch github users using this api: https://api.github.com/users it gives me back exactly 46 users. How can I fetch e.g. just 10 of them?

Andrew
  • 149
  • 1
  • 5
  • 12

1 Answers1

0

You can try and add the per_page directive in your API URL

By passing the per_page parameter, you can specify how many items you want each page to return, up to 100 items.
Let's try asking for 10 items about addClass:

curl -I "https://api.github.com/search/code?q=addClass+user:mozilla&per_page=10"

Apply the same idea to api.github.com/users

The first "page" of result would be 10 users.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250