Date: 2026-03-11
Status: ✅ API Working,
The PortWatch API integration is working for static/snapshot data. However, time-series data for monitoring changes over time is NOT available through the ArcGIS REST API.
Endpoint: https://services9.arcgis.com/weJ1QsnbMYJlCHdG/arcgis/rest/services/PortWatch_ports_database/FeatureServer/0
Available Data:
- Port information (name, location, coordinates)
- Vessel counts (total, container, dry bulk, general cargo, RoRo, tanker)
- Trade shares (% of country's maritime imports/exports)
- Top 3 industries per port
- 1,985 ports worldwide
Malaysian Ports Found: 41 ports + 16 offshore oil terminals
Key Findings:
| Port | Vessel Count | Import Share | Export Share |
|---|---|---|---|
| Port Klang | 11,278 | 43.62% | 46.00% |
| Tanjung Pelepas | 5,470 | 7.19% | 5.75% |
| Johor | 4,269 | 5.87% | 5.22% |
| Pengerang | 2,093 | 6.95% | 8.51% |
| Penang | 1,787 | 2.22% | 1.55% |
| Kuantan | 1,644 | 3.39% | 3.87% |
| Bintulu | 813 | 0.49% | 3.46% |
| Kemaman Harbor | 481 | 0.86% | 1.06% |
| Kota Kinabalu | 163 | 0.17% | 0.03% |
Total Malaysia Maritime Trade Covered: 99.99% (imports), 99.98% (exports)
Endpoint: https://services9.arcgis.com/weJ1QsnbMYJlCHdG/arcgis/rest/services/disruptions_view/FeatureServer/0
Available Data:
- Historical disruption events (2018-2019)
- Affected ports
- Event types (drought, flood, conflict, etc.)
- Alert levels
- Affected areas
Note: This is historical data, not real-time. The Iran conflict (2026) is not yet in this database.
Attempted Endpoints:
Daily_Trade_Data_WLD- No layers availableDaily_Trade_Data_TEST4- No layers availableDaily_Regional_Data- No layers available
Result: Cannot query daily/historical time-series data for monitoring port activity changes over time.
Collect API data periodically and build our own time-series:
# Run collector daily
/home/linuxbrew/.linuxbrew/bin/uv run python src/monitoring/collector.py
# Data stored in: data/raw/malaysia_ports_YYYYMMDD_HHMMSS.json
# Compare snapshots to detect changesPros:
- Uses working API
- Automated via cron
- Can track changes over time
Cons:
- No pre-2026 historical data
- Only as detailed as API provides (snapshot vessel counts)
- API data may update weekly, not daily
Download daily time-series CSVs from PortWatch website:
URL: https://portwatch.imf.org/datasets/75619cb86e5f4beeb7dab9629d861acf_0/about
Steps:
- Navigate to dataset page
- Click "Download" → CSV format
- Extract Malaysian ports data
- Build time-series database
Pros:
- Daily data available
- Historical data back to 2019
- Full detail (port calls, trade volumes)
Cons:
- Manual process
- No API automation (unless download URLs are stable)
- Requires manual updates
Consider other maritime data APIs:
- MarineTraffic - Real-time vessel tracking
- Port Authority data - Malaysian port statistics
- Trade statistics - Government-reported trade data
- ✅ API connection test
- ✅ Fetch Malaysian ports
- ✅ Sort by vessel count
- ✅ Calculate totals and shares
- ✅ Generate text summary
- ✅ Save JSON data with timestamps
- ✅ Collection history tracking
✓ API connection successful
✓ Found 41 Malaysian ports
✓ Saved data to malaysia_ports_20260311_120030.json
✓ Summary saved to summary_20260311_120030.txt
Total Ports: 41
Total Vessels: 35,273
Combined Import Share: 99.99%
Combined Export Share: 99.98%
/data/.openclaw/workspace/projects/Trade_Disruption/data/raw/
├── malaysia_ports_20260311_120030.json (34KB)
└── summary_20260311_120030.txt (1.4KB)
-
Implement snapshot-based monitoring:
- Run collector every 6-12 hours via cron
- Build comparison logic to detect changes in vessel counts
- Track percentage changes from baseline
-
Use manual CSV downloads for historical baseline:
- Download pre-conflict data (Jan-Feb 2026) from PortWatch
- Parse and import into analysis pipeline
- Calculate baseline metrics
-
Monitor disruptions data:
- Check disruptions API weekly for new entries
- Alert if Iran/Strait of Hormuz appears in disruptions database
-
Contact PortWatch for API documentation:
- Ask about time-series API access
- Request API for daily port activity
- Inquire about real-time data feeds
-
Consider commercial maritime data APIs:
- MarineTraffic API (https://www.marinetraffic.com/api)
- VesselFinder API
- Port Authority APIs
-
Supplement with news monitoring:
- Track Iran conflict developments
- Correlate news events with port activity changes
- Use web scraping for shipping news
- Set up cron job for snapshot collection (every 6-12 hours)
- Create baseline calculation module to compare snapshots
- Implement change detection (vessel count variations > X%)
- Create simple dashboard showing current vs previous snapshot
- Download historical CSVs from PortWatch (manual)
- Build time-series database from CSV data
- Analyze pre-conflict vs post-conflict patterns
- Contact IMF/PortWatch for API enhancement requests
- Evaluate alternative data sources
- Build comprehensive monitoring system combining multiple sources
- ✅
src/data/portwatch_api.py- Working API wrapper - ✅
src/monitoring/collector.py- Working collector with snapshots - ✅
data/raw/- Collected data files - ✅
API_WORKING.md- API documentation - ✅
API_STATUS_REPORT.md- This file
PortWatch API is functional for static port data collection. The project can proceed with snapshot-based monitoring by collecting data periodically and comparing changes over time.
For full time-series analysis, manual CSV downloads or alternative data sources will be needed.
Status: Ready for cron setup and baseline collection