---
title: "List routable ports in a country"
method: GET
path: "/api/v1/ports/by-country"
tags: ["grandline"]
---

# List routable ports in a country

`GET /api/v1/ports/by-country`

## Request

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

Drives the port dropdown. Without `from_port_id`, lists every port in
the country with `routable_origin = TRUE`. With it, restricts to ports
that are cached destinations from the given origin.

## Query parameters

- `iso2` string, required: ISO-3166-1 alpha-2 country code, e.g. 'US'.
- `from_port_id` integer, nullable: Optional — if set, only return ports reachable from this origin.
- `limit` integer

## Response `200`

Successful Response

- PortRow[]
  - `port_id` integer, required
  - `port_name` string, required
  - `country_iso2` string, required

## 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)
