Charter Boats API
Locations

List Locations

Search locations with boat counts and geographic aggregation

Endpoint

GET /locations

Description

Search and list locations with boat and POI counts. Returns both individual locations (marinas, anchorages) and aggregated geographic results (cities, states, countries) when a search query matches higher-level regions.

Results are cached for 5 minutes.

Authentication

No authentication required. This is a public endpoint.

Query Parameters

ParameterTypeRequiredDescription
qstringNoSearch query
limitnumberNoMax results (default: 20, max: 200)
idsstringNoComma-separated location IDs to fetch directly

Example Requests

Search by Name

curl "https://charter.boats/api/locations?q=greece&limit=10"

Fetch by IDs

curl "https://charter.boats/api/locations?ids=4521,4523,4530"
[
  {
    "id": "country:GR",
    "type": "country",
    "name": "Greece",
    "lat": 38.25,
    "lon": 20.48,
    "country": "Greece",
    "country_code": "GR",
    "location": "Greece",
    "boat_count": 1240,
    "poi_count": 3500,
    "location_count": 485
  },
  {
    "id": "state:Western Greece:GR",
    "type": "state",
    "name": "Western Greece",
    "lat": 38.41,
    "lon": 20.62,
    "state": "Western Greece",
    "country": "Greece",
    "country_code": "GR",
    "location": "Western Greece, Greece",
    "boat_count": 320,
    "poi_count": 890,
    "location_count": 62
  },
  {
    "id": 4521,
    "type": "marina",
    "name": "D-Marin Lefkas",
    "lat": 38.8335,
    "lon": 20.7068,
    "city": "Lefkada",
    "state": "Western Greece",
    "country": "Greece",
    "country_code": "GR",
    "location": "Lefkada, Western Greece, Greece",
    "boat_count": 45,
    "poi_count": 12,
    "harbour_category": "marina"
  }
]

Example Response (IDs)

{
  "locations": [
    {
      "id": 4521,
      "name": "D-Marin Lefkas",
      "lat": 38.8335,
      "lon": 20.7068,
      "city": "Lefkada",
      "state": "Western Greece",
      "country": "Greece",
      "country_code": "GR",
      "harbour_category": "marina",
      "poi_count": 12
    }
  ]
}
FieldTypeDescription
idnumber|stringLocation ID (number) or aggregate key (e.g. country:GR)
typestringResult type: marina, city, municipality, state, or country
namestringLocation or region name
latnumberLatitude (center point for aggregates)
lonnumberLongitude (center point for aggregates)
citystring|nullCity name
statestring|nullState or region
countrystring|nullCountry name
country_codestring|nullISO country code
locationstringFormatted location string
boat_countnumberNumber of available boats
poi_countnumberNumber of points of interest
harbour_categorystring|nullType of harbour (marina type only)
location_countnumberNumber of locations in this region (aggregate types only)

Sorting

Results are sorted by:

  1. Locations with boats first
  2. Aggregate types first (country, state, municipality, city, marina)
  3. Boat count descending

On this page