Converts latitude/longitude coordinates into compact geohash strings for spatial indexing and proximity searches. Access via MCP in Cursor or Windsurf, or REST at `/v1/geo/geohash-encode`. Pass lat/lng coordinates and optional precision level to get a base32-encoded string like "9q8yyk8yuzvz". Higher precision values create longer, more accurate geohashes perfect for location-based applications.
curl "https://tinyfn.io/v1/geo/geohash-encode" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/geo/geohash-encode', {
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/geohash-encode',
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"
}
}
}
}
A geohash is a base32-encoded string that represents a geographic area as a hierarchical spatial index. Strings with common prefixes are geographically close, making proximity searches and spatial clustering much faster than coordinate comparisons.
Use the geohash-encode tool with latitude, longitude, and optional precision parameters. For example, encoding (37.7749, -122.4194) with precision 12 returns a geohash string you can use for spatial queries.
Higher precision creates longer, more accurate geohashes. Use 5-7 for city-level accuracy, 8-10 for neighborhood-level, and 11-12 for building-level precision. Each additional character roughly halves the geographic area.
Yes, geohashes with shared prefixes are geographically close. You can find nearby locations by truncating the geohash to reduce precision, then searching for all geohashes with that prefix.
Geohashes support up to 12 characters of precision and handle the full coordinate range: latitude -90 to 90, longitude -180 to 180. Maximum precision gives roughly 3.7cm × 1.9cm accuracy.
Get your free API key and start using Geohash Encode in seconds.
Get Free API Key