> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.ovrsea.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Find a port

> Returns the port of a freight method filed under a UN/LOCODE or an IATA code.



## OpenAPI

````yaml /openapi.json get /v1/ports/{locode}
openapi: 3.1.0
info:
  title: OVRSEA API
  version: 1.3.2
servers:
  - url: https://api.cf.ovrsea.com
security: []
paths:
  /v1/ports/{locode}:
    get:
      tags:
        - Ports
      summary: Find a port
      description: >-
        Returns the port of a freight method filed under a UN/LOCODE or an IATA
        code.
      parameters:
        - schema:
            enum:
              - air
              - ocean
              - rail
            type: string
          in: query
          name: freight_method
          required: true
        - schema:
            example: FRLEH
            pattern: ^([A-Za-z0-9]{3}|[A-Za-z0-9]{5})$
            type: string
          in: path
          name: locode
          required: true
          description: >-
            5-character UN/LOCODE for ocean and rail, 3-letter IATA code for
            air. An alternative code of the port also matches.
      responses:
        '200':
          description: The port.
          content:
            application/json:
              schema:
                description: The port.
                properties:
                  city:
                    type: string
                    example: Le Havre
                  country:
                    type: string
                    example: FR
                  freight_method:
                    enum:
                      - air
                      - ocean
                      - rail
                    example: ocean
                    type: string
                  id:
                    description: OVRSEA identifier of the port.
                    example: '2'
                    type: string
                  name:
                    type: string
                    example: Le Havre
                  unlocode:
                    description: Code under which the port is stored.
                    example: FR/LEH
                    type: string
                required:
                  - country
                  - freight_method
                  - id
                  - name
                  - unlocode
                type: object
        '400':
          description: The code is malformed or the freight method is missing.
          content:
            application/json:
              schema:
                description: The code is malformed or the freight method is missing.
                type: string
        '404':
          description: No port of this freight method is filed under this code.
          content:
            application/json:
              schema:
                description: No port of this freight method is filed under this code.
                properties:
                  message:
                    type: string
                required:
                  - message
                type: object

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.