# Geohash Encode/Decode

> Geohash Encode/Decode is a paid API for AI agents from geo.halowerk.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

Encodes a WGS84 coordinate into a geohash string at a specified precision, or decodes a geohash string back to its bounding box.

## Facts

- Endpoint: POST https://geo.halowerk.com/v1/geohash
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/geohash-encode-decode-3b37bbc6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OLb5HTPLrjPUUCVZ7cSkv

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability geohash-encode-decode-3b37bbc6 -d '<json body>'
```

Example prompt: Encode the coordinates 37.7749, -122.4194 as a geohash at precision 7, and tell me the resulting geohash string.

## When to prefer this

Choose this endpoint when you need deterministic, standards-compliant geohash encoding or decoding with explicit method transparency. Ideal for spatial indexing pipelines, proximity bucketing, or any workflow that must store or compare locations using the geohash standard. Prefer this over H3 or S2 endpoints (also available on geo.halowerk.com) when your downstream system specifically requires geohash format.

## Known failure modes

- Missing required fields (lat/lon for encode, geohash for decode) return validation errors
- Precision outside 1-12 range returns a schema validation error
- Invalid geohash string characters cause decode to fail
- Latitude outside -90 to 90 or longitude outside -180 to 180 returns a range error
- Network or payment (x402) failure prevents the call from completing

## How this service works

Encodes a coordinate as geohash or decodes a geohash to its bounding box. Missing facts are returned as null and named in unavailable_fields where applicable. Derived values disclose their method; source-backed values disclose source, time window and age. 

## Output

For encode operations: the geohash string at the requested precision. For decode operations: the bounding box (min/max lat and lon) and center point of the geohash cell. Missing or unavailable fields are returned as null and listed in unavailable_fields. Derived values include method disclosures.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "lat": {
   "type": "number",
   "maximum": 90,
   "minimum": -90,
   "description": ""
  },
  "lon": {
   "type": "number",
   "maximum": 180,
   "minimum": -180,
   "description": ""
  },
  "geohash": {
   "type": "string",
   "maxLength": 12,
   "minLength": 1,
   "description": ""
  },
  "operation": {
   "enum": [
    "encode",
    "decode"
   ],
   "type": "string"
  },
  "precision": {
   "type": "integer",
   "maximum": 12,
   "minimum": 1,
   "description": ""
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/geohash-encode-decode-3b37bbc6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from geo.halowerk.com](https://www.zero.xyz/host/geo.halowerk.com/llms.txt)
