# Geocode a batch of addresses

`QUERY /geocode`, or `POST /geocode`

The body is a JSON array of items, at most the server's item limit (1000
by default). Each takes the parameters `GET /geocode` takes, plus an
optional `id` echoed in its result. The request's own query-string
parameters apply to every item, and an item's own fields override them:
`?country=CA` scopes every item to Canada.
`QUERY` takes the same body and answers the same: `POST` is for clients
that cannot send `QUERY`.

Each result's `response` is exactly what `GET` returns for its item, and
its `error` the Problem `GET` would return. Results are in input order,
one per item, and a bad item never fails the batch.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `q` | query | no | string | The address as free text. Applies to every item; an item's own field overrides it. |
| `address` | query | no | string | House number and street, without town or postcode. Applies to every item; an item's own field overrides it. |
| `locality` | query | no | string | City or town. Applies to every item; an item's own field overrides it. |
| `region` | query | no | string | State, province or region. Applies to every item; an item's own field overrides it. |
| `postcode` | query | no | string | Postal code. Applies to every item; an item's own field overrides it. |
| `limit` | query | no | integer | Number of candidates to consider. Applies to every item; an item's own field overrides it. |
| `layer` | query | no | Layer | Consider only candidates of this layer. Applies to every item; an item's own field overrides it. |
| `country` | query | no | string | Comma-separated ISO 3166-1 alpha-2 codes. Applies to every item; an item's own field overrides it. |

## Responses

- `200`: One result per item, in input order.
- `400`: The body is not a JSON array of objects, or the query string did not parse.
- `405`: Method not allowed. The route accepts `GET`, and `QUERY` or `POST` for a batch.
- `413`: More items than the server's limit, or a body over its cap.
- `415`: The body was not sent as `application/json`.
- `500`: The batch failed inside the server.
- `503`: Every slot batches and jobs share is taken. Retry after the `Retry-After` header's seconds.
