Skip to main content
2 of 6
deleted 12 characters in body; added 97 characters in body
Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60

Dev-Tip: How to get the count of a query efficiently

To get the count of a query without returning results, simply specify pagesize=0.

http://api.stackoverflow.com/0.9/users?filter=mike&sort=name&pagesize=0

{
  "total": 1161,
  "page": 1,
  "pagesize": 0,
  "users": []
}

/search seems to be an exception and likely a bug. see pagesize=0 on /search throwing error

Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60