# Search addresses

`GET /search`

Geocodes free-form text, such as a full address, to coordinates. Results
are sorted by `score`, highest first.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `q` | query | yes | string | Text to geocode, such as a full address. |
| `limit` | query | no | integer | Maximum number of results. `0`, the default, lets the server choose. |
| `layer` | query | no | Layer | Return only results of this layer. An unknown layer returns `400`. |
| `country` | query | no | string | Return only results in these countries, as comma-separated ISO 3166-1 alpha-2 codes. A code that is not two letters returns `400`. A code the Pack does not cover returns no results. |
| `focus` | query | no | string | Point to prefer results near, as `lon,lat`. Breaks ties between equally good matches only. |
| `bbox` | query | no | string | Return only results inside this box, as `min_lon,min_lat,max_lon,max_lat`. The box cannot cross the antimeridian. |

## Responses

- `200`: Matching results, highest `score` first.
- `400`: `q` is empty or too long, `limit` is too large, `focus` or `bbox` is out of range, or a parameter is malformed.
- `405`: Method not allowed. The route accepts `GET` only.
- `500`: Internal server error.
