# MarineTraffic Vessel Scraper (`kibaale/marinetraffic-vessel-scraper`) Actor

Scrapes MarineTraffic vessel details and live AIS positions: identity, position, voyage, speed history and photos by name/MMSI/IMO, every vessel in an area, or port info. Clean JSON, no browser, no login.

- **URL**: https://apify.com/kibaale/marinetraffic-vessel-scraper.md
- **Developed by:** [kibalee](https://apify.com/kibaale) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 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.

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

## MarineTraffic Vessel Scraper

Scrape [MarineTraffic](https://www.marinetraffic.com) — the world's largest AIS ship-tracking network — into clean, structured records: vessel identity, live position, voyage, speed history, photos, area snapshots and port info. Pure HTTP: no browser, no login, no proxy.

### What you get

One record per vessel (details bundle or area row) or port in the run's default dataset:

| Field | Description |
|---|---|
| `shipId`, `name`, `aisName` | MarineTraffic's vessel id, name and AIS broadcast name |
| `imo`, `mmsi`, `callsign` | IMO number, MMSI and call sign |
| `flag`, `flagCode`, `vesselType`, `subtype` | Flag state, vessel type and subtype (e.g. Container Ship) |
| `length`, `width`, `aisClass` | Dimensions and AIS transponder class |
| `lat`, `lon`, `speed`, `course`, `heading` | Last AIS position, speed and course |
| `draught`, `navigationalStatus` | Draught and status (e.g. Underway using Engine) |
| `positionUpdatedAt`, `areaName` | When the position was reported and the sea area |
| `reportedDestination`, `departurePortId`, `arrivalPortId` | Voyage plan |
| `departedAt`, `estimatedArrivalAt`, `voyageProgressPct` | ATD, ETA and progress in percent |
| `builderName`, `yearBuilt`, `description` | Vessel wiki particulars |
| `speedHistory`, `etaHistory`, `maxSpeed`, `avgSpeed` | With **Include speed history** (last ~24h) |
| `photoUrls` | With **Include photo URLs** (up to 20) |
| `url` | The vessel's MarineTraffic page |

Area scans return the AIS map fields instead: `name`, `lat`, `lon`, `speed`, `course`, `heading`, `elapsedMinutes` (age of the signal), `destination`, `flag`, `length`, `width`, `dwt`, `shipType`, plus `shipId` and `url` to fetch the full details later.

Port records carry `portId`, `name`, `unlocode`, `country`, `countryCode`, `lat`, `lon`, `portType`, `size`, `timezone`, `summary`, `companies` and `url`.

### Example output

```json
{
  "type": "vessel",
  "shipId": "5630138",
  "name": "EVER GIVEN",
  "imo": 9811000,
  "mmsi": 636026627,
  "flag": "LIBERIA",
  "vesselType": "Cargo - Hazard A (Major)",
  "length": 399.94,
  "lat": 32.49,
  "lon": -13.78,
  "speed": 19.6,
  "navigationalStatus": "Underway using Engine",
  "positionUpdatedAt": "2026-09-28T07:06:03+00:00",
  "reportedDestination": "SG SIN",
  "estimatedArrivalAt": "2026-10-23T17:00:00+00:00",
  "voyageProgressPct": 14.65,
  "url": "https://www.marinetraffic.com/en/ais/details/ships/shipid:5630138"
}
```

### How to use

**Vessel details** — put a vessel name, MMSI or IMO into *Vessel search term* (e.g. `EVER GIVEN`, `636026627` or `9811000`), or paste MarineTraffic shipIds into *Vessel IDs* to skip the search. Every match becomes a record with the full detail bundle.

**Area snapshot** — set *Area center latitude*, *Area center longitude* and *Area radius (km)* to get every vessel with a recent AIS signal inside that circle, e.g. the Singapore Strait (`1.26`, `103.85`, radius `20`). Busy waters return hundreds of vessels. The actor picks the map zoom automatically and filters rows to the exact radius.

**Port info** — paste port ids into *Port IDs* (e.g. `290` for Singapore) for port records with name, UN/LOCODE, country and companies.

*Max vessels* caps vessel records and area rows. Leave every input empty for a small default sample.

### Typical runs

- Fleet monitoring — a list of vessel names or MMSIs, *Include speed history* on, scheduled daily.
- Area intelligence — a radius around a strait, port approach or fishing ground, one snapshot per run.
- Port research — port ids for identity, location and the companies operating there.
- Enrichment — area scan first, then feed the resulting `shipId`s back into *Vessel IDs* for full details.

### Notes

- Positions are the last AIS signal the site publishes, not a live stream — a run is a snapshot. `elapsedMinutes` (area rows) tells you how fresh each signal is.
- MarineTraffic keeps expected arrivals, port calls, congestion and statistics behind a paid subscription, so this actor does not offer them. Voyage data (`reportedDestination`, ETA) comes from the public vessel pages instead.
- `speedHistory` is the recent speed curve the site shows, capped to the last 50 points.
- Runs are throttled with a small delay between requests and parallel workers; no proxy or browser is required.

### Local development

```bash
pip install -r requirements.txt
python3 -m src --search "EVER GIVEN" --timeline --photos
python3 -m src --area 1.26,103.85,20 --limit 50
python3 -m src --ports 290 --json
```

# Actor input Schema

## `searchTerm` (type: `string`):

Vessel name, MMSI or IMO number. Returns the details of every matching vessel (up to Max vessels). Leave empty to skip search.

## `vesselIds` (type: `array`):

MarineTraffic shipIds (one per line) to fetch directly, no search needed. You can find them in vessel page URLs.

## `centerLat` (type: `number`):

With center longitude and radius: snapshot every AIS vessel in that circle. E.g. 1.26 for Singapore Strait.

## `centerLon` (type: `number`):

E.g. 103.85 for Singapore Strait.

## `radiusKm` (type: `number`):

How far around the center to scan. The actor picks the map zoom automatically (up to 400 tiles).

## `portIds` (type: `array`):

MarineTraffic port ids (one per line) for port records with name, UN/LOCODE, country, summary and companies.

## `includeTimeline` (type: `boolean`):

Add the vessel's recent speed history, ETA history and max/average speed (one extra request per vessel).

## `includePhotos` (type: `boolean`):

Add up to 20 photo URLs per vessel (one extra request per vessel).

## `maxVessels` (type: `integer`):

Upper bound for vessel records and area rows.

## Actor input object example

```json
{
  "searchTerm": "EVER GIVEN",
  "vesselIds": [],
  "portIds": [],
  "includeTimeline": false,
  "includePhotos": false,
  "maxVessels": 1000
}
```

# Actor output Schema

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

Records stored in the run's default dataset

# 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 = {
    "searchTerm": "EVER GIVEN",
    "vesselIds": [],
    "portIds": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("kibaale/marinetraffic-vessel-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 = {
    "searchTerm": "EVER GIVEN",
    "vesselIds": [],
    "portIds": [],
}

# Run the Actor and wait for it to finish
run = client.actor("kibaale/marinetraffic-vessel-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 '{
  "searchTerm": "EVER GIVEN",
  "vesselIds": [],
  "portIds": []
}' |
apify call kibaale/marinetraffic-vessel-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kibaale/marinetraffic-vessel-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/cyXaS29sVGIFykWIg/builds/2Fo6jvEznw63nruJI/openapi.json
