Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat's the best way to tune my Foursquare API search queries?
    primarykey
    data
    text
    <p>I'm getting some erratic results from Foursquare's venue search API and I'm wondering if anyone has any tips on how to process my input parameters for the most "intuitive" results.</p> <p>For example, suppose I am searching for a venue called "Ise Sushi", around "New York, NY", which is equivalent to (lat: 40.7143528, lon: -74.00597309999999) using Google Maps API. Plugging into the Foursquare Venue API, we get:</p> <pre><code>https://api.foursquare.com/v2/venues/search?query=ise%20sushi&amp;ll=40.7143528%2C-74.00597309999999 </code></pre> <p>This yields pretty underwhelming results: the venue I'm looking for ends up rather far down the list, at 11th place. What's interesting is that <strong>reducing the precision of the coordinates</strong> appears to produce much better results. For example, suppose we were to round the coordinates to 3 significant digits:</p> <pre><code>https://api.foursquare.com/v2/venues/search?query=ise%20sushi&amp;ll=40.7%2C-74.0 </code></pre> <p>This time, the venue I'm looking for ends up in 2nd place, even though it is actually <em>farther</em> from the center of the search (1072 meters, vs. 833 meters using the first query).</p> <p>Another modification that appears to help improve the quality of search is <strong>substituting underscores for spaces</strong> to separate our search terms. For example, here's the original query with underscores:</p> <pre><code>https://api.foursquare.com/v2/venues/search?query=ise_sushi&amp;ll=40.7143528%2C-74.00597309999999 </code></pre> <p>This produces the most intuitive-seeming results: the venue I'm looking for appears first, and is accompanied by just one other result, "Ise Restaurant" (which is tagged as a "sushi restaurant"). For what it's worth, this actually seems to be <a href="https://foursquare.com/search?tab=venueResults&amp;q=ise+sushi&amp;near=New+York%2C+NY" rel="noreferrer">the result set of the same search</a> conducted on Foursquare's own website.</p> <p>I'm curious what lessons I should be learning from this. Should I be reducing the precision of my coordinates? Should I be connecting my search terms with underscores, and if so, does that limit how a user can order their search terms?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload