Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.neariq.io/llms.txt

Use this file to discover all available pages before exploring further.

GET /api/map/businesses

Returns collected market businesses around a map center point. Use this for map pins and nearby market discovery. The endpoint requires an authenticated app session and only serves data already collected by NearIQ.
curl "https://app.neariq.io/api/map/businesses?lat=30.27&lng=-97.74&radius_km=15&category=gym"
Query parameters:
ParameterTypeRequiredNotes
latnumberyesCenter latitude, between -90 and 90.
lngnumberyesCenter longitude, between -180 and 180.
radius_kmnumbernoDefaults to 15, max 100.
categorystringnoDefaults to all categories. gym also matches common fitness categories.
{
  "businesses": [
    {
      "place_id": "ChIJ...",
      "name": "Example Fitness",
      "category": "Gym",
      "address": "100 Example St",
      "city": "Austin",
      "lat": 30.27,
      "lng": -97.74,
      "rating": 4.8,
      "review_count": 421,
      "health_score": 88,
      "velocity_7d": 9,
      "distance_km": 1.24,
      "is_tracked": false
    }
  ]
}
The response is limited to the nearest 200 businesses, sorted by distance. is_tracked is true when the signed-in account already tracks that place.

GET /api/market/leaderboard

Returns collected market businesses for a city and category. This endpoint only serves data NearIQ has already collected; it does not trigger live collection.
curl "https://app.neariq.io/api/market/leaderboard?city=Austin&category=restaurant&sort=rating"
Query parameters:
ParameterTypeRequiredNotes
citystringyesCity name, for example Austin.
categorystringyesCategory key, for example restaurant.
countrystringnoDefaults to US.
sortstringnoprominence, rating, review_count, velocity, health_score, or newest.
limitnumbernoDefaults to 50, max 100.
offsetnumbernoPagination offset.
{
  "businesses": [
    {
      "place_id": "ChIJ...",
      "name": "Example Cafe",
      "category": "restaurant",
      "city": "Austin",
      "state": "TX",
      "country": "US",
      "rating": 4.7,
      "review_count": 382,
      "health_score": 91,
      "velocity_7d": 12,
      "prominence_rank": 3,
      "rank": 1
    }
  ],
  "total": 1,
  "cache": {
    "source": "collected_market_data",
    "frequency": "weekly",
    "note": null
  }
}
If no collected data exists, businesses is empty and cache.note is Market data not yet available for this region.

Health score

health_score is recalculated from the current row before responses are returned. It is a composite of rating strength, review volume, review velocity, rating trend, owner response rate, and data coverage. Missing live-signal inputs are treated as confidence gaps rather than automatic score penalties or free points.

GET /api/market/stats

Returns aggregate collected market statistics for a city and category.
curl "https://app.neariq.io/api/market/stats?city=Austin&category=restaurant"
{
  "city": "Austin",
  "category": "restaurant",
  "country": "US",
  "total_businesses": 100,
  "avg_rating": 4.42,
  "avg_review_count": 214.8,
  "avg_velocity": 8.2,
  "market_health_score": 77.4
}
Admin market data operations are internal and are not part of the public API contract.