# Maersk Port Calls & Vessel Schedules Scraper (`arman-bd/maersk-port-calls-scraper`) Actor

Berth-level port calls and full vessel rotations for Maersk and Sealand: ETA/ETD, terminal, voyage number and service code, for any port or vessel.

- **URL**: https://apify.com/arman-bd/maersk-port-calls-scraper.md
- **Developed by:** [Arman Hossain](https://apify.com/arman-bd) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 port call scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Maersk Port Calls & Vessel Schedules Scraper

![Maersk Port Calls: Berth level port calls and full vessel rotations, with terminal, ETA, ETD and service code](https://api.apify.com/v2/key-value-stores/ZQOcNAOHrIgTacAmy/records/maersk-port-calls-scraper.jpg)

Pulls berth-level port calls and full vessel rotations straight from the schedule platform behind [maersk.com/schedules](https://www.maersk.com/schedules). Give it a port (or several) and you get every vessel calling there in a date window, with terminal, ETA/ETD, voyage number and service code. Give it a vessel and you get its full forward rotation: every remaining port of call through the end of your window.

No login, no proxy and no browser are required to use this Actor. It reads structured JSON directly, for both the Maersk (MAEU) and Sealand (MCPU) brands.

**Agent skill: [SKILL.md](https://api.apify.com/v2/key-value-stores/t7YoTxpZEJOWvw4Ug/records/maersk-port-calls-scraper.md)**

```
https://api.apify.com/v2/key-value-stores/t7YoTxpZEJOWvw4Ug/records/maersk-port-calls-scraper.md
```

### What you get

One record per port call or per rotation leg. `source` tells you which flow produced it.

| Field | What it holds |
|---|---|
| `source` | `port-call` (from a port lookup) or `vessel-rotation` (from a vessel lookup) |
| `vesselMaerskCode`, `vesselName`, `vesselIMONumber`, `flagISOCountryCode`, `callSign` | Vessel identity |
| `marineContainerTerminalName`, `marineContainerTerminalRKSTCode`, `marineContainerTerminalGeoCode` | The berth/terminal called |
| `arrivalTime`, `arrivalTimingClassifier` | ETA or ATA, and whether it is `ESTIMATED` or `ACTUAL` |
| `departureTime`, `departureTimingClassifier` | ETD or ATD, and its own estimated/actual flag |
| `arrivalVoyageNumber`, `departureVoyageNumber` | Inbound and outbound voyage numbers for this call |
| `arrivalServiceName`, `arrivalServiceCode`, `departureServiceName`, `departureServiceCode` | The named service (trade lane) each leg runs on |
| `isoCountryCode`, `countryName`, `unLocationCode`, `cityName`, `portName`, `portCode`, `regionCode` | Port geography |
| `carrierCodesQueried` | Which brand(s) (`MAEU`, `MCPU`) this call was requested under |
| `queriedPort`, `queriedVessel` | The raw input that produced this record, whichever one applies |
| `scrapedAt` | Run timestamp |

`RUN_SUMMARY` in the key-value store holds per-run counts, the resolved window, and any port or vessel that could not be matched.

### Use cases

- **Berth-window benchmarking.** Pull a terminal's port calls over a rolling window to track how estimated ETAs move against actuals.
- **Carrier-of-record ETAs.** Feed `arrivalTime`/`departureTime` into a supply-chain visibility tool as the carrier's own published schedule.
- **Vessel tracking without AIS.** A vessel's full forward rotation, port by port, without a satellite feed.
- **Service-lane mapping.** Group by `arrivalServiceCode` to see which vessels and ports share a named service.
- **Rate/routing tools.** Cross-reference `portCode`/`unLocationCode` against a rate sheet to see which sailings are actually available in a window.

### Quick start

Nothing at all: the next two weeks of port calls at Rotterdam:

```json
{}
```

One port, a specific window:

```json
{
 "ports": ["Singapore"],
 "fromDate": "2026-09-01",
 "toDate": "2026-09-21"
}
```

A vessel's full rotation, both brands:

```json
{
 "vessels": ["Madrid Maersk"],
 "fromDate": "2026-09-01",
 "toDate": "2026-11-01",
 "carrierCodes": ["MAEU", "MCPU"]
}
```

Several ports and a vessel in one run:

```json
{
 "ports": ["NLRTM", "USNYC", "Tanjung Pelepas"],
 "vessels": ["9260914"],
 "maxRecords": 300
}
```

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `ports` | array | `["NLRTM"]` | UN/LOCODE, Maersk port code, or a city/port name, matched against Maersk's live port list. Leave empty together with `vessels` to default to Rotterdam. |
| `vessels` | array | `[]` | Maersk vessel code, IMO number, or vessel name, matched against Maersk's live vessel list. Leave empty to skip vessel rotations. |
| `fromDate` | string | today | `YYYY-MM-DD`. Start of the schedule window. |
| `toDate` | string | `fromDate` + 14 days | `YYYY-MM-DD`. End of the schedule window. 2-4 week windows answer reliably. |
| `carrierCodes` | array | `["MAEU"]` | `MAEU` (Maersk) and/or `MCPU` (Sealand). Both are queried together in one request. |
| `maxRecords` | integer | `500` | Total cap across every port and vessel. `0` means no limit. |

Nothing is required. Running with no input returns Rotterdam's next two weeks.

### Output example

A berth-level port call:

```json
{
 "source": "port-call",
 "vesselMaerskCode": "W04",
 "vesselName": "MAERSK SARAT",
 "vesselIMONumber": "9732591",
 "flagISOCountryCode": "LR",
 "callSign": "D5JH6",
 "marineContainerTerminalName": "Hutchison Ports Delta II",
 "marineContainerTerminalRKSTCode": "NLROT01",
 "marineContainerTerminalGeoCode": "2LME4YKE32WZJ",
 "arrivalTime": "2026-08-22T00:06:00+02:00",
 "arrivalTimingClassifier": "ACTUAL",
 "departureTime": "2026-08-23T03:45:00+02:00",
 "departureTimingClassifier": "ESTIMATED",
 "arrivalVoyageNumber": "628N",
 "departureVoyageNumber": "628N",
 "arrivalServiceName": "SAECS",
 "arrivalServiceCode": "278",
 "departureServiceName": "SAECS",
 "departureServiceCode": "278",
 "isoCountryCode": "NL",
 "countryName": "Netherlands",
 "unLocationCode": "NLRTM",
 "cityName": "Rotterdam",
 "portName": "Rotterdam",
 "portCode": "1JUKNJGWHQBNJ",
 "regionCode": "ZH",
 "carrierCodesQueried": ["MAEU"],
 "queriedPort": "NLRTM",
 "queriedVessel": null,
 "scrapedAt": "2026-08-21T22:50:54.635Z"
}
```

A leg from a vessel's forward rotation looks the same shape, with `source: "vessel-rotation"` and `queriedVessel` set instead of `queriedPort`.

### Naming a port or vessel

| You write | Matched against |
|---|---|
| `NLRTM` | `unLocationCode` on Maersk's active-port list |
| `1JUKNJGWHQBNJ` | Maersk's own 13-character `portCode` |
| `Rotterdam`, `Tanjung Pelepas` | `cityName`/`portName`, exact first, then a loose match |
| `T9P` | `vesselMaerskCode` on Maersk's active-vessel list |
| `9260914` | `vesselIMONumber` |
| `Madrid Maersk` | `vesselName`, exact first, then a loose match |

A name that matches nothing is recorded in `RUN_SUMMARY.failures` rather than stopping the run; every other port or vessel in the same call still gets processed.

### API example

```bash
curl -X POST "https://api.apify.com/v2/acts/arman-bd~maersk-port-calls-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
 "ports": ["NLRTM"],
 "fromDate": "2026-09-01",
 "toDate": "2026-09-15"
 }'
```

### JavaScript example

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('arman-bd/maersk-port-calls-scraper').call({
 vessels: ['Madrid Maersk'],
 fromDate: '2026-09-01',
 toDate: '2026-11-01',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const leg of items) {
 console.log(`${leg.portName}: ETA ${leg.arrivalTime} (${leg.arrivalTimingClassifier})`);
}
```

### Notes

- `arrivalTimingClassifier`/`departureTimingClassifier` flip from `ESTIMATED` to `ACTUAL` as a call happens. Re-run the same port or vessel later in the day to see actuals replace estimates.
- A port lookup returns every vessel calling there in the window; a vessel lookup returns every port that vessel calls in the window. The two are complementary, not duplicates of each other.
- `carrierCodesQueried` records which brand(s) you asked for, not which brand operates that specific call. Maersk's schedule API does not expose that split when both brands are queried together.
- `maxRecords` bounds the whole run. Once it is reached, later ports or vessels in your list are not even requested, which is why `RUN_SUMMARY.requestsMade` can be lower than expected on a tightly capped run.
- A resolved port or vessel with nothing scheduled in your window is a legitimate empty result, not a failure, so it will not appear in `RUN_SUMMARY.failures`.

### FAQ

**Do I need a Maersk account or API key?** No. You supply no credentials.

**Can I get Sealand (MCPU) sailings too?** Yes, add `MCPU` to `carrierCodes`. Both brands run on the same schedule platform.

**How far ahead can I query?** Maersk answers 2-4 week windows reliably; the default is 14 days. Wider windows are accepted but risk truncation on busy ports, so a long-range pull is more reliable as several shorter windows.

**What if I misspell a port or vessel name?** It is recorded in `RUN_SUMMARY.failures` with the input you gave, and every other target in the same run still completes.

**Does this track vessel position (AIS)?** No. It returns Maersk's own published schedule (ETAs, ETDs, ports, terminals), not live GPS position.

**Can I plug it into something else?** Yes. Apify API, the client libraries, webhooks, scheduled runs, dataset exports to JSON, CSV or Excel, or MCP. The output is structured JSON.

# Actor input Schema

## `ports` (type: `array`):

Ports to pull berth-level port calls for. Give a UN/LOCODE ('NLRTM'), Maersk's own port code, or a city/port name ('Rotterdam', 'Tanjung Pelepas'): each is matched against Maersk's live list of active ports. Leave empty together with 'vessels' to default to Rotterdam.

## `vessels` (type: `array`):

Vessels to pull the full forward rotation for: every remaining port of call, terminal, ETA/ETD, voyage number and service. Give a Maersk vessel code, an IMO number, or a vessel name: each is matched against Maersk's live list of active vessels. Leave empty to skip vessel rotations.

## `fromDate` (type: `string`):

Start of the schedule window, as YYYY-MM-DD. Leave empty to start today.

## `toDate` (type: `string`):

End of the schedule window, as YYYY-MM-DD. Leave empty to run 14 days from 'From date'. Maersk answers 2-4 week windows reliably; a much wider window risks truncation on busy ports.

## `carrierCodes` (type: `array`):

Which brand's schedule to read. MAEU is Maersk, MCPU is Sealand, Maersk's intra-regional subsidiary running the same schedule platform. Selecting both queries them together in one request per port or vessel.

## `maxRecords` (type: `integer`):

Stop after this many records total, across every port and vessel combined. This is the most you can be charged for in one run. Set 0 for no limit, bounded only by what the date window actually contains.

## Actor input object example

```json
{
  "ports": [
    "NLRTM",
    "Singapore",
    "USNYC"
  ],
  "vessels": [
    "Madrid Maersk",
    "9260914"
  ],
  "fromDate": "2026-09-01",
  "toDate": "2026-09-15",
  "carrierCodes": [
    "MAEU"
  ],
  "maxRecords": 500
}
```

# Actor output Schema

## `items` (type: `string`):

Every port call or rotation leg the run produced.

## `runsummary` (type: `string`):

The RUN\_SUMMARY record from the run's key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "ports": [
        "NLRTM"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("arman-bd/maersk-port-calls-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "ports": ["NLRTM"] }

# Run the Actor and wait for it to finish
run = client.actor("arman-bd/maersk-port-calls-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "ports": [
    "NLRTM"
  ]
}' |
apify call arman-bd/maersk-port-calls-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,arman-bd/maersk-port-calls-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/rLKkPc7QIbJlQVF7R/builds/7KLSUtwH0z3bu0DQi/openapi.json
