> For the complete documentation index, see [llms.txt](https://docs.systemsx.co.uk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.systemsx.co.uk/geo/common-encode.md).

# Common - Encode

## Encode Lat/Lng to GeoHash

<mark style="color:green;">`POST`</mark> `/api/common`

Returns the GeoHash for the lat/lng provided. If precision is auto, the result will be max 12 char length.\
The max precision of a GeoHash is based on the decimals of the initial Lat/Lng, for more precision ensure the Lat/Lng is the most accurate as possible.

**Body**

| Param     | Value/Type | Description |
| --------- | ---------- | ----------- |
| function  | 'encode'   | Static      |
| latitude  | float      |             |
| precision | int        | 0 = Auto    |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "geo_hash": "gbuw6fyprdsg"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Error Message Here"
}
```

{% endtab %}
{% endtabs %}
