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/portsQuery Parameters
| Name | Required | Default | Range | Description |
|---|---|---|---|---|
token | Yes | — | — | API token; see Authentication |
adcode | No | — | — | Area 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
| JSONPath | Type | Description |
|---|---|---|
$.ports | array<object> | Port entries |
$.ports[].id | string | Port ID |
$.ports[].name | string | Port name |
$.ports[].coordinates | array<number> | Port coordinates in longitude, latitude order |
$.ports[].adcode | string | Area code; some ports may not have this field |
Port Tide Forecast API
Request
http
GET https://singer.caiyunhub.com/v3/sea/tide/by_portQuery Parameters
| Name | Required | Default | Range | Description |
|---|---|---|---|---|
token | Yes | — | — | API token; see Authentication |
ids | Yes | — | — | Port IDs separated by commas; use all for every port |
days | Yes | — | 1~7 | Number 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
| JSONPath | Type | Description |
|---|---|---|
$.tide | array<object> | Tide forecast entries |
$.tide[].id | string | Port ID |
$.tide[].date | string | Date |
$.tide[].tide | array<number> | Tide height, 24 values for each hour |
$.tide[].event_time | array<string> | Event time |
$.tide[].event_tide | array<number> | Event tide height |