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

# List ports

> Preview: Lists ports filtered by code and freight mode.



## OpenAPI

````yaml /openapi.json get /v1/ports
openapi: 3.1.0
info:
  title: OVRSEA API
  version: 1.3.2
servers:
  - url: https://api.cf.ovrsea.com
security: []
paths:
  /v1/ports:
    get:
      tags:
        - Ports
      summary: List ports
      description: 'Preview: Lists ports filtered by code and freight mode.'
      parameters:
        - schema:
            pattern: ^(?:[A-Za-z0-9]{3}|[A-Za-z0-9]{2}/?[A-Za-z0-9]{3})$
            type: string
          in: query
          name: code
          required: false
          description: >-
            Preview: Exact port code. Use a three-character air code, or a
            five-character standard code with or without its separator, such as
            `FR/LEH` or `FRLEH`. An exact stored alternative code is accepted as
            well.
        - schema:
            enum:
              - air
              - ocean
              - rail
            type: string
          in: query
          name: freight_mode
          required: false
          description: 'Preview: Filter by freight mode.'
        - schema:
            default: 0
            minimum: 0
            type: integer
          in: query
          name: skip
          required: false
          description: 'Preview: Number of matching ports to skip.'
        - schema:
            default: 10
            maximum: 100
            minimum: 0
            type: integer
          in: query
          name: take
          required: false
          description: 'Preview: Maximum number of matching ports to return.'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                properties:
                  items:
                    description: 'Preview: Matching ports.'
                    items:
                      $ref: '#/components/schemas/PortPreview'
                    type: array
                  total:
                    description: 'Preview: Number of matching ports before pagination.'
                    type: integer
                required:
                  - items
                  - total
                type: object
        '400':
          description: >-
            Preview: The port code or freight mode is malformed. The code is
            `invalid_request`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    PortPreview:
      modelName: PortPreview
      type: object
      description: 'Preview: Port returned by the ports collection.'
      properties:
        id:
          description: 'Preview: Public id of the port.'
          type: string
        name:
          description: 'Preview: Name of the port.'
          example: Le Havre
          type: string
        freight_mode:
          description: 'Preview: Freight mode handled by the port.'
          enum:
            - air
            - ocean
            - rail
          type: string
        unlocode:
          description: >-
            Preview: Canonical code. The ports collection accepts this value
            with or without its separator.
          example: FR/LEH
          type: string
        city:
          description: 'Preview: City of the port.'
          example: Le Havre
          type: string
        country:
          description: 'Preview: ISO 3166-1 alpha-2 country code.'
          example: FR
          type: string
    ApiError:
      modelName: ApiError
      type: object
      description: 'Preview: Error returned by a preview route.'
      properties:
        code:
          description: 'Preview: Stable code describing what went wrong.'
          type: string
        field:
          description: >-
            Preview: Request input that needs correction. For a query or path
            parameter, this is the parameter name. For one body input, this is
            its root-relative dot-separated path, with array indexes in
            brackets, such as `cargo.loads[0].count`. For a refusal concerning
            several inputs on one body object, this is that object's path. For a
            refusal concerning the request as a whole, this field is omitted.
          type: string
        message:
          description: 'Preview: One-sentence explanation and next step.'
          type: string
        retry_after_seconds:
          description: >-
            Preview: Number of seconds to wait before retrying, when the
            response is rate limited.
          type: integer
      required:
        - code
        - message

````

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