Calculates the geographic midpoint between two coordinate pairs using spherical geometry. Access via MCP in Cursor, Windsurf, or other supported editors, or call GET /v1/geo/midpoint with lat/lng parameters. Returns precise coordinates accounting for Earth's curvature — essential for accurate distance calculations in mapping applications and location-based AI agents.
curl "https://tinyfn.io/v1/geo/midpoint" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/geo/midpoint', {
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/midpoint',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
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"
}
}
}
}
Send GET request to /v1/geo/midpoint with lat1, lng1, lat2, lng2 parameters, or use the MCP tool with coordinate pairs. Returns the geographic center point as decimal degrees.
Yes, uses spherical trigonometry rather than simple averaging. This prevents errors when calculating midpoints across large distances or near poles where flat-earth math fails.
Absolutely. MCP integration lets agents calculate meeting points, analyze geographic clusters, or find optimal locations between multiple coordinates in real-time without hallucinating coordinates.
Accepts decimal degrees (e.g., 40.7128, -74.0060). Input coordinates as separate latitude and longitude parameters for each point.
Uses standard geodetic formulas with high precision. Accuracy depends on input coordinate precision — typically accurate to within meters for most mapping applications.
Get your free API key and start using Calculate Midpoint in seconds.
Get Free API Key