A Python library for retrieving marine vessel data from MarineTraffic. Query vessels by MMSI, geographic area, or MarineTraffic URLs.
- Locate vessels by MMSI identifier
- Retrieve vessel data within geographic areas (up to 500 vessels)
- Query data directly via MarineTraffic URLs
- Flexible filtering by vessel type, flag, speed, location, and more
- Return data as JSON or pandas DataFrame
pip install aisexplorerfrom aisexplorer.AIS import AIS
# Returns vessel location data
AIS().get_location(211281610)
# Returns as pandas DataFrame
AIS(return_df=True).get_location(211281610)from aisexplorer.AIS import AIS
# Get vessels in East Mediterranean (max 500 results)
AIS(return_df=True).get_area_data("EMED")Available area codes can be found in the MarineTraffic documentation.
from aisexplorer.AIS import AIS
url = "https://www.marinetraffic.com/en/data/?asset_type=vessels&columns=..."
AIS(return_df=True).get_data_by_url(url)from aisexplorer.AIS import AIS
ais = AIS(return_df=True, return_total_count=True)
ais.set_filters(filter_config={
'latest_report': [360, 525600],
'lon': [-18, -4],
'lat': [30, 31]
})
df, count = ais.get_area_data("WMED")| Parameter | Type | Default | Description |
|---|---|---|---|
return_df |
bool | False | Return pandas DataFrame instead of dict |
return_total_count |
bool | False | Include total result count |
verbose |
bool | False | Enable verbose logging |
columns |
str/list | "all" | Columns to include |
columns_excluded |
list | None | Columns to exclude |
num_retries |
int | 10 | Number of retry attempts |
seconds_wait |
int | 15 | Seconds between retries |
- Maximum 500 vessels per area query
- Proxy support has been discontinued
- Login functionality is currently unavailable due to captcha implementation
This project is open source.