{
  "openapi": "3.1.0",
  "info": {
    "title": "Seaports API",
    "version": "1.0.0",
    "description": "3,805 seaports in 195 countries from the NGA World Port Index: depths, vessel limits, facilities and UN/LOCODE.\n\nEvery seaport on Earth, from the mariner's reference. The NGA World Port Index (Pub 150, public domain): 3,805 ports in 195 countries, each with UN/LOCODE, coordinates, harbor size and type, shelter quality, tidal range, channel/anchorage/pier depths, maximum vessel dimensions, first-port-of-entry and compulsory-pilotage flags, tug availability, repair and drydock capability, plus normalized facility lists (container, ro-ro, liquid bulk, cranes, medical, railway...) and ship-supply availability (fuel oil, provisions, potable water...). Look Rotterdam up as NLRTM (large river-basin harbor, 11 m channel, compulsory pilotage, major repairs), filter for container-capable ports with 15+ m channels (83 worldwide), find the nearest port to any coordinate (San Pedro → Port of Los Angeles, 2.2 km), or count ports per country (US: 666, 21 of them large). UN/LOCODEs are normalized whether or not the source spaced them. Shipping and logistics software, freight platforms, marine insurance, cruise tools and supply-chain risk — pairs with our Tides, Buoys and Tariff Codes APIs for the full maritime picture.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/seaports.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/seaports"
  },
  "servers": [
    {
      "url": "https://api-seaports.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Transportation",
      "description": "Seaports API belongs to the Transportation category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/sources": {
      "get": {
        "operationId": "dataSources",
        "summary": "Data Sources",
        "description": "Data Sources endpoint of the Seaports API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/seaports/data-sources"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "sources": [
                    {
                      "slug": "nga-wpi",
                      "name": "World Port Index (Pub 150)",
                      "publisher": "US National Geospatial-Intelligence Agency",
                      "licence": "US government work (public domain)",
                      "source_url": "https://msi.nga.mil/Publications/WPI",
                      "file_url": "https://msi.nga.mil/api/publications/download?key=16920959/SFH00000/UpdatedPub150.csv&type=view",
                      "cadence": "updated periodically by NGA; occasional re-scrape",
                      "record_count": 3805,
                      "retrieved_at": "2026-09-06"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/seaports/nearest": {
      "get": {
        "operationId": "nearestPorts",
        "summary": "Nearest Ports",
        "description": "Nearest Ports endpoint of the Seaports API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/seaports/nearest-ports"
        },
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "33.74"
          },
          {
            "name": "lng",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "-118.27"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "query": {
                    "lat": 33.74,
                    "lng": -118.27
                  },
                  "ports": [
                    {
                      "id": 16080,
                      "name": "Los Angeles",
                      "alt_name": "San Pedro; Terminal Island; Wilmington",
                      "unlocode": "USLAX",
                      "country": "United States",
                      "region": "United States W Coast -- 16000",
                      "water_body": "North Pacific Ocean",
                      "lat": 33.75,
                      "lng": -118.25,
                      "harbor_size": "Large",
                      "harbor_type": "Coastal (Breakwater)",
                      "shelter": "Excellent",
                      "tidal_range_m": 2.7,
                      "channel_depth_m": 16.1,
                      "anchorage_depth_m": 9.4,
                      "cargo_pier_depth_m": 16.8,
                      "max_vessel_length_m": 400,
                      "max_vessel_beam_m": 61.2,
                      "max_vessel_draft_m": 15,
                      "first_port_of_entry": true,
                      "pilotage_compulsory": true,
                      "tugs_assistance": true,
                      "repairs": "Major",
                      "drydock": null,
                      "facilities": [
                        "wharves",
                        "anchorage",
                        "roro",
                        "solid_bulk",
                        "liquid_bulk",
                        "container",
                        "breakbulk",
                        "oil_terminal",
                        "cranes_fixed",
                        "cranes_mobile",
                        "cranes_floating",
                        "medical",
                        "garbage_disposal"
                      ],
                      "supplies": [
                        "provisions",
                        "potable_water",
                        "fuel_oil",
                        "diesel_oil",
                        "deck",
                        "engine"
                      ],
                      "distance_km": 2.2
                    },
                    {
                      "id": 16070,
                      "name": "Long Beach",
                      "alt_name": null,
                      "unlocode": "USLGB",
                      "country": "United States",
                      "region": "United States W Coast -- 16000",
                      "water_body": "North Pacific Ocean",
                      "lat": 33.7667,
                      "lng": -118.1833,
                      "harbor_size": "Medium",
                      "harbor_type": "Coastal (Breakwater)",
                      "shelter": "Excellent",
                      "tidal_range_m": 1.2,
                      "channel_depth_m": 23.2,
                      "anchorage_depth_m": 11,
                      "cargo_pier_depth_m": 16.8,
                      "max_vessel_length_m": 400,
                      "max_vessel_beam_m": 61,
                      "max_vessel_draft_m": 22.1,
                      "first_port_of_entry": true,
                      "pilotage_compulsory": true,
                      "tugs_assistance": true,
                      "repairs": "Major",
                      "drydock": null,
                      "facilities": [
                        "wharves",
                        "anchorage",
                        "roro",
                        "solid_bulk",
                        "liquid_bulk",
                        "container",
                        "breakbulk",
                        "cranes_fixed",
                        "cranes_mobile",
                        "cranes_floating",
                        "medical",
                        "garbage_disposal"
                      ],
                      "supplies": [
                        "provisions",
                        "potable_water",
                        "fuel_oil",
                        "diesel_oil",
                        "deck",
                        "engine"
                      ],
                      "distance_km": 8.5
                    },
                    {
                      "id": 16110,
                      "name": "El Segundo",
                      "alt_name": null,
                      "unlocode": "USELS",
                      "country": "United States",
                      "region": "United States W Coast -- 16000",
                      "water_body": "North Pacific Ocean",
                      "lat": 33.9167,
                      "lng": -118.4333,
                      "harbor_size": "Very Small",
                      "harbor_type": "Open Roadstead",
                      "shelter": "Fair",
                      "tidal_range_m": 1.8,
                      "channel_depth_m": 4.9,
                      "anchorage_depth_m": 0,
                      "cargo_pier_depth_m": 0,
                      "max_vessel_length_m": 0,
                      "max_vessel_beam_m": 0,
                      "max_vessel_draft_m": 0,
                      "first_port_of_entry": false,
                      "pilotage_compulsory": true,
                      "tugs_assistance": false,
                      "repairs": null,
                      "drydock": null,
                      "facilities": [
                        "wharves",
                        "anchorage",
                        "medical"
                      ],
                      "supplies": [
                        "provisions"
                      ],
                      "distance_km": 24.8
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/seaports/{key}": {
      "get": {
        "operationId": "portDetail",
        "summary": "Port Detail",
        "description": "Port Detail endpoint of the Seaports API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/seaports/port-detail"
        },
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "NLRTM"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "port": {
                    "id": 31140,
                    "name": "Rotterdam",
                    "alt_name": null,
                    "unlocode": "NLRTM",
                    "country": "Netherlands",
                    "region": "Netherlands -- 30980",
                    "water_body": "North Sea; North Atlantic Ocean",
                    "lat": 51.9,
                    "lng": 4.4833,
                    "harbor_size": "Large",
                    "harbor_type": "River (Basins)",
                    "shelter": "Fair",
                    "tidal_range_m": 1,
                    "channel_depth_m": 11,
                    "anchorage_depth_m": 11,
                    "cargo_pier_depth_m": 6.4,
                    "max_vessel_length_m": 0,
                    "max_vessel_beam_m": 0,
                    "max_vessel_draft_m": 0,
                    "first_port_of_entry": true,
                    "pilotage_compulsory": true,
                    "tugs_assistance": true,
                    "repairs": "Major",
                    "drydock": null,
                    "facilities": [
                      "wharves",
                      "cranes_fixed",
                      "cranes_mobile",
                      "cranes_floating",
                      "medical",
                      "garbage_disposal"
                    ],
                    "supplies": [
                      "provisions",
                      "potable_water",
                      "fuel_oil",
                      "diesel_oil",
                      "deck",
                      "engine"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/seaports/stats": {
      "get": {
        "operationId": "portsByCountry",
        "summary": "Ports By Country",
        "description": "Ports By Country endpoint of the Seaports API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/seaports/ports-by-country"
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "by": "country",
                  "stats": [
                    {
                      "group": "United States",
                      "ports": 666,
                      "large": 21
                    },
                    {
                      "group": "Canada",
                      "ports": 285,
                      "large": 4
                    },
                    {
                      "group": "United Kingdom",
                      "ports": 186,
                      "large": 7
                    },
                    {
                      "group": "Japan",
                      "ports": 163,
                      "large": 11
                    },
                    {
                      "group": "Norway",
                      "ports": 141,
                      "large": 1
                    },
                    {
                      "group": "Indonesia",
                      "ports": 123,
                      "large": 3
                    },
                    {
                      "group": "Italy",
                      "ports": 123,
                      "large": 12
                    },
                    {
                      "group": "Sweden",
                      "ports": 92,
                      "large": 3
                    },
                    {
                      "group": "Philippines",
                      "ports": 71,
                      "large": 2
                    },
                    {
                      "group": "Denmark",
                      "ports": 69,
                      "large": 1
                    },
                    {
                      "group": "Russia",
                      "ports": 68,
                      "large": 4
                    },
                    {
                      "group": "Australia",
                      "ports": 66,
                      "large": 5
                    },
                    {
                      "group": "China",
                      "ports": 66,
                      "large": 5
                    },
                    {
                      "group": "France",
                      "ports": 66,
                      "large": 6
                    },
                    {
                      "group": "Greece",
                      "ports": 57,
                      "large": 1
                    },
                    {
                      "group": "India",
                      "ports": 55,
                      "large": 4
                    },
                    {
                      "group": "Turkey",
                      "ports": 54,
                      "large": 3
                    },
                    {
                      "group": "Spain",
                      "ports": 52,
                      "large": 3
                    },
                    {
                      "group": "Brazil",
                      "ports": 45,
                      "large": 4
                    },
                    {
                      "group": "Iceland",
                      "ports": 42,
                      "large": 0
                    },
                    {
                      "group": "Chile",
                      "ports": 39,
                      "large": 0
                    },
                    {
                      "group": "Argentina",
                      "ports": 37,
                      "large": 1
                    },
                    {
                      "group": "Finland",
                      "ports": 37,
                      "large": 5
                    },
                    {
                      "group": "Germany",
                      "ports": 36,
                      "large": 5
                    },
                    {
                      "group": "Malaysia",
                      "ports": 35,
                      "large": 3
                    },
                    {
                      "group": "Mexico",
                      "ports": 35,
                      "large": 0
                    },
                    {
                      "group": "Cuba",
                      "ports": 34,
                      "large": 6
                    },
                    {
                      "group": "Egypt",
                      "ports": 32,
                      "large": 5
                    },
                    {
                      "group": "Venezuela",
                      "ports": 31,
                      "large": 1
                    },
                    {
                      "group": "Nigeria",
                      "ports": 27,
                      "large": 2
                    },
                    {
                      "group": "Ukraine",
                      "ports": 26,
                      "large": 3
                    },
                    {
                      "group": "Greenland",
                      "ports": 23,
                      "large": 0
                    },
                    {
                      "group": "New Zealand",
                      "ports": 22,
                      "large": 2
                    },
                    {
                      "group": "Papua New Guinea",
                      "ports": 22,
                      "large": 0
                    },
                    {
                      "group": "Angola",
                      "ports": 21,
                      "large": 0
                    },
                    {
                      "group": "Ireland",
                      "ports": 21,
                      "large": 1
                    },
                    {
                      "group": "Thailand",
                      "ports": 21,
                      "large": 1
                    },
                    {
                      "group": "Peru",
                      "ports": 20,
                      "large": 0
                    },
                    {
                      "group": "United Arab Emirates",
                      "ports": 20,
                      "large": 1
                    },
                    {
                      "group": "Estonia",
                      "ports": 19,
                      "large": 4
                    },
                    {
                      "group": "Iran",
                      "ports": 18,
                      "large": 0
                    },
                    {
                      "group": "Netherlands",
                      "ports": 18,
                      "large": 2
                    },
                    {
                      "group": "Portugal",
                      "ports": 18,
                      "large": 3
                    },
                    {
                      "group": "Algeria",
                      "ports": 17,
                      "large": 2
                    },
                    {
                      "group": "Dominican Republic",
                      "ports": 17,
                      "large": 0
                    },
                    {
                      "group": "Croatia",
                      "ports": 16,
                      "large": 2
                    },
                    {
                      "group": "Saudi Arabia",
                      "ports": 16,
                      "large": 0
                    },
                    {
                      "group": "Tunisia",
                      "ports": 16,
                      "large": 0
                    },
                    {
                      "group": "Vietnam",
                      "ports": 16,
                      "large": 0
                    },
                    {
                      "group": "Colombia",
                      "ports": 14,
                      "large": 0
                    },
                    {
                      "group": "Libya",
                      "ports": 14,
                      "large": 0
                    },
                    {
                      "group": "Puerto Rico",
                      "ports": 14,
                      "large": 0
                    },
                    {
                      "group": "South Korea",
                      "ports": 14,
                      "large": 2
                    },
                    {
                      "group": "Madagascar",
                      "ports": 13,
                      "large": 0
                    },
                    {
                      "group": "Morocco",
                      "ports": 12,
                      "large": 3
                    },
                    {
                      "group": "Panama",
                      "ports": 12,
                      "large": 0
                    },
                    {
                      "group": "Jamaica",
                      "ports": 11,
                      "large": 0
                    },
                    {
                      "group": "Mozambique",
                      "ports": 11,
                      "large": 0
                    },
                    {
                      "group": "Romania",
                      "ports": 11,
                      "large": 0
                    },
                    {
                      "group": "Gabon",
                      "ports": 10,
                      "large": 0
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/seaports": {
      "get": {
        "operationId": "searchPorts",
        "summary": "Search Ports",
        "description": "Search Ports endpoint of the Seaports API. Costs 1 token per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/seaports/search-ports"
        },
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Netherlands"
          },
          {
            "name": "facility",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "harbor_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "Large"
          },
          {
            "name": "min_channel_depth_m",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "rotterdam"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "page": 1,
                  "limit": 25,
                  "total": 1,
                  "total_pages": 1,
                  "ports": [
                    {
                      "id": 31140,
                      "name": "Rotterdam",
                      "alt_name": null,
                      "unlocode": "NLRTM",
                      "country": "Netherlands",
                      "region": "Netherlands -- 30980",
                      "water_body": "North Sea; North Atlantic Ocean",
                      "lat": 51.9,
                      "lng": 4.4833,
                      "harbor_size": "Large",
                      "harbor_type": "River (Basins)",
                      "shelter": "Fair",
                      "tidal_range_m": 1,
                      "channel_depth_m": 11,
                      "anchorage_depth_m": 11,
                      "cargo_pier_depth_m": 6.4,
                      "max_vessel_length_m": 0,
                      "max_vessel_beam_m": 0,
                      "max_vessel_draft_m": 0,
                      "first_port_of_entry": true,
                      "pilotage_compulsory": true,
                      "tugs_assistance": true,
                      "repairs": "Major",
                      "drydock": null,
                      "facilities": [
                        "wharves",
                        "cranes_fixed",
                        "cranes_mobile",
                        "cranes_floating",
                        "medical",
                        "garbage_disposal"
                      ],
                      "supplies": [
                        "provisions",
                        "potable_water",
                        "fuel_oil",
                        "diesel_oil",
                        "deck",
                        "engine"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 1 token per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}