6

I am working on one application that produces timeline of user on every site of StackExchange.. We have some users on Sharepoint.stackexchange.com..

Since I want list of all the sites, I am trying to get it using API 2.2

2.2/sites/

as shown here.. But it is getting only partial sites. It is missing sites like Beer.stackexchange, sharepoint.stackexchange..

How do I retrieve them?

1 Answer 1

8

You need to pass in a sufficiently large pagesize value, per the documentation:

The pagesize parameter for this method is unbounded, in acknowledgement that for many applications repeatedly fetching from /sites would complicate start-up tasks needlessly.

Otherwise you'll only get 30 results, the default value for pagesize. Alternatively, you can page the results, but setting a large page size (e.g. 10000) is probably easier in this case.

As an aside, it'd probably be nice if the pagesize parameter allowed a special all value for this case, so you didn't have to use a magic number, but.

1
  • 1
    It would be really nice if a few other endpoints had unbounded pagesizes (like getting a users associated accounts, which is limited to the number if sites just like /sites is) Commented Jul 9, 2014 at 13:09

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.