# Marinetraffic Ship Detail (`romy/marinetraffic-ship-detail`) Actor

Marine Traffic Scraper is a fast and lightweight Apify actor designed to fetch real-time vessel data from MarineTraffic using latitude, longitude, and zoom level inputs. It queries MarineTraffic tile endpoints to extract live AIS ship information without needing an official API key.

- **URL**: https://apify.com/romy/marinetraffic-ship-detail.md
- **Developed by:** [Romy](https://apify.com/romy) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.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/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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## 🛳️ MarineTraffic Ship Detail Scraper

MarineTraffic Ship Detail Scraper is a fast and lightweight Apify actor designed to fetch detailed real-time vessel information from MarineTraffic by ship ID. It queries MarineTraffic's info window endpoint to extract full AIS ship details without needing an official API key.

### 🎯 Features

- 📡 **Real-Time Ship Data** – Retrieve up-to-date vessel details by ship ID.
- 🚢 **Full Ship Metadata** – Includes ship name, MMSI, IMO, type, dimensions, flag, speed, course, destination, ETA, and more.
- 🗺️ **Voyage Info** – Departure/arrival port, estimated route, and voyage timeline.
- 🧩 **Clean JSON Output** – Structured results ideal for analysis and integration.

### 🚀 How to Use

1. Run the actor on Apify Console or via API.
2. Provide input with the following field:
   - `ship_id`: MarineTraffic Ship ID (e.g., `7605737`)
3. Wait for execution to complete and download results in JSON format.

### 📌 Example Input

```json
{
  "ship_id": "7605737"
}
````

### 📦 Example Output

```json
{
  "actor_input": {
    "ship_id": "7605737"
  },
  "ship": {
    "text": {
      "must_login": "You need to log in to use this feature",
      "upload_photo": "Upload a photo",
      "vessel_info_unavailable": "Vessel Info Unavailable",
      "please_try_again_later": "Please Try Again In A Few Minutes",
      "ship_photos": "Ship Photos",
      "add_notifications": "Create Notifications",
      "vessel_details": "Vessel details",
      "status_name": "Underway Using Engine",
      "status": "Navigational status",
      "speed_course": "Speed/Course",
      "received": "Received",
      "managed_vessels": "Managed Vessels",
      "operated_by": "Operated By",
      "load_condition": "Load condition",
      "load_status_name": "Partially Laden",
      "draught": "Draught",
      "ais_source": "AIS source",
      "rates": "Rates",
      "more_info": "MORE INFO",
      "actions_on_map": "ACTIONS ON MAP",
      "upload_href": "/en/photos/upload-photo?asset_id=7605737",
      "img_href": "/en/photos/of/ships/shipid:7605737/ship_name:SAWASDEE_RIGEL",
      "img_thumb": "https://www.marinetraffic.com/photoCollection/getAssetDefaultPhoto?asset_id=7605737&asset_type_id=0&photo_size=150",
      "img_medium": "https://www.marinetraffic.com/photoCollection/getAssetDefaultPhoto?asset_id=7605737&asset_type_id=0&photo_size=300",
      "infowin_noimg": "",
      "type_color_img": "/img/vessel_types/vi7.png",
      "flag_img": "/img/flags/png40/MH.png",
      "ship_detail_url": "/en/ais/details/ships/shipid:7605737/mmsi:538010501/imo:9943803/vessel:SAWASDEE_RIGEL",
      "notifications_url": "/en/users/my_account/notifications/index/wizard/shipid:7605737",
      "station_url": ""
    },
    "values": {
      "light_iw": false,
      "vessel_history_limit": 1,
      "country_code": "MH",
      "show_chartering_btn": false,
      "has_voyage_forecast_snippet": true,
      "reported_draught": "Reported Draught: 8.2m<br />Max Draught: 10.5m",
      "no_data_available": false,
      "dest_class": "gotocoords",
      "port_data_x": "120.32008",
      "port_data_y": "36.05661",
      "last_pos": 1759720285,
      "last_pos_tooltip": 1759720285,
      "elapsed": 1759720285,
      "timezone_offset": 540,
      "show_load_status": 2,
      "vsl_length": 172,
      "vsl_code": "",
      "type_summary": "Cargo",
      "load_status": {
        "reported_draught": ["Reported Draught", "8.2m"],
        "max_draught": ["Max draught", "10.5m"]
      },
      "vessel_in_fleet": false,
      "ship_id": "7605737",
      "ship_type": "7",
      "mmsi": "538010501",
      "imo": "9943803",
      "type_name": "Container Ship",
      "country": "Marshall Is",
      "shipname": "SAWASDEE RIGEL",
      "course": "255",
      "dwt": "22253",
      "speed": "14.80",
      "ship_lat": "36.737106",
      "ship_lon": "125.40504",
      "draught": "82",
      "last_port_id": "2428",
      "last_port_name": "INCHEON",
      "last_port_country": "KR",
      "last_port_unlocode": "KRINC",
      "next_port_id": "1254",
      "next_port_name": "QINGDAO",
      "next_port_country": "CN",
      "next_port_unlocode": "CNQDG",
      "photos_count": "10",
      "station_operator": "",
      "past_track_url": "/en/ais/home/shipid:7605737/tracktype:7/lpt:1759704180",
      "forecast_url": "/en/ais/home/shipid:7605737/tracktype:7",
      "base_name": "Terrestrial",
      "station_name": ""
    },
    "voyage": {
      "estimated_route_found": true,
      "destination_expanded": "Route Forecast unavailable.<br />Could not find a valid known route from the vessel's current position to CNQDG.",
      "route_forecast_destination": "CNQDG",
      "show_vessel_track": "Show Previous Track",
      "estimated_track": "Show Route Forecast",
      "distance_to": "Distance from here",
      "position_history": "Position history",
      "itineraries": "Voyage Timeline",
      "port_calls": "Port calls",
      "near_vessels": "Nearby Vessels",
      "past_track": "Past track",
      "track_forecast": "Route forecast",
      "full_info_access": "For full access",
      "upgrade_now": "upgrade to activate",
      "plans_url": "/en/online-services/plans",
      "departure_port_info_tooltip": "INCHEON [KR]",
      "departure_port_info_label": "<span class=\"text-default\">KR</span><span class=\"text-default text-darker\">INC</span>",
      "departure_port_info_country_code": "KR",
      "departure_port_info_port_code": "INC",
      "departure_port_info_id": "2428",
      "departure_port_info_fontSize": "160%",
      "departure_port_info_title": "Actual Time of Departure",
      "departure_port_info_titleLabel": "ATD",
      "departure_port_info_portTime": 1759704180,
      "departure_port_info_offset": "540",
      "departure_port_url": "/en/ais/details/ports/2428?name=INCHEON&country=Korea",
      "last_port_timestamp": 1759704180,
      "arrival_port_info_tooltip": "QINGDAO [CN]",
      "arrival_port_info_country_code": "CN",
      "arrival_port_info_port_code": "QDG",
      "arrival_time_title": "Estimated Time of Arrival",
      "arrival_time_label": "Reported ETA",
      "arrival_time_datetime": 1759791600,
      "arrival_time_offset": "480",
      "arrival_port_info_label": "<span class=\"text-default\">CN</span><span class=\"text-default text-darker\">QDG</span>",
      "arrival_port_info_fontSize": "160%",
      "arrival_port_url": "/en/ais/details/ports/1254?name=QINGDAO&country=China",
      "timeline_class": "",
      "triangle_pos": 20.689655172413794,
      "itineraries_url": "/en/data/?asset_type=voyage_timeline&quicksearch_vessel=7605737|SAWASDEE RIGEL",
      "positions_url": "/en/online-services/plans/voyage-data/",
      "lock_positions": true,
      "port_moves_url": "/en/data/?asset_type=arrivals_departures&ship_in=7605737|SAWASDEE RIGEL",
      "ships_url": "/en/ais/index/ships/nearby/mmsi:538010501/shipid:7605737/shipname:SAWASDEE%20RIGEL",
      "dest_rep": "CN TAO",
      "snippet_state_id": 3,
      "show_upgrade_voyage_forecast": true,
      "info_tooltip": {
        "eta_calculated_at_speed": ["Calculated ETA at", "hidden"],
        "eta_calculated": ["Calculated ETA", "hidden"],
        "eta_reported": ["Reported ETA", 1759791600],
        "reported_destination": ["Reported Destination", "CN TAO"],
        "estimated_time_departure": ["Predictive ETD", "hidden", "beta"]
      },
      "snippet_tooltip": [
        ["Distance Travelled", "hidden"],
        ["Distance To Go", "hidden"],
        ["Total Voyage Distance", "hidden"],
        ["Time To Destination", "hidden"]
      ]
    },
    "fleetcontrols": {
      "default_fleet_id": null,
      "fleets": [],
      "ship_in_fleet": null,
      "ship_in_fleet_activation": 0,
      "add_to_my_fleet": "Add to fleet",
      "add_to_default_fleet": "Add to default fleet",
      "add_to_current_fleet": "Add to current fleet",
      "toggle_dropdown": "Toggle Dropdown",
      "show_available_fleets": "Show available fleets",
      "add_to_new_fleet": "Add to new Fleet",
      "fleet_help": "Create a new Fleet, which will include this vessel."
    }
  }
}
```

### 🔐 Disclaimer

This actor scrapes data from publicly accessible endpoints on MarineTraffic. You are responsible for ensuring your usage complies with MarineTraffic’s terms of service. For official and reliable access, we recommend using the MarineTraffic API.

### 🛠️ Support

If you encounter any issues or have questions, please reach out via the Apify Console or the Apify community forum.

# Actor input Schema

## `ship_id` (type: `string`):

The MarineTraffic ship ID (e.g., 7605737).

## Actor input object example

```json
{
  "ship_id": "7605737"
}
```

# Actor output Schema

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

No description

# 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 = {
    "ship_id": "7605737"
};

// Run the Actor and wait for it to finish
const run = await client.actor("romy/marinetraffic-ship-detail").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 = { "ship_id": "7605737" }

# Run the Actor and wait for it to finish
run = client.actor("romy/marinetraffic-ship-detail").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 '{
  "ship_id": "7605737"
}' |
apify call romy/marinetraffic-ship-detail --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=romy/marinetraffic-ship-detail",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Marinetraffic Ship Detail",
        "description": "Marine Traffic Scraper is a fast and lightweight Apify actor designed to fetch real-time vessel data from MarineTraffic using latitude, longitude, and zoom level inputs. It queries MarineTraffic tile endpoints to extract live AIS ship information without needing an official API key.",
        "version": "0.0",
        "x-build-id": "ASdzu82zWBUiJmJaU"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/romy~marinetraffic-ship-detail/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-romy-marinetraffic-ship-detail",
                "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/romy~marinetraffic-ship-detail/runs": {
            "post": {
                "operationId": "runs-sync-romy-marinetraffic-ship-detail",
                "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/romy~marinetraffic-ship-detail/run-sync": {
            "post": {
                "operationId": "run-sync-romy-marinetraffic-ship-detail",
                "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": [
                    "ship_id"
                ],
                "properties": {
                    "ship_id": {
                        "title": "Ship ID",
                        "type": "string",
                        "description": "The MarineTraffic ship ID (e.g., 7605737)."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
