How to get the site’s user list from the Stack Overflow API?

Asked

Viewed 82 times

1

I need to loop the Stack Overflow API to generate data from all forum users, but I don’t know how user ids are generated at the time of registration. Does anyone know how user Ids are generated? Not increasingly, I believe.

  • I don’t know if you can do that, if Sopt allows it.

  • Make the loop, there’s a way. I just don’t know how the ID of each user is created because it doesn’t seem that it is increasingly analyzing the amount of user with the size of the ID’s.

  • Ids I believe are sequential, but have deleted users who are not listed. But why you need to know how they are generated?

  • To get the list of users of the site: http://api.stackexchange.com/docs/users (I don’t know how the python library handles this).

  • Because like I said, I need to get information from all the users, but if you take the site from the stack, from to know how many users there are, but there’s a much bigger ID than the maximum number of users, I thought it was the deleted ones, but the number is much higher so I wanted to know how the ID of each user is chosen to try to generate all the ID’s and then put them in a loop searching the data of each user.

  • 1

    Some people use it like name the ID in the OS in English, where the number is giant. This idea of "know how the ID of each user is chosen" is bored and I recommend to forget it. Use the API to pull everyone and ready.

  • Using the API the search pull all at once, does not answer me literally all forum users. At least I did not get return of all users here "http://api.stackexchange.com/docs/users".

  • 1

    @Pythowner The result is paged; you need to request the other pages via the 'page' parameter (e.g., http://api.stackexchange.com/2.2/users?page=2&site=stackoverflow )

  • Yes, I understand that, but how do I know the maximum number of pages?

Show 4 more comments

1 answer

2

  • Buddy, yes. But it doesn’t literally come to all users as an answer.

  • 2

    @Pythowner If you repair at the end of the Json response, there is the following excerpt: "has_more":true,"quota_max":300,"quota_remaining":298. This means that (1) the API says there are more users, so it works as a kind of pagination, and (2) there is a (daily) survey quota, so it may be necessary to continue the user listing another day. Behold this answer for more details and see how to list other pages from the user list.

  • Got it, but how do I figure out the total number of pages?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.