# Yang Ming Cargo Tracking Scraper — Container, B/L & Booking (`haketa/yangming-scraper`) Actor

Track Yang Ming (YML) shipments by container, B/L or booking number: status, full move/event history, vessel and voyage, origin/destination ports, dates, containers, seals and weight. Keyless, no anti-bot.

- **URL**: https://apify.com/haketa/yangming-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** Other, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.75 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Yang Ming Cargo Tracking Scraper — Container, B/L & Booking

Track **Yang Ming (YML) shipments** in bulk by **container number, Bill of Lading, or booking number** — and get status, full **move/event history**, **vessel & voyage**, **origin/destination ports with dates**, containers, seals and weight. Clean JSON/CSV/Excel.

Uses Yang Ming Marine Transport's public tracking endpoint — **keyless, no anti-bot, pure HTTP** — so it's fast and reliable at scale.

***

### What this Actor does

Give it tracking numbers and for each one it returns a full shipment record:

- **Identity** — the resolved number, track type (Container / B/L / Booking), booking reference.
- **Status & history** — current status plus the complete **move/event history** (event, facility, mode, date) for containers.
- **Voyage** — vessel name, voyage code, on-board date.
- **Route** — origin (receipt/loading) and destination (discharge/delivery) ports, plus the **routing schedule with actual dates** for B/Ls.
- **Cargo** — containers (number, size, type, seal), container count, package count and gross weight.

Three identifier types are supported automatically:

- **Container** — e.g. `YMLU3560471` (YMLU/YMMU prefix + 7 digits).
- **Bill of Lading** — e.g. `N237068499`.
- **Booking** — e.g. `M0123456`.

***

### Why use it

- **Supply-chain visibility at scale.** Track hundreds of containers/B/Ls in one run instead of typing them into the website one by one.
- **Full event history.** Not just the latest status — the complete move timeline per container (gate-in/out, loaded, discharged, empty returned…).
- **Vessel, route & dates.** Origin/destination ports, vessel/voyage and actual routing dates — everything an ops/logistics team needs.
- **Keyless & clean.** Public JSON endpoint, no API key, no anti-bot, no captcha — just tracking numbers in, structured data out.

***

### Who it's for

- **Freight forwarders & 3PLs** monitoring Yang Ming shipments for clients.
- **Importers / exporters** tracking their containers and B/Ls.
- **Supply-chain & ops teams** building shipment dashboards and ETAs.
- **Logistics software** needing a structured Yang Ming tracking feed.

***

### Quick start

#### Run it in the console (no code)

1. In **Tracking numbers**, add one per line (container, B/L or booking):

   ```
   YMLU3560471
   N237068499
   M0123456
   ```

2. Click **Start**, then export as **JSON, CSV, Excel or HTML**.

Leave it empty to run a **demo** (a container + a B/L).

#### Run it via API (Python)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = { "trackingNumbers": ["YMLU3560471", "N237068499"] }

run = client.actor("YOUR_USERNAME/yangming-scraper").call(run_input=run_input)

for r in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"{r['trackingNumber']} [{r['trackType']}] {r['origin']} -> {r['destination']} | {r['currentStatus'] or r['latestEvent']}")
```

#### Run it via API (JavaScript)

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('YOUR_USERNAME/yangming-scraper').call({
    trackingNumbers: ['YMLU3560471'],
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((r) => console.log(`${r.trackingNumber}: ${r.vesselName} ${r.voyage} — ${r.latestEvent}`));
```

***

### Input

| Field | Type | Description |
|---|---|---|
| **Tracking numbers** | array | Container / B/L / booking numbers, one per line. Spaces & hyphens ignored. Empty = demo. |
| **Speed (parallel lookups)** | integer | How many numbers to track at once. Default 10. |
| **Proxy configuration** | object | Apify Proxy. On by default. |

***

### Output

One record per tracking number.

**Container** example:

```json
{
  "trackingNumber": "YMLU3560471",
  "found": "true",
  "trackType": "Container No",
  "containerSize": "20",
  "containerType": "Dry cargo container",
  "currentStatus": "Empty Returned",
  "latestEvent": "Empty Returned @KEELUNG - YANGMING KEELUNG TERMINAL (2026/09/30 16:33)",
  "eventCount": "12",
  "events": "2026/02/15 11:30: Loaded on Vessel @SHANGHAI [Vessel] | ... | 2026/09/30: Empty Returned @KEELUNG [Truck]",
  "blnoList": "N237068499",
  "scrapedAt": "2026-10-12T12:00:00.000Z"
}
```

**Bill of Lading** example:

```json
{
  "trackingNumber": "N237068499",
  "found": "true",
  "trackType": "B/L No",
  "origin": "SHANGHAI, SH (CNSHA)",
  "destination": "ROTTERDAM (NLRTM)",
  "vesselName": "HMM DUBLIN",
  "voyage": "018W",
  "onboardDate": "2026/02/15",
  "packages": "538",
  "grossWeight": "3255.4 KGS",
  "containerCount": "1",
  "containers": "YMLU3560471(20 YMAV279733): Empty Returned @ROTTERDAM - CETEM",
  "routing": "SHANGHAI: 2026/02/15 11:30 (Actual); ROTTERDAM: 2026/04/05 12:15 (Actual)",
  "scrapedAt": "2026-10-12T12:00:00.000Z"
}
```

| Field | Description |
|---|---|
| `trackingNumber` / `found` / `trackType` | Query, whether found, and type (Container / B/L / Booking). |
| `currentStatus` / `latestEvent` / `eventCount` / `events` | Status and full move/event history (containers). |
| `vesselName` / `voyage` / `onboardDate` | Voyage info. |
| `origin` / `destination` / `routing` | Ports and routing schedule with actual dates (B/L). |
| `containerSize` / `containerType` / `sealNo` / `containerCount` / `containers` | Cargo & container details. |
| `packages` / `grossWeight` | Cargo totals (B/L). |
| `blnoList` | Associated B/L numbers (container). |
| `responseMessage` | Message when a number isn't found. |
| `scrapedAt` | ISO timestamp. |

***

### Tips & notes

- **Container vs B/L.** A container number returns that box's full move history; a B/L returns the whole shipment (route, vessel, all containers). Use whichever you have.
- **Bulk tracking.** Paste your entire list — the Actor de-dupes effort and runs them in parallel.
- **Status monitoring.** Schedule the Actor to re-track active shipments and capture new events/ETAs over time.
- **Number formats.** Container = YMLU/YMMU + 7 digits; B/L and booking are document references. Don't confuse letter O with zero.
- **Not found.** Delivered-long-ago or wrong numbers return `found: false` with Yang Ming's message.

***

### Frequently asked questions

**Do I need an API key?**
No — it uses Yang Ming's public tracking endpoint, keyless and without anti-bot.

**Can I track by B/L and booking, not just container?**
Yes — container, Bill of Lading and booking numbers all work; the type is detected automatically.

**Do I get the full event history?**
Yes — for containers you get the complete move timeline, not just the latest status.

**Can I track many shipments at once?**
Yes — paste a whole list; they're tracked in parallel.

**Is it good for a logistics dashboard?**
Yes — clean, structured status, route, vessel and event data is ideal for ops dashboards and ETA monitoring.

***

### Export & integrate

Results are available as **JSON, CSV, Excel, HTML** and via the **Apify API**. Push to **Google Sheets**, a **webhook**, **Make**, **Zapier** or your database — and **schedule** runs to keep shipment statuses fresh.

*Data from Yang Ming Marine Transport's public cargo-tracking service. Not affiliated with Yang Ming.*

# Actor input Schema

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

One tracking number per line — a container number (e.g. `YMLU3560471`), a B/L number (e.g. `N237068499`), or a booking number (e.g. `M0123456`). Spaces/hyphens are ignored. Leave empty for a demo.

## `maxConcurrency` (type: `integer`):

How many numbers to track at once.

## `proxyConfiguration` (type: `object`):

Apify Proxy. On by default — the endpoint is public, rotation keeps large runs smooth.

## Actor input object example

```json
{
  "trackingNumbers": [
    "YMLU3560471",
    "N237068499"
  ],
  "maxConcurrency": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `trackingNumber` (type: `string`):

Queried number

## `found` (type: `string`):

Whether a shipment was found

## `trackType` (type: `string`):

Container No / B/L No / Booking

## `returnTrackNo` (type: `string`):

Normalized number

## `bkgRef` (type: `string`):

Booking reference

## `currentStatus` (type: `string`):

Current status

## `containerSize` (type: `string`):

Container size

## `containerType` (type: `string`):

Container type

## `sealNo` (type: `string`):

Seal number

## `origin` (type: `string`):

Receipt / loading port

## `destination` (type: `string`):

Discharge / delivery port

## `vesselName` (type: `string`):

Vessel name

## `voyage` (type: `string`):

Voyage code

## `onboardDate` (type: `string`):

On-board date

## `packages` (type: `string`):

Package count

## `grossWeight` (type: `string`):

Gross weight

## `containerCount` (type: `string`):

Number of containers

## `containers` (type: `string`):

Containers (no/seal/event)

## `routing` (type: `string`):

Routing schedule with dates

## `latestEvent` (type: `string`):

Most recent move/event

## `eventCount` (type: `string`):

Event count

## `events` (type: `string`):

Full move/event history

## `blnoList` (type: `string`):

Associated B/L numbers

## `responseMessage` (type: `string`):

Message when not found

## `scrapedAt` (type: `string`):

Timestamp

# 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 = {
    "trackingNumbers": [
        "YMLU3560471",
        "N237068499"
    ],
    "maxConcurrency": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/yangming-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 = {
    "trackingNumbers": [
        "YMLU3560471",
        "N237068499",
    ],
    "maxConcurrency": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/yangming-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 '{
  "trackingNumbers": [
    "YMLU3560471",
    "N237068499"
  ],
  "maxConcurrency": 10
}' |
apify call haketa/yangming-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,haketa/yangming-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/OxEu2WPnib6F9yLNs/builds/pycLQ2JxGBS4kiCTW/openapi.json
