Skip to main content
1 of 3
Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60

the min/max solution that codeka presents seems to work great. While it does not guarantee accurate results, it does drastically reduce network traffic.

I simply check again when I get the results back and filter out non-matches client side, e.g.

Soapi.RouteFactory(site.api_endpoint, apiKey)
    .Users(
    {
        min: username.toLowerCase(),
        max: username.toUpperCase(),
        sort: Soapi.Domain.UserSort.name
    })
    .getPagedResponse(function(data)
    {
        $.each(data.items, function(ignored, user)
        {
            if (user.display_name.toUpperCase() == username.toUpperCase())
            {

                // set the site so we can render links and logo.
                // this can be refactored down to a literal with needed fields only
                user.on_site = site;

http://api.stackoverflow.com/0.9/users?sort=name&min=joey&max=JOEY&order=desc

Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60