Python client for the Vessel Tracking API — maritime vessel tracking, port events, emissions, and navigation data.
Project description
vesselapi-python
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
- API Documentation — endpoint guides, request/response schemas, and usage examples
- API Explorer — interactive API reference
- Dashboard — manage API keys and monitor usage
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb3cc4ec86f22e3c90a092c7ad255a7406d63d677bf9acd94f16ee3795bad9c2
|
|
| MD5 |
6d60882781212cf03ac7aefca5d00632
|
|
| BLAKE2b-256 |
a44f013bac874278f67f5fa9e01bf54e7f386794fc5fc27bb186847061cfd6bb
|
Provenance
The following attestation bundles were made for vessel_api_python-1.1.0.tar.gz:
Publisher:
publish.yml on vessel-api/vesselapi-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vessel_api_python-1.1.0.tar.gz -
Subject digest:
cb3cc4ec86f22e3c90a092c7ad255a7406d63d677bf9acd94f16ee3795bad9c2 - Sigstore transparency entry: 981685479
- Sigstore integration time:
-
Permalink:
vessel-api/vesselapi-python@c08bd7ff204b71a9e7320c6d9fce690876f8e772 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/vessel-api
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c08bd7ff204b71a9e7320c6d9fce690876f8e772 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vessel_api_python-1.1.0-py3-none-any.whl.
File metadata
- Download URL: vessel_api_python-1.1.0-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdf61495dac0ca711ad7b437edf1336db829aee279c953f6df52fc0af2f8eeaa
|
|
| MD5 |
71f1568685e9cea5a8e8cedcd0f1a01d
|
|
| BLAKE2b-256 |
4772eee93edab9f89b3fb0f1a76f6b276a0f243df7d1b2da39ad482e38acda8b
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vessel_api_python-1.1.0-py3-none-any.whl -
Subject digest:
fdf61495dac0ca711ad7b437edf1336db829aee279c953f6df52fc0af2f8eeaa - Sigstore transparency entry: 981685515
- Sigstore integration time:
-
Permalink:
vessel-api/vesselapi-python@c08bd7ff204b71a9e7320c6d9fce690876f8e772 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/vessel-api
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c08bd7ff204b71a9e7320c6d9fce690876f8e772 -
Trigger Event:
push
-
Statement type: