# MarineTraffic port details API

Get MarineTraffic port details by ID, name or link via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as output, port_id, raw, and retrieve structured data including marineTraffic port identifier, source UN/LOCODE, source country code, port latitude, and separate source anchorage identifier for port directory, and anchorage links.

Documentation: https://openany.si/marinetraffic/marinetraffic-port-details-api/ef00a008-158e-4d06-9a56-a21aa4e323ab/
API ID: ef00a008-158e-4d06-9a56-a21aa4e323ab
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/marinetraffic/v1/port
Page update time: 2026-12-03T02:47:21.402Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:47:19.224Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## MarineTraffic Port Details API

Use port\_id, q or a source port URL. Name lookup uses the first match; preserve port\_id, unlocode, country and source coordinates before linking anchorages or related ports.

## What You Can Build

- **Port directory**: Keep country and UN/LOCODE with the source ID.
- **Anchorage links**: Preserve related location identities separately.

## Returned Data

| Field | Meaning |
| --- | --- |
| `port_id` | MarineTraffic port identifier |
| `unlocode` | Source UN/LOCODE |
| `country_code` | Source country code |
| `latitude` | Port latitude |
| `anchorages[].port_id` | Separate source anchorage identifier |
| `utc_offset_hours` | Source UTC offset in hours |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "MarineTraffic port details API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "port_id": {
          "type": "string",
          "description": "MarineTraffic port id (from search), e.g. `290` for Singapore."
        },
        "q": {
          "type": "string",
          "description": "Port name or UN/LOCODE (the first match is used)."
        },
        "url": {
          "type": "string",
          "description": "A marinetraffic.com port link."
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row."
        }
      }
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "alternative_names": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "anchorages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "port_id": {
            "type": "integer"
          }
        }
      }
    },
    "cached": {
      "type": "boolean"
    },
    "country": {
      "type": "string"
    },
    "country_code": {
      "type": "string"
    },
    "credits_used": {
      "type": "integer"
    },
    "fetched_at": {
      "type": "string"
    },
    "latitude": {
      "type": "number"
    },
    "longitude": {
      "type": "number"
    },
    "name": {
      "type": "string"
    },
    "port_id": {
      "type": "integer"
    },
    "related_ports": {
      "type": "array",
      "items": {}
    },
    "size": {
      "type": "string"
    },
    "summary": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "unlocode": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "utc_offset_hours": {
      "type": "integer"
    }
  }
}
```

## Request example
Scenario: Official example · Live API.SH response · Minimal request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/marinetraffic/v1/port?output=json&port_id=290&raw=0' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "alternative_names": [
    "SPORE",
    "SINGPORE",
    "SIN EBGA",
    "SIN PEBGA"
  ],
  "anchorages": [
    {
      "name": "SINGAPORE ANCH",
      "port_id": 18812
    }
  ],
  "cached": false,
  "country": "SINGAPORE",
  "country_code": "SG",
  "credits_used": 1,
  "fetched_at": "2026-11-19T12:25:51.172Z",
  "latitude": 1.2593656,
  "longitude": 103.75445,
  "name": "SINGAPORE",
  "port_id": 290,
  "related_ports": [],
  "size": "large",
  "summary": "SINGAPORE is located at Indonesia, Singapore Area in SINGAPORE. The official UN/LOCODE of this port is SGSIN. It is also known as SPORE,SINGPORE,SIN EBGA,SIN PEBGA.",
  "type": "port",
  "unlocode": "SGSIN",
  "url": "https://www.marinetraffic.com/en/ais/details/ports/290",
  "utc_offset_hours": 8
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Which port reference should I use?
Use port_id from Search when available, or q with a port name or UN/LOCODE, or a MarineTraffic port link.

### Can a name identify several ports?
Name lookup uses the first match. Confirm the returned country and UN/LOCODE before using its ID.

### Is an anchorage ID the main port ID?
No. Preserve each anchorage reference separately from the requested port identity.

### Does this operation return port-call lists?
It returns port metadata. Do not infer arrival or departure events from the port profile.

### How do I bypass cached results?
Pass fresh=1. A cache bypass retrieves available source data; it does not make unpublished or restricted records available.

### Can I request CSV or NDJSON?
This OpenAny implementation serves JSON only. Omit output or set output=json.

## Available implementations
- apish: https://openany.si/marinetraffic/marinetraffic-port-details-api/ef00a008-158e-4d06-9a56-a21aa4e323ab/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
