grandline

Fuzzy port-name search

Fuzzy search used by the autocomplete input on each side of the distance calculator.

Matching strategy: case-insensitive prefix match first (ILIKE 'q%'), then trigram similarity for misspellings. Results are ordered by a composite score (prefix matches always rank above pure trigram hits) so typing 'hou' surfaces 'Houston' ahead of 'South-East-Houthuizen'.

Two modes:

  • From side (no from_port_id) — returns every name match, routable or not, each annotated with routable. A non-routable hit (e.g. Mumbai, which has polygons but zero cache rows because the AIS traffic lands at JNPT next door) carries nearest_routable: the closest port by great-circle that is routable, so the UI can offer "try JNPT instead" rather than letting the famous port silently disappear.
  • To side (from_port_id set) — narrows to destinations actually reachable from that origin, so the user never sees a suggestion that would route_not_in_cache on click. These are all routable by construction (routable=true, nearest_routable=null).
get/api/v1/ports/search

Request

  • Base URL: https://grandline.luzomi.com
  • URL: https://grandline.luzomi.com/api/v1/ports/search
  • Auth: none declared

Query parameters

qstring required

Partial port name. ILIKE prefix + trigram fallback.

from_port_idinteger nullable

Optional — restrict to ports reachable from this origin (To side).

limitinteger

Response

Successful Response

port_idinteger required
port_namestring required
country_iso2string required
routableboolean
latnumber nullable
lonnumber nullable
matched_aliasstring nullable
canonical_namestring nullable

Changes

No recorded changes to this operation across all 1 revision of this API.