Single-file wrapper around httpx. No build step. Drop it into your project.
pip install httpx
# Drop ais_intelligence.py in your project, then:
from ais_intelligence import AISClient
client = AISClient("ais_live_YOUR_KEY")
# Live vessels in SE Alaska
vessels = client.live_vessels(bbox="54,-137,60,-128")
print(f"{len(vessels['vessels'])} vessels active")
# Dark ships (gone quiet > 6 hours)
dark = client.dark_ships(silent_minutes=360)
for v in dark['vessels'][:5]:
print(v['ship_name'], "dark for", v['silent_hours'], "hrs")
# GeoJSON for Leaflet/Mapbox - paste into geojson.io
geo = client.live_geojson()
# ETA from current position to port
eta = client.eta("338234916", "ketchikan")
print(f"ETA: {eta['eta_hours']:.1f} hours, {eta['distance_nm']:.0f} nm away")
# Port congestion score 0-100
c = client.congestion("ketchikan")
print(f"Ketchikan: {c['congestion_score']}/100 ({c['interpretation']})")
# Named fleet tracking
fleet = client.create_fleet("My Tugs", ["338234916", "367654000"])
pos = client.fleet_positions(fleet['id'])
client.health() client.live_vessels(bbox, minutes, type_code) # JSON client.live_geojson(bbox, minutes) # GeoJSON FeatureCollection client.vessel(mmsi) client.track(mmsi, hours) client.voyages(mmsi) client.search(name) client.dark_ships(silent_minutes, active_hours, bbox) client.anchored(port, min_minutes) client.anomalies(hours) client.gaps(mmsi, days, min_gap_hours) client.congestion(port) client.eta(mmsi, port) client.fishing_effort(hours, lat_min, lat_max, lng_min, lng_max, grid_size) client.proximity(mmsi1, mmsi2, alert_nm) client.heatmap(bbox, resolution, hours) # JSON client.heatmap_geojson(bbox, resolution, hours) # GeoJSON client.area_traffic(bbox, hours) client.port_report(port, days) client.fleets() client.create_fleet(name, mmsis) client.fleet_positions(fleet_id) client.add_fleet_mmsis(fleet_id, mmsis) client.rotate_key() client.usage_breakdown(days)