Search ports by name, country, UN/LOCODE or bounding box

Changed on

Ports of the World Port Index and UN/LOCODE. q matches the name or an alternate name (case and accent insensitive): exact names first, then names starting with q, then the rest; larger harbors first within each group. Response: ports (Port objects), count, total, offset, next_offset (null on the last page) and meta (attribution and notice). Port lookups use no credits.

get/v1/ports

Request

  • Base URL: https://api.aistrail.com
  • URL: https://api.aistrail.com/v1/ports
  • Auth: HTTP bearer

Query parameters

qstring

2 to 64 characters

countrystring

ISO 3166-1 alpha-2 country code, e.g. NL

locodestring

UN/LOCODE, e.g. NLRTM

bboxstring

lat_min,lon_min,lat_max,lon_max

port_idstring

Up to 100 port ids, comma separated

limitinteger

1-500

offsetinteger

0-10000; use next_offset from the previous page

format'json' | 'csv' | 'xlsx'

json, csv (text/csv) or xlsx (Excel workbook); csv and xlsx columns id, name, alternate_names (| separated), country, locode, lat, lon, harbor_size, harbor_type, radius_km, with X-Count, X-Total and X-Attribution headers

Response

ok

Changes

    • info

      added the new enum value xlsx to the query request parameter format

    • info

      added the media type application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for the response with the status