# /grid

## grid data array.

<mark style="color:blue;">`GET`</mark> `geolytix.xyz/api/layer/grid`

Query a grid data array for the given viewport.

#### Query Parameters

| Name   | Type   | Description                           |
| ------ | ------ | ------------------------------------- |
| locale | string | The locale key.                       |
| layer  | string | The layer key.                        |
| table  | string | The PostGIS table.                    |
| size   | string | The field to size grid cells.         |
| color  | string | The field to color grid cells.        |
| west   | string | The western bounds of the view port.  |
| south  | string | The southern bounds of the view port. |
| east   | string | The eastern bounds of the view port.  |
| north  | string | The northern bounds of the view port. |
| token  | string | Required for private endpoints.       |

{% tabs %}
{% tab title="200 Array of grid cell coordinates, size and color values." %}
```javascript
[
  [
    -2.073213,
    52.664887,
    "3.60789779426134277128",
    "4.30620059315063492056"
  ],
  [
    -1.952632,
    52.734294,
    "7.24688848013594977801",
    "7.88207392461001708923"
  ],
  [...]
]
```
{% endtab %}

{% tab title="406 Query with missing or invalid parameter." %}
```
'Invalid locale.'

'Invalid layer.'

'Missing table.'

'Invalid parameter.'
```
{% endtab %}

{% tab title="500 Please check backend error logs for more details." %}
```
'Failed to query PostGIS table.'
```
{% endtab %}
{% endtabs %}

