# Search Port Details by its name or unlocode

> Ports Intelligence API, GET /ports/search: Search a port by its UN/LOCODE or its name and retrieve its details.

::callout{type="warning"}
**Beta.** The Ports Intelligence API is in beta (version `1.0.0-beta`): its contract may still change.
::

`GET /ports/search` on the Ports Intelligence API. Base URL: `https://api.sinay.ai/ports-intelligence/api/v1`.

Search a port by its UN/LOCODE or its name and retrieve its details.

## Query parameters

::api-parameters{location="query"}
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `filter` | string | Yes | UN/LOCODE or the name of the port (e.g., FRLEH or Le Havre). Example: `FRLEH`. |
::

## Responses

::api-response
---
status: "200"
description: Successful response
---

Body: `application/json`, object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | No | Name of the port. |
| `longitude` | number (float) | No | Longitude coordinate. |
| `latitude` | number (float) | No | Latitude coordinate. |
| `unlocode` | string | No | UN/LOCODE of the port. |
| `countryName` | string | No | Country name. |
| `countryCode` | string | No | ISO country code. |

Example response body:

```json
{
  "portDetails": {
    "name": "LE HAVRE",
    "longitude": 0.146204,
    "latitude": 49.4726,
    "unlocode": "FRLEH",
    "countryName": "France",
    "countryCode": "FR"
  }
}
```

::

::api-response
---
status: "401"
description: Authentication information is missing or invalid
---

Body: `application/json`, object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | string | No | Error message. |
| `code` | string | No | Error code. |
| `timestamp` | string (date-time) | No | Error timestamp. |

Example response body:

```json
{
  "error": "Unauthorized",
  "code": "AUTH_001",
  "timestamp": "2025-07-17T10:30:00Z"
}
```

::

::api-response
---
status: "404"
description: The requested resource was not found
---

Body: `application/json`, object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | string | No | Error message. |
| `code` | string | No | Error code. |
| `timestamp` | string (date-time) | No | Error timestamp. |

Example response body:

```json
{
  "error": "Resource not found",
  "code": "NOT_FOUND",
  "timestamp": "2025-07-17T10:30:00Z"
}
```

::

::api-response
---
status: "500"
description: Internal server error
---

Body: `application/json`, object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | string | No | Error message. |
| `code` | string | No | Error code. |
| `timestamp` | string (date-time) | No | Error timestamp. |

Example response body:

```json
{
  "error": "Internal server error",
  "code": "INTERNAL_ERROR",
  "timestamp": "2025-07-17T10:30:00Z"
}
```

::
