Skip to content

Port Tide Forecast

Access Restriction

This API is a premium service available only to enterprise tier developers. Please contact Caiyun Sales to purchase.

Port Query API

bash
# Get all ports
curl "https://singer.caiyunhub.com/v3/sea/tide/ports?token={token}"

# Filter ports by adcode
curl "https://singer.caiyunhub.com/v3/sea/tide/ports?token={token}&adcode={adcode}"
  • adcode: Optional, area code with prefix matching support. For example, the port "Leizhou" (adcode: 440882) can be matched by 440882 (Leizhou City), 440800 (Zhanjiang City), or 440000 (Guangdong Province)

Response

json
{
  "ports": [
    { "id": "T016", "name": "菊花岛", "coordinates": [120.83333, 40.48333], "adcode": "211400" },
    { "id": "T199", "name": "白龙尾", "coordinates": [108.23333, 21.5], "adcode": "450603" }
  ]
}

Port Information

FieldTypeDescription
idstringPort ID
namestringPort name
coordinatesfloat[]Port coordinates
adcodestring?Area code (some ports may not have this field)

Port Tide Forecast API

bash
# Default API call format
curl "https://singer.caiyunhub.com/v3/sea/tide/by_port?ids=T016&token={token}&days={days}"

# Get tide forecast for specific ports
curl "https://singer.caiyunhub.com/v3/sea/tide/by_port?ids=a,b,c&token={token}&days=3"

# Get tide forecast for all ports
curl "https://singer.caiyunhub.com/v3/sea/tide/by_port?ids=all&token={token}&days=3"
  • days: Number of days, up to 7 days
  • ids: Specific port or multiple ports a,b,c or all ports all

Response

json
{
  "tide": [
    {
      "id": "T016",
      "date": "2024-11-04",
      "tide": [
        47,
        56,
        88,
        136,
        191,
        241,
        276,
        286,
        269,
        227,
        171,
        113,
        68,
        44,
        45,
        67,
        102,
        139,
        169,
        184,
        177,
        151,
        113,
        74
      ],
      "event_time": [
        "00:08",
        "06:53",
        "13:27",
        "19:12"
      ],
      "event_tide": [
        46,
        286,
        42,
        184
      ]
    },
    {
      "id": "T016",
      "date": "2024-11-05",
      "tide": [
        48,
        44,
        65,
        107,
        162,
        219,
        265,
        291,
        290,
        262,
        213,
        153,
        97,
        58,
        42,
        50,
        77,
        112,
        146,
        170,
        176,
        163,
        132,
        94
      ],
      "event_time": [
        "00:40",
        "07:29",
        "14:08",
        "19:49"
      ],
      "event_tide": [
        43,
        294,
        42,
        177
      ]
    }
  ]
}

Field Description:

FieldTypeDescription
idstringPort ID
datestringDate
tideint[]Tide height, 24 values for each hour
event_timestring[]Event time
event_tideint[]Event tide height