Api Endpoint

Geohash Encoder and Decoder

Geohash encoder and decoder: encode a WGS-84 latitude and longitude to a geohash at a chosen precision, or decode a geohash back to its bounding box, centre point and error bounds in metres. Encoding also returns the eight neighbouring cells, which is what a caller needs to do proximity search over a geohash-indexed store without a spatial database.

Open interactive test console

Offering

Provider
api.duoleads.com
Method
GET
Offering type
Api Endpoint
Transport type
http
Category
Location And Travel
Delivery
Not provided
Pricing model
Not provided
x402 version
2

Endpoint context

URL
https://api.duoleads.com/v1/geo/geohash
MIME type
application/json
First seen
2026-10-16T01:50:32.458Z
Last seen
Tags
geohash, geohash-encode, geohash-decode, Geo

Payment pricing

x402 payment terms are the authoritative price for calling this endpoint.

Payment option 1
0.05 USDC
Atomic price: 50000 · Network: eip155:8453 · Asset: USDC · Scheme: exact
Raw x402 terms
[
  {
    "scheme": "exact",
    "network": "eip155:8453",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amount": "50000",
    "payTo": "0xCD673f7e1daD254347AEab6be0DEFe8b9C6b3A39"
  }
]

Observed health

Status
Healthy
Latest latency
40 ms
Average latency
411 ms
HTTP status
402
Last checked
Reachability
100% over 14 checks

Latency is measured to the first response headers. A reachable result does not verify response accuracy or merchant identity.

Input schema

{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "const": "http"
    },
    "method": {
      "type": "string",
      "enum": [
        "GET"
      ]
    },
    "queryParams": {
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "description": "encode (default): lat/lon to geohash. decode: geohash to bounding box.",
          "enum": [
            "encode",
            "decode"
          ],
          "maxLength": 64,
          "default": "encode"
        },
        "lat": {
          "type": "string",
          "description": "WGS-84 latitude, -90 to 90. Required when op=encode.",
          "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
          "maxLength": 64
        },
        "lon": {
          "type": "string",
          "description": "WGS-84 longitude, -180 to 180. Required when op=encode.",
          "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
          "maxLength": 64
        },
        "precision": {
          "type": "string",
          "description": "Geohash length 1-12, default 9 (about 4.8 m).",
          "pattern": "^[+-]?\\d+$",
          "maxLength": 64,
          "default": "9"
        },
        "geohash": {
          "type": "string",
          "description": "Geohash to decode, 1-12 characters. Required when op=decode.",
          "pattern": "^[0-9bcdefghjkmnpqrstuvwxyz]{1,12}$",
          "maxLength": 64
        }
      },
      "required": []
    }
  },
  "required": [
    "type",
    "method"
  ],
  "additionalProperties": false
}

Output schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "input": {
      "additionalProperties": false,
      "properties": {
        "method": {
          "enum": [
            "GET"
          ],
          "type": "string"
        },
        "queryParams": {
          "properties": {
            "geohash": {
              "description": "Geohash to decode, 1-12 characters. Required when op=decode.",
              "maxLength": 64,
              "pattern": "^[0-9bcdefghjkmnpqrstuvwxyz]{1,12}$",
              "type": "string"
            },
            "lat": {
              "description": "WGS-84 latitude, -90 to 90. Required when op=encode.",
              "maxLength": 64,
              "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
              "type": "string"
            },
            "lon": {
              "description": "WGS-84 longitude, -180 to 180. Required when op=encode.",
              "maxLength": 64,
              "pattern": "^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$",
              "type": "string"
            },
            "op": {
              "default": "encode",
              "description": "encode (default): lat/lon to geohash. decode: geohash to bounding box.",
              "enum": [
                "encode",
                "decode"
              ],
              "maxLength": 64,
              "type": "string"
            },
            "precision": {
              "default": "9",
              "description": "Geohash length 1-12, default 9 (about 4.8 m).",
              "maxLength": 64,
              "pattern": "^[+-]?\\d+$",
              "type": "string"
            }
          },
          "required": [],
          "type": "object"
        },
        "type": {
          "const": "http",
          "type": "string"
        }
      },
      "required": [
        "type",
        "method"
      ],
      "type": "object"
    },
    "output": {
      "properties": {
        "example": {
          "properties": {
            "data": {
              "properties": {
                "bbox": {
                  "properties": {
                    "max_lat": {
                      "type": "number"
                    },
                    "max_lon": {
                      "type": "number"
                    },
                    "min_lat": {
                      "type": "number"
                    },
                    "min_lon": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "min_lat",
                    "min_lon",
                    "max_lat",
                    "max_lon"
                  ],
                  "type": "object"
                },
                "cell_height_m": {
                  "type": "number"
                },
                "cell_width_m": {
                  "type": "number"
                },
                "center": {
                  "properties": {
                    "lat": {
                      "type": "number"
                    },
                    "lon": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "lat",
                    "lon"
                  ],
                  "type": "object"
                },
                "error_m": {
                  "properties": {
                    "lat": {
                      "type": "number"
                    },
                    "lon": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "lat",
                    "lon"
                  ],
                  "type": "object"
                },
                "geohash": {
                  "type": "string"
                },
                "neighbours": {
                  "properties": {
                    "e": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "n": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ne": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "nw": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "s": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "se": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sw": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "w": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "n",
                    "ne",
                    "e",
                    "se",
                    "s",
                    "sw",
                    "w",
                    "nw"
                  ],
                  "type": "object"
                },
                "precision": {
                  "type": "integer"
                }
              },
              "required": [
                "geohash",
                "precision",
                "bbox",
                "center",
                "error_m"
              ],
              "type": "object"
            },
            "meta": {
              "properties": {
                "computed_at": {
                  "description": "RFC 3339 UTC with milliseconds",
                  "type": "string"
                },
                "deterministic": {
                  "type": "boolean"
                },
                "disclaimer": {
                  "type": "string"
                },
                "price_usd": {
                  "type": "string"
                },
                "request_id": {
                  "type": "string"
                },
                "sources": {
                  "items": {
                    "required": [
                      "id",
                      "version",
                      "published"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "required": [
                "request_id",
                "computed_at",
                "price_usd",
                "deterministic",
                "disclaimer"
              ],
              "type": "object"
            },
            "ok": {
              "const": true
            },
            "route": {
              "const": "/v1/geo/geohash"
            },
            "version": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "route",
            "version",
            "data",
            "meta"
          ],
          "type": "object"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "input"
  ],
  "type": "object"
}