Skip to main content

Python client for the Vessel Tracking API — maritime vessel tracking, port events, emissions, and navigation data.

Project description

vesselapi-python

CI PyPI Python License: MIT

Python client for the Vessel Tracking API — maritime vessel tracking, port events, emissions, and navigation data.

Resources: Documentation | API Explorer | Dashboard | Contact Support

Install

pip install vessel-api-python

Requires Python 3.9+.

Quick Start

from vessel_api_python import VesselClient

client = VesselClient(api_key="your-api-key")

# Search for a vessel by name.
result = client.search.vessels(filter_name="Ever Given")
for v in result.vessels or []:
    print(f"{v.name} (IMO {v.imo})")

# Get a port by UN/LOCODE.
port = client.ports.get("NLRTM")
print(port.port.name)

# Auto-paginate through port events.
for event in client.port_events.list_all(pagination_limit=10):
    print(f"{event.event} at {event.timestamp}")

Async

import asyncio
from vessel_api_python import AsyncVesselClient

async def main():
    async with AsyncVesselClient(api_key="your-api-key") as client:
        result = await client.search.vessels(filter_name="Ever Given")
        async for event in client.port_events.list_all(pagination_limit=10):
            print(f"{event.event} at {event.timestamp}")

asyncio.run(main())

Available Services

Service Methods Description
vessels get, position, casualties, classification, emissions, eta, inspections, inspection_detail, ownership, positions Vessel details, positions, and records
ports get Port lookup by UN/LOCODE
port_events list, by_port, by_ports, by_vessel, last_by_vessel, by_vessels Vessel arrival/departure events
emissions list EU MRV emissions data
search vessels, ports, dgps, light_aids, modus, radio_beacons Full-text search across entity types
location vessels_bounding_box, vessels_radius, ports_bounding_box, ports_radius, dgps_bounding_box, dgps_radius, light_aids_bounding_box, light_aids_radius, modus_bounding_box, modus_radius, radio_beacons_bounding_box, radio_beacons_radius Geo queries by bounding box or radius
navtex list NAVTEX maritime safety messages

37 methods total.

Error Handling

All methods raise specific exception types on non-2xx responses:

from vessel_api_python import VesselAPIError

try:
    client.ports.get("ZZZZZ")
except VesselAPIError as err:
    if err.is_not_found:
        print("Port not found")
    elif err.is_rate_limited:
        print("Rate limited — back off")
    elif err.is_auth_error:
        print("Check API key")
    print(err.status_code, err.message)

Auto-Pagination

Every list endpoint has an all_* / list_all variant returning an iterator:

# Sync
for vessel in client.search.all_vessels(filter_name="tanker"):
    print(vessel.name)

# Async
async for vessel in client.search.all_vessels(filter_name="tanker"):
    print(vessel.name)

# Collect all at once
vessels = client.search.all_vessels(filter_name="tanker").collect()

Configuration

client = VesselClient(
    api_key="your-api-key",
    base_url="https://custom-endpoint.example.com/v1",
    timeout=60.0,
    max_retries=5,  # default: 3
    user_agent="my-app/1.0",
)

Retries use exponential backoff with jitter on 429 and 5xx responses. The Retry-After header is respected.

Documentation

Contributing & Support

Found a bug, have a feature request, or need help? You're welcome to open an issue. For API-level bugs and feature requests, please use the main VesselAPI repository.

For security vulnerabilities, do not open a public issue — email security@vesselapi.com instead. See SECURITY.md.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vessel_api_python-1.1.0.tar.gz (43.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vessel_api_python-1.1.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file vessel_api_python-1.1.0.tar.gz.

File metadata

  • Download URL: vessel_api_python-1.1.0.tar.gz
  • Upload date:
  • Size: 43.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vessel_api_python-1.1.0.tar.gz
Algorithm Hash digest
SHA256 cb3cc4ec86f22e3c90a092c7ad255a7406d63d677bf9acd94f16ee3795bad9c2
MD5 6d60882781212cf03ac7aefca5d00632
BLAKE2b-256 a44f013bac874278f67f5fa9e01bf54e7f386794fc5fc27bb186847061cfd6bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for vessel_api_python-1.1.0.tar.gz:

Publisher: publish.yml on vessel-api/vesselapi-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vessel_api_python-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vessel_api_python-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fdf61495dac0ca711ad7b437edf1336db829aee279c953f6df52fc0af2f8eeaa
MD5 71f1568685e9cea5a8e8cedcd0f1a01d
BLAKE2b-256 4772eee93edab9f89b3fb0f1a76f6b276a0f243df7d1b2da39ad482e38acda8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vessel_api_python-1.1.0-py3-none-any.whl:

Publisher: publish.yml on vessel-api/vesselapi-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page