# Get Port Details by unlocode

> Ports Intelligence API, GET /ports/{unlocode}: Retrieve detailed informations about a specific port by its UNLOCODE.

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

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

Retrieve detailed informations about a specific port by its UNLOCODE. It include the berth occupation rate and the difference with the average one.

## Path parameters

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

## Responses

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

Body: `application/json`, object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `portDetails` | object | No | — |
| `portDetails.name` | string | No | Name of the port. |
| `portDetails.longitude` | number (float) | No | Longitude coordinate. |
| `portDetails.latitude` | number (float) | No | Latitude coordinate. |
| `portDetails.unlocode` | string | No | UN/LOCODE of the port. |
| `portDetails.countryName` | string | No | Country name. |
| `portDetails.countryCode` | string | No | ISO country code. |
| `portOccupationData` | object, nullable | No | — |
| `portOccupationData.portOccupationLevel` | number (float) | No | Current port occupation percentage. |
| `portOccupationData.portOccupationDifferenceFromAverage` | number (float) | No | Difference with average occupation. |

Example response body:

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

::

::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"
}
```

::
