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

# Port Calls By Port

> Retrieve vessel traffic data for a specific port including arrivals, departures, expected vessels, and vessels currently in port. Costs 5 credits per request. Rate limit: 15 requests/min.

Retrieve vessel traffic data for a specific port including arrivals, departures, expected vessels, and vessels currently in port.

<Info>
  **Credits:** 50 credits per request
</Info>

## Search Types

Use the `search_type` parameter to filter results:

| Type        | Description                |
| ----------- | -------------------------- |
| `arrival`   | Recently arrived vessels   |
| `departure` | Recently departed vessels  |
| `expected`  | Vessels expected to arrive |
| `in_port`   | Vessels currently in port  |

## Port Codes

Use UN/LOCODE format for the `port_call` parameter:

| Port                   | UN/LOCODE |
| ---------------------- | --------- |
| Barcelona, Spain       | ESBCN     |
| Rotterdam, Netherlands | NLRTM     |
| Singapore              | SGSIN     |
| Shanghai, China        | CNSHA     |
| Los Angeles, USA       | USLAX     |

## Pagination

Results are paginated. Use the `page` parameter (starting from 1) to navigate through results.

## Optional Filtering

Use `vessel_type` to filter results by vessel category.

## Response Data

* **Total**: Total number of vessels matching criteria
* **Pages**: Total pages available
* **List**: Array of vessel data including MMSI, name, IMO, type, country, dimensions, and formatted ETA


## OpenAPI

````yaml GET /port-calls-by-port
openapi: 3.1.0
info:
  title: Data Docked Maritime API
  description: >-
    A comprehensive maritime data API providing real-time vessel tracking, port
    operations, inspection data, and more. Access AIS data, vessel particulars,
    management information, and historical tracking data.
  version: 1.0.0
  contact:
    name: Data Docked Support
    url: https://datadocked.com/contact
servers:
  - url: https://datadocked.com/api/vessels_operations
    description: Production server
security:
  - apiKey: []
tags:
  - name: Account
    description: Account management endpoints
  - name: Vessel Operations
    description: Vessel data, location, and tracking endpoints
  - name: Port Operations
    description: Port calls and port data endpoints
paths:
  /port-calls-by-port:
    get:
      tags:
        - Port Operations
      summary: Port Calls By Port
      description: >-
        Retrieve vessel traffic data for a specific port including arrivals,
        departures, expected vessels, and vessels currently in port. Costs 5
        credits per request. Rate limit: 15 requests/min.
      operationId: getPortCallsByPort
      parameters:
        - name: port_call
          in: query
          required: true
          description: >-
            The UN/LOCODE of the port you want to query (e.g., ESBCN for
            Barcelona).
          schema:
            type: string
          example: ESBCN
        - name: search_type
          in: query
          required: true
          description: The type of search to perform.
          schema:
            type: string
            enum:
              - arrival
              - departure
              - expected
              - in_port
          example: arrival
        - name: page
          in: query
          required: true
          description: Page number for pagination. Pagination starts with page number 1.
          schema:
            type: integer
            minimum: 1
          example: 1
        - name: vessel_type
          in: query
          required: false
          description: Filter results by vessel type.
          schema:
            type: string
      responses:
        '200':
          description: Successful response with port traffic data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortCallsByPortResponse'
        '400':
          description: Bad request - Invalid port code or parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PortCallsByPortResponse:
      type: object
      properties:
        status_code:
          type: integer
        detail:
          type: object
          properties:
            arrival:
              type: object
              properties:
                total:
                  type: integer
                  description: Total vessels
                pages:
                  type: integer
                  description: Total pages
                list:
                  type: array
                  items:
                    type: object
                    properties:
                      mmsi:
                        type: integer
                      name:
                        type: string
                      imo:
                        type: integer
                      type:
                        type: string
                      year:
                        type: integer
                      country:
                        type: string
                      a2:
                        type: string
                        description: Country code
                      gt:
                        type: integer
                        description: Gross tonnage
                      dw:
                        type: integer
                        description: Deadweight
                      sa:
                        type: boolean
                        description: Ship active
                      sizes:
                        type: string
                        description: Dimensions
                      formattedETA:
                        type: string
                        description: Formatted ETA
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error type
        message:
          type: string
          description: Error message
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your personal API key found in your profile dashboard at
        https://datadocked.com/dashboard/my_keys

````