You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多
文档控制台
免费开始使用

如何使用Foursquare API指定最小签到量及经纬度筛选热门场地

How to Filter Foursquare Venues by Check-in Count, Radius, and Coordinates

Hey there! As someone new to working with Foursquare's API, let's walk through exactly how to set up your request to find popular venues by coordinates, plus filter by minimum check-ins and search radius. I'll break this down step by step so you can tweak your existing URL easily.

1. First, Recap the Core Parameters You (Probably) Already Have

Your base request likely includes these essential parameters, and you'll want to keep them:

  • ll: Your target latitude and longitude (format: latitude,longitude, e.g., 40.7128,-74.0060 for NYC)
  • radius: Search radius in meters (max is 100,000 meters / 100km)
  • client_id & client_secret: Your Foursquare API credentials (you need to grab these from the Foursquare Developer Portal by creating an app)
  • v: API version number (must be in YYYYMMDD format, e.g., 20240101—this ensures you're using the latest supported features)

2. Adding the Minimum Check-in Count Filter

The key parameter you're missing is minCheckins—this lets you specify the minimum number of check-ins a venue must have to show up in your results.

For example, if you only want venues with at least 200 check-ins, add minCheckins=200 to your URL.

To prioritize popular venues in your results, add the intent=popular parameter. This tells the API to surface venues that are trending or frequently visited, rather than just any nearby spots.

4. Full Example Request URL

Putting it all together, your final request might look like this (replace placeholders with your actual credentials):

https://api.foursquare.com/v2/venues/search?ll=40.7128,-74.0060&radius=500&intent=popular&minCheckins=200&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&v=20240101

Let's break down each part of this example:

  • ll=40.7128,-74.0060: Target coordinates (NYC's downtown area)
  • radius=500: Search within 500 meters of the coordinates
  • intent=popular: Fetch only popular venues
  • minCheckins=200: Only include venues with 200+ check-ins
  • client_id/client_secret: Your unique API credentials
  • v=20240101: API version (use a recent date to access the latest features)

Quick Tips for New Developers

  • Always keep your client_id and client_secret private—don't share them in public code or requests!
  • If you want to narrow results by venue type (e.g., restaurants, coffee shops), add the categoryId parameter (you can find category IDs in Foursquare's official documentation)
  • Test your requests in a tool like Postman first, or directly in your browser (just be cautious with credentials)

内容的提问来源于stack exchange,提问作者Kaden

火山引擎 最新活动