> 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-inside-polygon.md).

# Common - Inside Polygon

## Location Inside Poly

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

Returns results on if a location is inside a polygon or not. Recommended to use for high-level checking.

This specific endpoint does not auto-scale geohash precision, ensure your initial polygon points have precision or use another endpoint.

**Body**

| Param     | Value/Type | Description  |
| --------- | ---------- | ------------ |
| function  | 'inside'   | Static       |
| points    | array      |              |
| precision | int        | Default is 6 |
| locations | array      |              |

**Example**

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

```json
{
  .. other params
  "points": [
    [float, float],
    [float, float],
    [float, float],
    [float, float],
    ...
  ],
  "locations": [
    {
      "latitude": float,
      "longitude": float
    }
    ...
  ]
}
```

{% endtab %}
{% endtabs %}

**Response**

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

```json
[
  {
    "latitude": float,
    "longitude": float,
    "is_inside": bool
  }
  ...
]
```

{% endtab %}

{% tab title="400" %}

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

{% endtab %}
{% endtabs %}
