Skip to content

Latest commit

 

History

History
126 lines (92 loc) · 3.02 KB

File metadata and controls

126 lines (92 loc) · 3.02 KB

API Endpoint Exploration: /api/search/definition/

Test Date: 2026-03-11 Result: ❌ Not a functional API endpoint


Findings

Endpoint Analysis

URL: https://portwatch.imf.org/api/search/definition/

Response Type: HTML (Swagger UI page)

Status: Returns a static Swagger UI HTML page, NOT an API endpoint

Attempted Methods

  1. GET Request:

    curl https://portwatch.imf.org/api/search/definition/

    Result: Returns HTML for Swagger UI (documentation page)

  2. POST Request:

    curl -X POST https://portwatch.imf.org/api/search/definition/ \
      -H "Content-Type: application/json" \
      -d '{"q":"Port Klang"}'

    Result: 404 Not Found

  3. Swagger JSON Spec:

    curl https://portwatch.imf.org/api/search/swagger.json

    Result: 404 Not Found

  4. OpenAPI Spec:

    curl https://portwatch.imf.org/api/openapi.json

    Result: 404 Not Found

  5. Base API Path:

    curl https://portwatch.imf.org/api/

    Result: 404 Not Found


Conclusion

The /api/ path does NOT exist as a functional API on PortWatch.

PortWatch does NOT have a traditional REST API at:

  • https://portwatch.imf.org/api/
  • https://portwatch.imf.org/api/search/

Actual Data Access

PortWatch data is ONLY available via:

1. ArcGIS REST Feature Services ✅ (Working)

https://services9.arcgis.com/weJ1QsnbMYJlCHdG/arcgis/rest/services/PortWatch_ports_database/FeatureServer/0/query

Data Types:

  • Static port database (vessel counts, trade shares, industries)
  • Historical disruptions events
  • Country and port metadata

Limitations:

  • No time-series data (snapshots only)
  • No daily/historical tracking via API

2. Manual CSV Downloads ⚠️ (No API)

https://portwatch.imf.org/datasets/75619cb86e5f4beeb7dab9629d861acf_0/about

Data Types:

  • Daily port activity (time-series available)
  • Trade volume estimates
  • Chokepoint data

Limitations:

  • Manual download only (no API)
  • Requires periodic manual updates
  • Download URLs may not be stable

3. Web Interface Only

https://portwatch.imf.org/
https://portwatch.imf.org/pages/data-and-methodology

Final Assessment

Method Status Data Time-Series
/api/search/definition/ ❌ Not API N/A N/A
ArcGIS REST API ✅ Working Static snapshot No
CSV Downloads ⚠️ Manual Daily data Yes

Recommendation

Continue with ArcGIS REST API and implement snapshot-based monitoring:

  1. Use src/data/portwatch_api.py - Working implementation
  2. Run src/monitoring/collector.py - Collect periodic snapshots
  3. Set up cron job - Automate collection every 6-12 hours
  4. Download CSVs manually - For historical baseline data (pre-2026)

For full time-series automation, consider:

  • Contacting PortWatch for API access
  • Using alternative maritime data APIs
  • Web scraping for daily data

Test completed: 2026-03-11 12:30 MYT