# Container Tracking - MSC, COSCO and ONE Shipment Tracker (`s-r/container-tracking`) Actor

Track MSC, COSCO and ONE containers, bills of lading and bookings. Get normalized shipment status, ports, arrival dates, vessel legs and per-container events in one dataset.

- **URL**: https://apify.com/s-r/container-tracking.md
- **Developed by:** [SR](https://apify.com/s-r) (community)
- **Categories:** Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 tracked shipments

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Container Tracking for MSC, COSCO and ONE

Container Tracking collects shipment status, ports, vessel information, arrival dates and container events from MSC, COSCO and Ocean Network Express (ONE). Submit container numbers, bills of lading or booking references and receive a consistent shipment record for each original input position.

Use the results to monitor an import watchlist, reconcile a freight forwarder's updates, join carrier milestones to purchase orders, or keep a logistics dashboard current. The actor reads the information the carrier currently provides. It does not predict arrival dates, guarantee delivery, or reconstruct historical milestones that the source no longer exposes.

### Container Tracking coverage

The supported carriers are MSC, COSCO and ONE. Known container prefixes select the corresponding carrier automatically. For leased equipment, whose owner prefix does not identify the shipping line, automatic mode tries the supported carriers. An explicit carrier hint avoids that ambiguity when you already know who operates the shipment.

A bill of lading can contain several containers. It still produces one shipment row, with a summary for each container and a combined event list carrying each event's container number. Duplicate input numbers retain separate positions. This makes it possible to join the result back to an existing spreadsheet by its original row index.

Package couriers, Maersk, CMA CGM, Hapag-Lloyd, Evergreen and other shipping lines are outside this version's coverage. COSCO may expose only recent shipments and may restrict detailed history for visitors who are not a party to the shipment. A missing record does not prove that a container or booking is invalid.

### Input

Provide `tracking_numbers` or its alias `trackingNumbers`. Both accept an array containing between one and 500 strings. If both names are present, `tracking_numbers` takes precedence. Numbers are normalized to uppercase with whitespace removed. Empty positions remain visible as diagnostics in a mixed result, and recognized container formats are checked against their ISO 6346 check digit before a carrier lookup.

This input was used in the local validation run:

```json
{"trackingNumbers":["MSCU0203658","CSNU1036292","ONEU0024740","MEDUEZ472303","HELLO"]}
```

The first three entries are container numbers, the fourth is an MSC bill of lading, and the final entry returned no shipment. These are historical examples taken from actual carrier responses. Their continued availability depends on the carrier's retention policy; replace them with references from your own shipment list for operational use.

The `carrier` option accepts `auto`, `msc`, `cosco` or `one`. The `number_type` option accepts `auto`, `container`, `bill_of_lading` or `booking`. Select `booking` explicitly for MSC and COSCO booking references. ONE accepts booking references with or without the `ONEY` prefix. Set `include_events` to `false` when you only need shipment summaries and the latest event. This option returns empty timeline arrays and avoids requesting the full ONE event history.

### Output

Each row includes `tracking_number`, `input_index`, `carrier`, `number_type`, `found`, `status`, `last_event`, `origin`, `destination`, loading and discharge ports, `eta`, `ata`, vessel information, `containers`, `legs`, and `events`. The `source` field identifies this product and `fetched_at` records the retrieval time in UTC. Fields the carrier does not supply are null rather than estimated.

For the recorded MSC container, selected returned fields were:

```json
{"tracking_number":"MSCU0203658","carrier":"msc","found":true,"status":"Empty received at CY","origin":"MELBOURNE, AU","destination":"HONG KONG, HK","eta":null,"events_count":6}
```

Dates retain their source precision. MSC events contain calendar dates without a time. COSCO timestamps are local times without an offset. ONE event timestamps use the source UTC event field. ONE's latest-event search summary carries local time, so that summary is returned without a UTC suffix when the full event timeline is unavailable or was not requested. Do not assume that every timestamp describes the same time zone.

The event list is sorted from oldest to newest, followed by undated entries. Each entry identifies its container and preserves the source description, location, raw date and available terminal or vessel details. Container summaries do not duplicate the full event array. `events_count` counts the events actually delivered, so it is zero when timelines were not requested.

Only MSC supplies an explicit delivery flag in the supported responses. COSCO and ONE return `delivered: null`; a returned empty container or an absent ETA is not converted into an inferred delivery promise. Arrival estimates can disappear after delivery. When a requested detail cannot be collected, the run summary reports partial results and an explanatory warning.

COSCO's bill of lading document status is returned separately as `bill_of_lading_status`. Shipment `status` uses the carrier's shipment state or latest event and remains null when neither is available. A document label such as “Sea Waybill” does not describe shipment progress.

### Pricing

The actor uses a run-start event and a tracking-result event. A tracking result is one delivered shipment row with `found: true`, regardless of how many containers or events it contains. Diagnostic positions with `found: false` do not trigger the tracking-result event. An entirely empty lookup has no result charges; the run-start event still applies. Current event prices are displayed in the actor's Pricing tab.

Non-paying users can submit up to ten input positions per run. This cap counts original positions, including duplicates and empty entries. Paying users can submit up to 500 positions. Separate runs are separate lookups and may return updated source information.

### Running larger lists

The actor continues larger lists automatically. Direct API callers can continue using `next_cursor` and `completed_indices` while preserving the original input array. Keep both continuation fields together so positions that finished out of order are not fetched again. Warnings describe any requested timeline, voyage information or input positions that could not be completed. If a carrier is temporarily unavailable, retry the affected references later.

### FAQ

#### Can I track parcels or every shipping line?

This version supports ocean shipments from MSC, COSCO and ONE. Parcel tracking and additional ocean carriers require other sources and are outside the supported scope.

#### Why is ETA null for a shipment that was found?

The carrier may not publish an estimate, may remove it after delivery, or may not provide it for that lookup type. The actor never calculates an ETA from departure time and assumed transit duration.

#### Why does a bill of lading produce just one row?

The input reference identifies one shipment lookup. Its containers appear in `containers`, while each returned milestone in `events` includes `container_number`. Filter that field to reconstruct a particular container's timeline.

#### Why are there fewer historical events for COSCO?

The public carrier view can limit shipment history for visitors who are not a party to the shipment. The actor returns the status or voyage information actually provided and does not fill missing history with generated milestones.

#### Can I use the output in a spreadsheet or database?

Yes. Export the dataset in the formats offered by Apify. Use `input_index` to join each row to the original list, `tracking_number` for the normalized reference, and `fetched_at` to distinguish repeated monitoring runs.

# Actor input Schema

## `tracking_numbers` (type: `array`):

Container, bill of lading or booking numbers. Original positions and duplicates are preserved; empty positions are free diagnostics.

## `trackingNumbers` (type: `array`):

Alias of tracking_numbers; tracking_numbers takes precedence when both are present.

## `carrier` (type: `string`):

Carrier hint. Auto detects known prefixes and tries MSC, COSCO and ONE for leased containers.

## `number_type` (type: `string`):

Set booking for MSC or COSCO bookings; ONE accepts booking numbers with or without ONEY.

## `include_events` (type: `boolean`):

Include the full event timeline. False skips ONE event requests and returns empty event arrays while retaining last_event.

## `cursor` (type: `integer`):

Continue at next_cursor using the unchanged original list.

## `completed_indices` (type: `array`):

Original positions already delivered by previous pages; required with cursor when later positions finished earlier.

## Actor input object example

```json
{
  "tracking_numbers": [
    "MSCU0203658"
  ],
  "carrier": "auto",
  "number_type": "auto",
  "include_events": true,
  "cursor": 0
}
```

# Actor output Schema

## `results` (type: `string`):

Normalized shipment tracking results.

# 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 = {
    "tracking_numbers": [
        "MSCU0203658"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("s-r/container-tracking").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 = { "tracking_numbers": ["MSCU0203658"] }

# Run the Actor and wait for it to finish
run = client.actor("s-r/container-tracking").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 '{
  "tracking_numbers": [
    "MSCU0203658"
  ]
}' |
apify call s-r/container-tracking --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,s-r/container-tracking"
        }
    }
}
```

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/NyyUY6yrnQYXdbOL1/builds/Xvcdde2eBW7Cf0hHs/openapi.json
