User Search total results determination


As I understand it currently the user search query returns up to 20 users per page and up to 50 pages. But in order to paginate my app I need to know how many total results are returned for given search. I don’t see any info that allows me to know how many pages my search ran. Right now I can only brute force the issue and just retrieve all 50 pages but that seems over the top. How can I determine the total number of possible pages in a user search?


Just to give a quick example of my concern…if I want to render a search result with 10 users I need to poll the search three times to determine if previous and next are possible destinations. This means that page 30 of the search results actually polls twitter for page 29 and 31 also which is bad for twitter and slow for my users. I hope I’m just missing something in this implementation.

Thanks in advance.


Unfortunately we don’t return metadata like the number of possible results with our queries.


Thanks for the response. We’ve whittled the extra search requests down to the retrieval of one additional record to determine the “next” option. I can see how including the total search results would be awkward given the nature of search responses right now. All the more reason we are supposed to be going firehouse and storing them all ourselves…AMIRITE???

Thanks again