---
title: "Ports Lookup"
method: GET
path: "/api/v1/ports/lookup"
tags: ["grandline"]
---

# Ports Lookup

`GET /api/v1/ports/lookup`

## Request

- Base URL: `https://grandline.luzomi.com`
- URL: `https://grandline.luzomi.com/api/v1/ports/lookup`
- Auth: none declared

Resolve a port name, UN-LOCODE, or coordinates into a canonical port record.
Returns port_id, country_iso2, port_name, and lat/lon (from nearest polygon centroid).

## Query parameters

- `q` string, required: Port name, UN-LOCODE, or lat,lon coordinates

## Response `200`

Successful Response

- PortRecord
  - `port_id` integer, required
  - `port_name` string, required
  - `country_iso2` string, required
  - `lat` number, nullable
  - `lon` number, nullable
  - `unlocode` string, nullable
  - `routable` boolean

## Other responses

- `400`: Validation error with extra context
- `404`: Resource not found
- `422`: Validation Error
- `429`: Rate-limit exceeded — see X-RateLimit-* headers

---

[API](https://skmtc.dev/luzomi/apis/grandline-api.md) · [All operations](https://skmtc.dev/luzomi/apis/grandline-api/llms.txt) · [OpenAPI document](https://skmtc.dev/luzomi/apis/grandline-api/revisions/4ce06aea012b?raw)
