title: Foursquare API: Getting an exhaustive list of venues in a given area
body: <p>I'm using Foursquare API to get a list of venues of a certain category.
  One important requirement is that the list is exhaustive, i.e. includes all relevant points. The v2/venues/search API endpoint enforces a limit of 50 venues on the output.
  So the first idea that comes to mind is splitting the area into several sections (using "sw" and "ne" params) and then combining the results.</p>
  
  <p>Clearly, the density of points will vary dramatically depending on location, so we'll need to use some kind of adaptive algorithm to flexibly adjust the size of the search window so that it contains all points. Also, there's an increased risk of running into the rate limit, so we might need the algorithm to stop when it's used up its quota of requests.</p>
  
  <p>Finally, it seems that the only way to tell if a search window should be shrunk even further is to count the number of points in the result: if we have less than 50, then we've got a complete list for this section and can move on to the next one; otherwise, we should split it further. It seems to be wasteful as we'll be throwing away the intermediate results (i.e. all results in our search tree except for the leaves).</p>
  
  <p>So here are some questions that I have:</p>
  
  <ul>
  <li>Is it the best way to put together an exhaustive list? Maybe I'm
  missing some API functionality?</li>
  <li>Is there any specific algorithm you'd use in this case?</li>
  <li>How would you go about reducing the number of results that have to be thrown away?</li>
  </ul>
  
  <p>Thanks in advance!</p>