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 have the following query, which is identical to the example they give in the documentation:

http://api.stackexchange.com/2.1/questions?fromdate=1391756400&order=desc&site=stackoverflow&sort=activity&tagged=c%2B%2B

This (should) return all of the questions with that tag....but for some reason, in the JSON data, I only get the first 30. Is there a reason for this? Since I'm not explicitly specifying page size?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

The API allows you to set a pagesize of 0 to 100 (with the exception of the /sites route, which allows larger values), and defaults to a maximum of 30 items in the response.

To get all of the items applicable to the API query, you need to check the has_more field to determine if you need to request subsequent pages via the page parameter. This is covered in more detail in the API documentation's section on paging.

share|improve this answer
    
I actually should have listed this in my original question, but I passed has_more=true inside the query string..and still got the same results. Maybe I need to do it via a filter instead. –  smilingcow Feb 9 at 18:11
1  
has_more is returned in the response, it indicates you need to make another call with page=n to get more results. The most you'll get back with a single request is 100, assuming you set the pagesize to that. –  Tim Stone Feb 9 at 21:39
    
Oooh, okay. Got it. That makes sense. I originally thought it was a wrapper variable the requestor gives. Thanks –  smilingcow Feb 10 at 14:28

You must log in to answer this question.

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