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

Request

http
GET https://singer.caiyunhub.com/v3/sea/tide/ports

Query Parameters

NameRequiredDefaultRangeDescription
tokenYesAPI token; see Authentication
adcodeNoArea code with prefix matching. For example, Leizhou can match 440882 (city), 440800 (prefecture), or 440000 (province)

Request Example

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}"

Response Example

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

Response Fields

JSONPathTypeDescription
$.portsarray<object>Port entries
$.ports[].idstringPort ID
$.ports[].namestringPort name
$.ports[].coordinatesarray<number>Port coordinates in longitude, latitude order
$.ports[].adcodestringArea code; some ports may not have this field

Port Tide Forecast API

Request

http
GET https://singer.caiyunhub.com/v3/sea/tide/by_port

Query Parameters

NameRequiredDefaultRangeDescription
tokenYesAPI token; see Authentication
idsYesPort IDs separated by commas; use all for every port
daysYes1~7Number of days

Request Example

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"

Response Example

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
      ]
    }
  ]
}

Response Fields

JSONPathTypeDescription
$.tidearray<object>Tide forecast entries
$.tide[].idstringPort ID
$.tide[].datestringDate
$.tide[].tidearray<number>Tide height, 24 values for each hour
$.tide[].event_timearray<string>Event time
$.tide[].event_tidearray<number>Event tide height