Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
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) –  Jonathan. Jul 9 at 13:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .