Prompt

compute near users API

Technology / CDN & Edge Infrastructure1 observationLast seen Oct 26, 2026

Latest observation

Oct 26, 2026OpenAI APIWeb search: off

If you mean “compute nearby users” for an API, the usual approach is:

  1. Get the current user’s latitude/longitude
  2. Store other users’ latitude/longitude
  3. Query users within a radius using a distance formula or geospatial index

Common API pattern

Request

GET /users/nearby?lat=37.7749&lng=-122.4194&radius=5000
  • lat, lng: current location
  • radius: search radius in meters or miles

Example response

{
  "users": [
    {
      "id": 1,
      "name": "Alice",
      "distance_m": 320
    },
    {
      "id": 2,
      "name": "Bob",
      "distance_m": 1240
    }
  ]
}

If you’re implementing it

You can compute distance using the Haversine formula:

function haversine(lat1, lon1, lat2, lon2) {
  const R = 6371000; // meters
  const toRad = d => d * Math.PI / 180;

  const dLat = toRad(lat2 - lat1);
  const dLon = toRad(lon2 - lon1);

  const a =
    Math.sin(dLat / 2) ** 2 +
    Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *
    Math.sin(dLon / 2) ** 2;

  return 2 * R * Math.asin(Math.sqrt(a));
}

Best practice

  • For small datasets: compute in code
  • For production-scale apps: use PostGIS, MongoDB geospatial queries, or Redis GEO

If you want, I can help you build the full “near users” API in Node.js, Python, Laravel, or SQL.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.