Skip to content

港口潮汐预报

访问限制

本部分 API 属于增值服务,仅提供给企业套餐开发者,如需采购请联系彩云商务

港口查询 API

bash
# 获取所有港口
curl "https://singer.caiyunhub.com/v3/sea/tide/ports?token={token}"

# 根据 adcode 过滤港口
curl "https://singer.caiyunhub.com/v3/sea/tide/ports?token={token}&adcode={adcode}"
  • adcode: 可选,区域代码,支持前缀匹配。例如「雷州」港口(adcode: 440882)可通过 440882(雷州市)、440800(湛江市)、440000(广东省)匹配

响应结构

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

港口信息

字段类型描述
idstring港口编号
namestring港口名称
coordinatesfloat[]港口坐标
adcodestring?区域代码,部分港口可能没有该字段

港口潮汐预报 API

bash
# 默认 API 调用格式
curl "https://singer.caiyunhub.com/v3/sea/tide/by_port?ids=T016&token={token}&days={days}"

# 只获取部分港口潮汐预报数据
curl "https://singer.caiyunhub.com/v3/sea/tide/by_port?ids=a,b,c&token={token}&days=3"

# 获取全部港口的潮汐预报数据
curl "https://singer.caiyunhub.com/v3/sea/tide/by_port?ids=all&token={token}&days=3"
  • days: 天数,最多 7 天
  • ids: 特定的港口或者多个港口 a,b,c 或者全部港口数据 all

返回结构

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

字段说明:

字段类型描述
idstring港口编号
datestring日期
tideint[]潮高,共 24 个值,代表各整点时的潮高
event_timestring[]事件时间点
event_tideint[]事件潮高