Geolocation Utilities

Bounding Box

Generates rectangular bounding boxes around geographic coordinates with specified radius distances. Call GET /v1/geo/bounding-box with lat/lng and distance to get min/max coordinates for spatial queries. Perfect for MCP-enabled AI agents in Cursor or Claude Code doing location-based searches. Returns precise decimal degrees for database queries or map rendering.

API Endpoint

GET /v1/geo/bounding-box

Code Examples

curl "https://tinyfn.io/v1/geo/bounding-box" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/geo/bounding-box', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/geo/bounding-box',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's geolocation tools:

{
  "mcpServers": {
    "tinyfn-geo": {
      "url": "https://tinyfn.io/mcp/geo",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I calculate a bounding box around a GPS coordinate?

Send GET request to /v1/geo/bounding-box with latitude, longitude, and distance parameters. Returns min/max lat/lng coordinates forming a rectangle around your point.

What distance units does the bounding box API accept?

Accepts kilometers, miles, meters, or feet. Specify the unit parameter along with your distance value for accurate geographic calculations.

Can MCP tools use bounding boxes for location searches in databases?

Yes, AI agents can generate bounding boxes via MCP and use the coordinates for spatial database queries like finding nearby restaurants or stores within a radius.

Does the bounding box account for Earth's curvature?

Yes, calculations use proper geodetic formulas accounting for Earth's spherical shape, not simple Cartesian distance which would be inaccurate for geographic coordinates.

What's the difference between bounding box and circular radius search?

Bounding boxes create rectangular search areas using four corner coordinates, while circular searches use center point plus radius. Boxes are easier for database indexing.

Try Bounding Box Now

Get your free API key and start using Bounding Box in seconds.

Get Free API Key