Vessel positions near Helsinki with an AIS API request and source comparison

The Marine Traffic API is MarineTraffic’s programmatic route to maritime tracking and related vessel data. Its official service catalog distinguishes AIS positions, vessel information, events and historical services; choose the service that matches your application.

This guide separates access questions from implementation evidence. Our quick run on October 17, 2026 used public pages and an open Digitraffic substitute, producing a small snapshot, not a benchmark. We had no entitled MarineTraffic key and made no calls to its API.


Key Facts

  • Our quick run on October 17, 2026 made no MarineTraffic API calls.
  • The Digitraffic location sample contained 52 vessels.
  • All 52 sampled positions matched metadata by MMSI.
  • Median position age in that sample was 65 seconds.
  • The oldest sampled position was 7.8 hours old.
  • The separate Python export contained 49 vessels with names.

What does the Marine Traffic API provide?

MarineTraffic has APIs for AIS tracking, vessel information, real-time events, past events and predictions. Those categories are distinct products in its API services overview, so one entitlement should not be assumed to include every dataset.

AIS means Automatic Identification System. Ships broadcast identity and movement information using VHF, with position and timing normally derived from onboard satellite navigation equipment, as explained by the USCG AIS technical overview. This article concerns maritime tracking, not aviation.

Keep identifiers separate from observations: MMSI identifies the transmitting station, while a position describes an observation at a particular time. Preserve source identifiers and timestamps when joining vessel metadata. A ship position also cannot establish whether a particular container is aboard; shipment milestones require a separate integration.


How much does the Marine Traffic API cost, and is it free?

There is no verified universal API price or generally available free tier to quote here. MarineTraffic describes API services as sales-supported and separate from online subscriptions in its account access guide.

For Marine Traffic API pricing (as of October 2026), obtain a service-specific quote. Do not substitute a consumer subscription price, assume a trial includes production rights, or infer a credit conversion from an unrelated endpoint.

Ask what creates a charge: requests, returned vessels, historical records, geographic coverage or another unit. Get written answers about empty responses, retries, overages, credit expiry, satellite observations and redistribution. Then estimate monthly usage from your vessel count, polling schedule and retention requirements.

We measured no MarineTraffic credit balance changes. Our successful open-data calls incurred no API charge and needed no proxy, but their regional results cannot establish the cost of an equivalent global service.


How do you obtain a key and authenticate requests?

Arrange access to the required service, then open My Account and API Services to inspect its key and documentation. MarineTraffic’s key management instructions explain that service details vary.

The current AIS API reference declares an API key named api_key in the query string. Follow your selected service’s documentation for the endpoint, required identifiers and output format; do not transplant an old URL from a repository.

Keep secrets server-side in an environment variable or secret store. Redact query strings from logs, error reports and monitoring traces. Validate one authorized request before scheduling collection, and inspect both the HTTP result and response body.


How do you request vessel positions with Python?

The tested example uses Digitraffic, not MarineTraffic. Its marine documentation identifies separate location and vessel-metadata endpoints; our script joins their results by MMSI.

Our Linux run used Python 3.12 and Requests. Install Requests with python -m pip install requests, save the script as ais_vessels.py, and run python ais_vessels.py. Leave PROXY_URL unset for the direct connection used in our export. See the Requests quickstart and our request translation guide for request mechanics.

"""Free AIS vessel positions from Digitraffic (Finnish Transport Infrastructure Agency).
Open data (CC BY 4.0), no signup, no API key. Coverage: Baltic Sea / Finnish waters only.
This is NOT the MarineTraffic API (that one needs a paid key)."""
import csv, math, os, time
from datetime import datetime, timezone
import requests

BASE = "https://meri.digitraffic.fi/api/ais/v1"
HEADERS = {"Digitraffic-User": "DataImpulse/ais-tutorial",  # Digitraffic asks apps to identify themselves
           "Accept-Encoding": "gzip"}
PROXY = os.environ.get("PROXY_URL")  # optional, not needed here; e.g. http://USER__cr.us:[email protected]:823
PROXIES = {"http": PROXY, "https": PROXY} if PROXY else None
BBOX = (24.80, 60.05, 25.20, 60.25)  # min_lon, min_lat, max_lon, max_lat: Helsinki approaches
SHIP_TYPES = {3: "special", 4: "high-speed", 5: "special", 6: "passenger", 7: "cargo", 8: "tanker", 9: "other"}


def get_json(url, params=None):
    for attempt in range(1, 4):
        r = requests.get(url, params=params, headers=HEADERS, proxies=PROXIES, timeout=30)
        if r.status_code == 200:
            return r.json()
        print(f"{url} -> HTTP {r.status_code}, retry {attempt}")
        time.sleep(5 * attempt)
    r.raise_for_status()


def positions_in_bbox(bbox):
    """The API filters by point + radius (km), so ask for a circle around the box and trim to the box."""
    min_lon, min_lat, max_lon, max_lat = bbox
    lat, lon = (min_lat + max_lat) / 2, (min_lon + max_lon) / 2
    half_w = (max_lon - min_lon) / 2 * 111.32 * math.cos(math.radians(lat))
    half_h = (max_lat - min_lat) / 2 * 110.57
    radius = math.ceil(math.hypot(half_w, half_h))
    data = get_json(f"{BASE}/locations", {"latitude": lat, "longitude": lon, "radius": radius})
    out = []
    for feat in data["features"]:
        x, y = feat["geometry"]["coordinates"]  # GeoJSON order: lon, lat
        if min_lon <= x <= max_lon and min_lat <= y <= max_lat:
            out.append((x, y, feat["properties"]))
    return out


def main():
    positions = positions_in_bbox(BBOX)
    time.sleep(2)
    vessels = {v["mmsi"]: v for v in get_json(f"{BASE}/vessels")}  # name, IMO, type, destination
    rows = []
    for lon, lat, p in positions:
        meta = vessels.get(p["mmsi"], {})
        ship_type = meta.get("shipType")
        rows.append({
            "mmsi": p["mmsi"],
            "name": meta.get("name"),
            "imo": meta.get("imo") or None,
            "ship_type": SHIP_TYPES.get((ship_type or 0) // 10, "unknown") if ship_type else None,
            "destination": meta.get("destination"),
            "lat": lat,
            "lon": lon,
            "sog_knots": p["sog"],
            "cog_deg": p["cog"],
            "heading": None if p["heading"] == 511 else p["heading"],  # 511 = not available
            "nav_status": p["navStat"],
            "timestamp_utc": datetime.fromtimestamp(p["timestampExternal"] / 1000, timezone.utc).isoformat(),
        })
    rows.sort(key=lambda r: r["timestamp_utc"], reverse=True)
    with open("ais_vessels.csv", "w", newline="") as fh:
        writer = csv.DictWriter(fh, fieldnames=rows[0].keys())
        writer.writeheader()
        writer.writerows(rows)
    named = sum(1 for r in rows if r["name"])
    print(f"{len(rows)} vessels in box, {named} with name/type metadata -> ais_vessels.csv")
    for r in rows[:3]:
        print(r["mmsi"], r["name"], r["ship_type"], r["lat"], r["lon"], r["sog_knots"], r["timestamp_utc"])


if __name__ == "__main__":
    main()

Source artifacts: ais_vessels.py and its ais_vessels.csv output. The export contained 49 vessels, all named, and completed in 7.5 seconds including a two-second pause. Its approximately 16 km circle was trimmed to the Helsinki box; this differs from the 20 km diagnostic query below.

The script assumes nonempty results and expected fields. An empty selection fails at rows[0]; network exceptions are not retried. Its printed name count does not prove complete type metadata. These are limits of the tested example.


What limits and errors should your integration handle?

Handle transport errors, service errors and stale observations separately. MarineTraffic’s error guide documents invalid keys, inactive services, mismatched service keys and exceeded call allowances.

That guide lists default subscription limits of one simple-response call per two minutes and one extended/full-response call per hour (as of October 2026). Confirm your entitlement before adopting either schedule.

Our quick run on October 17, 2026 used Linux, Python 3.12, public access and pauses of 2-4 seconds. It was not a 20-minute, three-call MarineTraffic endpoint test. Exact UTC request times and exact byte counts were not recorded; sizes below are rounded.

Digitraffic request HTTP Elapsed JSON / gzip Records
/api/ais/v1/locations?latitude=60.15&longitude=24.95&radius=20 200 158 ms 21.8 KB / 2.2 KB 52
/api/ais/v1/vessels 200 102 ms 281 KB / 43 KB 863

Locations contained MMSI, coordinates, sog, cog, navStat, rot, posAcc, raim, heading, timestamp and timestampExternal. Metadata included MMSI, name, callSign, IMO, shipType, destination, draught, ETA, reference-point fields, posType and timestamp. All 52 positions joined successfully; a field-by-field missing-value count was not recorded.

Position ages ranged from 14 seconds to 7.8 hours, with a 65-second median. Responses carried cache-control: max-age=60, but no quota headers. Digitraffic documents a 60-request-per-minute IP limit for V1 interfaces without its identification header, with a higher unspecified allowance when identified (as of October 2026). See its client instructions.

Missing quota headers do not mean unlimited access. Use quota-aware scheduling and bounded retries; avoid retrying permanent authentication failures. This snapshot establishes neither maximum throughput nor global accuracy.


Which free AIS sources and alternatives fit your project?

Choose live feeds for current observations and historical downloads for retrospective analysis. Geography, contributor eligibility and licensing narrow the choice before implementation.

  • Digitraffic: Our requests needed no login or key. The Finnish waterways service is regional, and its CC BY 4.0 terms require attribution.
  • AISstream: Its official site advertises free streaming; its documentation limits accounts to three subscribed connections (as of October 2026). Create a key, connect server-side and subscribe using latitude/longitude bounding-box corners. Consume continuously and persist needed messages; replay and uptime guarantees are absent.
  • AISHub: Free contributor access requires sharing a raw feed from your own receiver. Its XML, JSON and CSV service allows requests no more frequently than once per minute (as of October 2026). Check the joining requirements before treating it as an available source.
  • Kystverket: Its access documentation distinguishes open Norwegian-area observations from restricted access. Check vessel exclusions and the applicable license.
  • Historical downloads: Start with NOAA’s AccessAIS entry point for vessel-traffic downloads. Inspect dataset dates before selecting a period.
  • Your own receiver: Local reception can support a focused project. The pyais repository contains Python AIS decoding tools; decoding software does not supply a global feed.

How should you compare commercial AIS providers?

Use the 5-factor AIS suitability check: coverage, freshness, history, licensing and total cost. Score providers against the same vessels, routes and intended uses.

Compare AIS data sources on the same five questions

  • Coverage: Request evidence for your operating areas and reception sources.
  • Freshness: Measure observation age, including its slowest tail.
  • History: Confirm retention, gaps and retrieval granularity.
  • Licensing: Check storage, derived analysis, customer display and redistribution.
  • Total cost: Include access, engineering, storage and operational support.

Inspect VesselFinder’s endpoint catalog and Lloyd’s List Intelligence’s API information against those questions. Avoid assuming old supplier lists represent independent sources: Kpler announced its Spire Maritime acquisition in April 2025, while ORBCOMM announced an agreement to sell its satellite and terrestrial AIS business.

Route Use X when… Avoid X when…
Licensed API Entitlements meet production requirements Costs or redistribution terms do not fit
Open/regional feed Its geography and license fit Global completeness is required
Historical download Retrospective analysis is sufficient Live positions are required
Own receiver Local reception is useful Hardware-free global coverage is expected

Our source evaluation guide adds a useful discipline: document provenance alongside every decision.


How reliable are AIS positions for operational decisions?

A successful response cannot establish that a position is current or accurate. IMO guidance hosted by USCG warns about incomplete coverage, erroneous transmissions and sensor failures.

Distinguish terrestrial reception from satellite observations, and preserve observation time separately from retrieval time. In our REST sample, the script used timestampExternal as epoch milliseconds; the separate timestamp field represented seconds within a minute.

Flag stale positions instead of silently displaying them as current. A missing message does not prove intentional shutdown, and a successful metadata join does not verify identity. Operational risk assessment needs corroborating evidence.


Can you scrape MarineTraffic, and where do proxies fit?

Public-page retrieval did not yield vessel data in our snapshot. Four requests returned these results:

Client Route HTTP Size Elapsed
requests, Chrome user agent Direct 403 5 KB 56 ms
requests, Chrome user agent Residential 403 5 KB 795 ms
curl_cffi chrome Direct 200 3 KB 117 ms
curl_cffi chrome Residential 200 3 KB 876 ms

The 403 responses contained a Cloudflare block page. Both 200 responses contained an empty app shell, scripts and no vessel position, name, IMO or embedded JSON. Residential routing changed neither outcome. We stopped without browser automation or hidden-endpoint probing.

What permissions matter?

Assess permission for the specific collection and reuse before automating access. Kpler’s Terms of Use address its platforms, including MarineTraffic; its business Master Agreement applies when incorporated into an order. Read the actual agreement governing your account separately from the consumer terms. Access to a page does not establish permission to redistribute its contents.

The 2022 hiQ v. LinkedIn opinion concerned a preliminary injunction and CFAA questions around public pages. It was not blanket authorization for scraping or a resolution of every contractual claim.

In the EU, database rights can restrict substantial extraction and certain repeated extraction. Where records identify people, assess personal-data obligations too. Internal analysis, customer display and resale can require different permissions. Our scraping legal overview offers further context.

DataImpulse supplies proxy infrastructure, not AIS data, a scraping API, managed unblocker or VPN. Proxies grant neither data rights nor extra API entitlements. For any proposed collection, the reader decides, check local law


When should you use exports or another integration route?

Use an authorized export when periodic analysis is enough; use an API when software needs repeatable updates. Our CSV demonstrates how an export can join positions and names while preserving observation time.

For any MarineTraffic export or third-party connector, confirm availability, fields and rights with your account agreement. For container tracking, start with shipment identifiers and required milestones rather than assuming vessel coordinates answer the shipment question.


Frequently Asked Questions

Does MarineTraffic have an API?

Yes. Its official catalog separates AIS tracking, vessel information and event services. Select the required dataset before arranging access.

Is the MarineTraffic API free?

This guide establishes no generally available free tier. Request a service-specific quote and written trial conditions instead of relying on consumer subscription prices.

How do you obtain and use a MarineTraffic API key?

Arrange API access, then inspect the service under My Account and API Services. Follow that service’s documentation and keep the key out of browser code and logs.

Which free AIS alternatives suit live tracking versus historical analysis?

Our Digitraffic example suits regional position analysis, while streaming sources require continuous collection. For retrospective work, select a historical dataset whose dates, geography and reuse terms match the question.

Did the Python example call MarineTraffic?

No. It queried Digitraffic locations and metadata, then exported 49 vessels around Helsinki. Those results do not establish MarineTraffic API behavior.

Do proxies supply AIS data or remove API quotas?

No. A proxy changes network routing, not dataset ownership or account entitlements. Our residential requests yielded no additional vessel data.


Choose the data source before the network layer

Start with an authorized source that meets your coverage, freshness and reuse requirements. If an approved workflow also needs proxy routing, consider DataImpulse for that infrastructure role. Our Digitraffic example worked directly.

Last updated: October 17, 2026.


Share article: