# COSCO Cargo Tracking Scraper (`muhammetakkurtt/cosco-cargo-tracking-scraper`) Actor

Track COSCO Shipping Lines (COSCON) cargo shipments in real time. Enter container, bill of lading, or booking numbers to get container type, current status, location, and complete shipment history. Bulk tracking with structured JSON, CSV, or Excel output.

- **URL**: https://apify.com/muhammetakkurtt/cosco-cargo-tracking-scraper.md
- **Developed by:** [Muhammet Akkurt](https://apify.com/muhammetakkurtt) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $5.00 / 1,000 tracking 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

![COSCO Container Tracking & Shipment Data Scraper — Track by Container, B/L or Booking Number](https://i.postimg.cc/prtXwyvn/cosco-shipping-lines-banner.png)

## COSCO Cargo Tracking Scraper

### What does COSCO Cargo Tracking Scraper do?

**COSCO Cargo Tracking Scraper** is an [Apify actor](https://apify.com/actors) that extracts real-time shipment tracking data from [COSCO Shipping Lines](https://lines.coscoshipping.com/), one of the world's largest container shipping carriers. Simply enter your tracking numbers — **container numbers**, **B/L (Bill of Lading) numbers**, or **booking numbers** — and the scraper automatically detects the type, queries the COSCO tracking system, and returns structured shipment data ready for analysis or integration.

No coding experience is needed. Paste your numbers, click **Start**, and download the results in JSON, CSV, Excel, or other formats.

### Why scrape COSCO shipment data?

Manually checking the COSCO website for container tracking updates is time-consuming, especially when managing multiple shipments across different trade lanes. This actor automates COSCO cargo tracking so you can:

- 📦 **Monitor shipment status** — Get the latest container status, location and movement date for every shipment
- 🔄 **Track in bulk** — Track hundreds of container, B/L, or booking numbers in a single run
- 📊 **Feed data into dashboards** — Export structured tracking data to Google Sheets, Slack, email, or your own systems via [Apify integrations](https://apify.com/integrations)
- ⏰ **Set up automated tracking** — Schedule periodic runs to monitor shipment progress without manual checks
- 🚨 **Catch exceptions early** — Track discharge, gate-out and empty-return events as they happen
- 🔗 **Build logistics pipelines** — Use the [Apify API](https://docs.apify.com/api/v2) to integrate COSCO tracking data into your supply chain tools

### What data can you extract from COSCO?

The scraper extracts the following data points from COSCO's tracking system:

| Data Field | Description |
|---|---|
| **Tracking Number** | The number you submitted |
| **Type** | Detected number type (`cntr`, `bl`, or `bkg`) |
| **Container Number** | Container number(s) resolved from the tracking number |
| **Container Type** | Container size/type (e.g. `20GP`, `40HQ`) |
| **Latest Status** | Most recent container status (e.g. *Discharged at T/S POD*, *Empty Equipment Returned*) |
| **Latest Location** | Location of the latest status (terminal, city, country) |
| **Latest Date** | Date/time of the latest status |
| **Transportation** | Transport mode of the latest movement (e.g. Vessel, Truck, Rail) |
| **Status History** | List of the container status events returned by COSCO |

### Ready-to-Run Examples

Get started in seconds — open the example in the Apify Console and click **Run**:

-   **[Track COSCO Containers by Container Number](https://apify.com/muhammetakkurtt/cosco-cargo-tracking-scraper/examples/track-cosco-containers-by-container-number)** — enter a container number and get its container type, latest status, location and status history.

### How to track COSCO shipments step by step

1. Go to the [COSCO Cargo Tracking Scraper](https://apify.com/muhammetakkurtt/cosco-cargo-tracking-scraper) on Apify Store
2. Click **Try for free** to open the actor in the Apify Console
3. Enter your tracking numbers in the **Tracking Numbers** field — one per line. Container numbers (e.g., `CSNU1036292`), B/L numbers, and booking numbers are all accepted; the type is detected automatically
4. Click **Start** to run the scraper
5. When the run finishes, preview the results in the **Output** tab, or download them as **JSON**, **CSV**, **Excel**, **XML**, **HTML**, or **RSS**

#### Example input

```json
{
  "trackingNumbers": [
    "CSNU1036292"
  ]
}
````

#### COSCO tracking input parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `trackingNumbers` | Array of strings | ✅ Yes | The numbers to track — one per line. Container numbers, B/L numbers, and booking numbers are all accepted; the type is detected automatically. |

### COSCO Cargo Tracking Scraper output example

Each tracked number produces one structured item in the dataset. Here is an example of the output when tracking a container number:

```json
{
  "tracking_number": "CSNU1036292",
  "type": "cntr",
  "total": 1,
  "containers": [
    {
      "containerNumber": "CSNU1036292",
      "containerType": "20GP",
      "latestStatus": "Discharged at T/S POD",
      "latestLocation": "Nansha Stevedoring Corporation Ltd,Nansha,Guangdong,China",
      "latestDate": "2026-07-17 12:05",
      "transportation": "Vessel",
      "statusHistory": [
        {
          "status": "Discharged at T/S POD",
          "location": "Nansha Stevedoring Corporation Ltd,Nansha,Guangdong,China",
          "date": "2026-07-17 12:05",
          "transportation": "Vessel"
        }
      ]
    }
  ]
}
```

> When you track a B/L or booking number, every container under that shipment is returned in the `containers` array. Numbers with no current tracking status are skipped and not charged.

### Integrations and COSCO tracking API

COSCO Cargo Tracking Scraper is built on the [Apify platform](https://apify.com/), which gives you powerful options to automate and integrate your cargo tracking workflow:

- **API access** — Call the actor programmatically via the [Apify API](https://docs.apify.com/api/v2) to track shipments from your own applications
- **Scheduled runs** — Set up [scheduled recurring runs](https://docs.apify.com/platform/schedules) to monitor shipment progress daily, hourly, or at any interval
- **Webhooks** — Receive notifications when a tracking run finishes so you can trigger downstream processes
- **Integrations** — Connect tracking results to [Google Sheets](https://apify.com/integrations/google-sheets), [Slack](https://apify.com/integrations/slack), [Zapier](https://apify.com/integrations/zapier), [Make](https://apify.com/integrations/make), and [many more](https://apify.com/integrations)
- **Data formats** — Download results in JSON, CSV, Excel, XML, HTML, or RSS

This makes COSCO Cargo Tracking Scraper a drop-in solution for supply chain management systems, logistics dashboards, and automated shipping notifications.

### Frequently asked questions

#### Is it legal to scrape COSCO?

Our scrapers are ethical and do not extract any private user data. They only extract publicly available shipment tracking information that any visitor can access on the COSCO website with a tracking number. We therefore believe that our scrapers, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain data related to commercial shipments. If you're unsure about your use case, consult your legal team.

#### Can I track multiple shipments at once?

Yes. Enter as many tracking numbers as you need in the **Tracking Numbers** field — one per line. The scraper processes them in parallel batches for maximum speed and uses automatic IP rotation to handle rate limits.

#### What types of tracking numbers are supported?

The scraper accepts three types of numbers and **detects the type automatically** — no manual selection needed:

- **Container numbers** — ISO 6346 format (4 letters + 7 digits, e.g., `CSNU1036292`)
- **B/L (Bill of Lading) numbers** — COSCO B/L reference numbers
- **Booking numbers** — COSCO booking reference numbers

#### What if a tracking number is not found?

If a number returns no tracking status from COSCO's system, the scraper logs a warning and skips it. You are not charged for numbers that return no results.

#### How do I get support or report issues?

If you encounter any issues or have questions about the COSCO Cargo Tracking Scraper, you can:

- Open an issue on the [Issues tab](https://apify.com/muhammetakkurtt/cosco-cargo-tracking-scraper/issues) of the actor page
- Reach out to the developer for a custom solution based on your specific tracking needs

We welcome all feedback and feature requests!

# Actor input Schema

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

The numbers to track — one per line. Container numbers, bill-of-lading numbers and booking numbers are all accepted; the type is detected automatically.

## Actor input object example

```json
{
  "trackingNumbers": [
    "CSNU1036292"
  ]
}
```

# Actor output Schema

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

Collected COSCO shipment tracking data, one item per tracking number

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammetakkurtt/cosco-cargo-tracking-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("muhammetakkurtt/cosco-cargo-tracking-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call muhammetakkurtt/cosco-cargo-tracking-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=muhammetakkurtt/cosco-cargo-tracking-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "COSCO Cargo Tracking Scraper",
        "description": "Track COSCO Shipping Lines (COSCON) cargo shipments in real time. Enter container, bill of lading, or booking numbers to get container type, current status, location, and complete shipment history. Bulk tracking with structured JSON, CSV, or Excel output.",
        "version": "0.0",
        "x-build-id": "fqSejAGUueFdgxsMq"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/muhammetakkurtt~cosco-cargo-tracking-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-muhammetakkurtt-cosco-cargo-tracking-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/muhammetakkurtt~cosco-cargo-tracking-scraper/runs": {
            "post": {
                "operationId": "runs-sync-muhammetakkurtt-cosco-cargo-tracking-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/muhammetakkurtt~cosco-cargo-tracking-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-muhammetakkurtt-cosco-cargo-tracking-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "trackingNumbers"
                ],
                "properties": {
                    "trackingNumbers": {
                        "title": "Tracking Numbers",
                        "minItems": 1,
                        "type": "array",
                        "description": "The numbers to track — one per line. Container numbers, bill-of-lading numbers and booking numbers are all accepted; the type is detected automatically.",
                        "default": [
                            "CSNU1036292"
                        ],
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
