{"uid":"cap_m18YQVuIWP1lFcrw9O64j","slug":"saylor-innovations-geohash-encoder-decoder-8829fe64","name":"Saylor Innovations Geohash Encoder/Decoder","description":"Encode a latitude and longitude into a geohash at any precision, or decode a geohash into its centre, bounding box, cell size and eight neighbouring cells","url":"https://saylorinnovations.com/api/geo/geohash?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["lat","lon"],"properties":{"lat":{"type":"string","description":"Latitude to encode"},"lon":{"type":"string","description":"Longitude to encode"},"precision":{"type":"string","description":"optional 1-12, default 9"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["mode","geohash"],"properties":{"lat":{"type":["number","null"],"description":"Latitude in decimal degrees"},"lon":{"type":["number","null"],"description":"Longitude in decimal degrees"},"mode":{"type":"string","description":"Mode used"},"note":{"type":"string","description":"Caveat or context for reading the result"},"source":{"type":"string","description":"Data source the values come from"},"geohash":{"type":"string","description":"Geohash string"},"prefixes":{"type":["array","null"],"description":"Shorter geohashes that contain this cell"},"precision":{"type":["number","null"],"description":"Number of characters in the geohash"},"cell_size_approx_m":{"type":"object","description":"Cell size approx m"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OPiJ3Vh5UM-gb-o9RHtqm","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Encodes a latitude/longitude into a geohash string at any precision (1–12), returning the hash, its bounding box, cell size, and eight neighboring cells","exampleAgentPrompt":"Can you encode the coordinates 37.7749° N, 122.4194° W into a geohash at precision 9 and also show me the eight neighboring cells?","exampleUseCases":[{"title":"Geohash for proximity clustering","prompt":"I need to bucket ride-share pickup points into geohash cells for clustering — can you encode latitude 40.7128 and longitude -74.0060 at precision 6 and tell me the cell size and neighbors?"},{"title":"Geofence boundary lookup","prompt":"Give me the bounding box and cell size for the geohash at precision 8 for coordinates 51.5074 latitude, -0.1278 longitude — I need to set up a geofence around central London."},{"title":"Location index prefix generation","prompt":"What are the shorter geohash prefixes that contain the point at lat 35.6762, lon 139.6503 at precision 9? I want to use them for hierarchical location indexing in my database."}],"resultDescription":"Returns a JSON object containing the geohash string, the mode used, the precision level, approximate cell size in meters, bounding box coordinates, eight neighboring cell hashes, shorter prefix hashes that contain the cell, and the input latitude/longitude reflected back.","failureModes":["Missing lat or lon parameter returns an error","Latitude out of range (-90 to 90) causes invalid input error","Longitude out of range (-180 to 180) causes invalid input error","Precision outside 1–12 range may return default or error","Payment not received returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need to encode or decode geohashes with full cell metadata including bounding box, cell size, and neighbors in a single call — ideal for proximity search indexing, geofencing, and spatial clustering workflows that need the surrounding cell context, not just a raw hash string.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-18T12:56:33.285Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-geohash-encoder-decoder-8829fe64"}