consider:
http://api.stackoverflow.com/0.9/questions?page=0
{
"total": 764951,
"page": 0,
"pagesize": 30,
"questions": []
}
http://api.stackoverflow.com/0.9/users?filter=mike&sort=name&page=0http://api.stackapps.com/0.9/search?intitle=a&pagesize=0
{
"total": 1161,
"page": 1,
"pagesize": 30,
"users""error": [
{
"user_id": 27284,
"user_type""code": "registered"4001,
"creation_date": 1223858821,
"display_name""message": "wcmiker",
//"The blah'pagesize' blahquery blah
parameter is },invalid."
{ 29 other users omitted}
]
}
The workaround seems to be to explicitly set page
and pagesize
to 0
whenever you want a count.
http://api.stackoverflow.com/0.9/users?filter=mike&sort=name&pagesize=0&page=0
{
"total": 1161,
"page": 1,
"pagesize": 0,
"users": []
}
While this works just fine, a consistent api implementation that infers a count operation from page=0
alone would help provide a more consistent and concise api.