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": "2022-10-24",
      "tide": [
        88,
        119,
        156,
        189,
        211,
        214,
        196,
        162,
        122,
        86,
        65,
        62,
        79,
        111,
        151,
        190,
        219,
        229,
        216,
        183,
        139,
        96,
        66,
        56
      ],
      "event_time": ["04:39", "10:38", "16:56", "22:57"]
    },
    {
      "id": "T016",
      "date": "2022-10-25",
      "tide": [
        68,
        99,
        141,
        187,
        224,
        242,
        236,
        206,
        159,
        108,
        66,
        44,
        45,
        68,
        108,
        155,
        197,
        224,
        228,
        206,
        165,
        116,
        73,
        49
      ],
      "event_time": ["05:16", "11:27", "17:39", "23:29"]
    }
  ]
}

字段说明:

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