Skip to content

港口潮汐预报

访问限制 本部分 API 属于增值服务,开发者 Token 需要额外开通权限,请联系商务

港口查询 API

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

Output:

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

港口信息

FieldDescription
id港口编号
name港口名称
coordinates港口坐标

港口潮汐预报 API

bash
# 默认 API 调用格式
curl "https://singer.caiyunhub.com/v3/sea/tide/by_port?ids={port_id}&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 天
  • port_id: 特定的若干个港口 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
      ]
    }
  ]
}

字段说明:

FieldDescription
id港口编号
date日期
tide潮高
event_time事件时间点
event_tide事件潮高