Search Locations
Typeahead search for marinas, anchorages, and bays
Endpoint
Description
A location is an overnight stop — a marina, harbour, or anchorage where you can berth or drop anchor and spend the night aboard your boat. (Towns and regions aren't locations; they only appear as aggregated groupings.)
Fast typeahead search for locations (marinas, anchorages, bays). Uses normalized matching that handles special characters -- for example, searching "dalbora" matches "d'Albora Marina".
Returns a lightweight response suitable for autocomplete UIs.
Authentication
Send X-API-Key: YOUR_API_KEY on every call from outside charter.boats — without it Cloudflare bot protection answers with an HTML 403 page, not JSON. Call it from your server: this route sends no CORS headers (only the exact GET /api/locations index does). See Authentication.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Search query (minimum 2 characters) |
limit | number | No | Max results (default: 10, max: 20) |
Example Request
Example Response
Response Fields
| Field | Type | Description |
|---|---|---|
id | number | Location ID |
osm_id | number|null | OpenStreetMap node ID |
name | string | Location name |
lat | number | Latitude |
lon | number | Longitude |
city | string|null | City name |
state | string|null | State or region |
country | string|null | Country name |
harbour_category | string|null | Type of harbour (e.g. marina, harbour, anchorage) |
Notes
- Returns an empty array if
qis missing or shorter than 2 characters. - Matching ignores case, accents and punctuation. A location matches when its name contains the query, when its city/region/country text contains it, or — for a multi-word query — when every word appears somewhere in the name, city, region or country, in any order ("marina frapa rogoznica").
- Results are ordered: names that start with the query first, then names that contain it, then city/region/country text matches, then all-words matches; ties are alphabetical by name. There is no popularity or boat-count ranking here — use List Locations for that.
- Only published locations are searched, and places without a name are never returned (an unnamed anchorage is not matched through its town's name).