IsItWater
Determine whether a latitude/longitude coordinate is over water using the IsItWater API.
Setup
Before making API calls, check whether the user has an API key configured:
- 1. Check if
ISITWATER_API_KEY is set in the environment. - If it is not set:
- Inform the user: "You need an IsItWater API key. You can get one at https://isitwater.com"
- Offer to help them sign up using the browser tool — navigate to https://isitwater.com, create an account, and generate an API key from the dashboard.
- Once the user has a key, guide them to configure it in
~/.openclaw/openclaw.json:
CODEBLOCK0
- Alternatively, the user can export the environment variable directly: INLINECODE2
- 3. Once the key is available, proceed with the API calls below.
Water Lookup
Check whether a coordinate is over water or land.
Endpoint: INLINECODE3
Headers:
Query Parameters:
| Parameter | Type | Required | Description |
|---|
| INLINECODE5 | number | yes | Latitude, between -90 and 90 |
| INLINECODE6 |
number | yes | Longitude, between -180 and 180 |
Example curl:
CODEBLOCK1
Example response (land):
CODEBLOCK2
Example response (water):
CODEBLOCK3
Response Fields:
| Field | Type | Description |
|---|
| INLINECODE7 | string | Unique identifier for the request |
| INLINECODE8 |
boolean |
true if the coordinate is over water,
false if over land |
|
features | string[] | Geographic features at the point — e.g.
earth,
ocean,
lake,
river,
glacier,
nature_reserve |
|
latitude | string | The latitude that was queried |
|
longitude | string | The longitude that was queried |
Cost: 1 credit per lookup.
Account Info
Check the user's account details and remaining credit balance.
Endpoint: INLINECODE20
Headers:
Example curl:
CODEBLOCK4
Response Fields:
| Field | Type | Description |
|---|
| INLINECODE22 | string | Account identifier |
| INLINECODE23 |
string | Account name |
|
balance | number | Remaining credits |
|
auto_recharge_enabled| boolean | Whether auto-recharge is turned on |
Cost: Free (no credits consumed).
Error Handling
| Status Code | Meaning | Description |
|---|
| 200 | OK | Request succeeded |
| 400 |
Bad Request | Invalid latitude or longitude values |
| 401 | Unauthorized | Missing or invalid API key |
| 402 | Payment Required | Account has no remaining credits |
Error responses return a JSON body:
CODEBLOCK5
Tips
- - Each water lookup costs 1 credit. Use the Account Info endpoint to check the user's balance before making many requests.
- When the user provides a place name instead of coordinates (e.g. "Is the Sahara Desert water?"), geocode the location first to get lat/lon, then call the water lookup endpoint.
- The
features array can contain multiple overlapping values for a single point — for example, a point might return both lake and nature_reserve.
IsItWater
使用 IsItWater API 判断一个纬度/经度坐标是否位于水域。
设置
在进行 API 调用之前,检查用户是否已配置 API 密钥:
- 1. 检查环境中是否设置了 ISITWATERAPIKEY。
- 如果未设置:
- 告知用户:您需要一个 IsItWater API 密钥。您可以在 https://isitwater.com 获取。
- 主动提供帮助,使用浏览器工具引导用户注册 — 导航至 https://isitwater.com,创建账户,并从控制面板生成 API 密钥。
- 用户获得密钥后,指导其在 ~/.openclaw/openclaw.json 中进行配置:
json
{
skills: {
entries: {
isitwater: {
apiKey: YOURAPIKEY_HERE
}
}
}
}
- 或者,用户可以直接导出环境变量:export ISITWATERAPIKEY=YOURAPIKEY_HERE
- 3. 密钥就绪后,继续进行以下 API 调用。
水域查询
检查一个坐标位于水域还是陆地上。
端点: GET https://api.isitwater.com/v1/locations/water
请求头:
- - Authorization: Bearer $ISITWATERAPIKEY
查询参数:
| 参数 | 类型 | 必填 | 描述 |
|---|
| lat | 数字 | 是 | 纬度,介于 -90 到 90 之间 |
| lon |
数字 | 是 | 经度,介于 -180 到 180 之间 |
curl 示例:
bash
curl -s https://api.isitwater.com/v1/locations/water?lat=41.7658&lon=-72.6734 \
-H Authorization: Bearer $ISITWATERAPIKEY
响应示例(陆地):
json
{
request_id: abc123,
water: false,
features: [earth],
latitude: 41.7658,
longitude: -72.6734
}
响应示例(水域):
json
{
request_id: def456,
water: true,
features: [earth, ocean],
latitude: 36.0,
longitude: -30.0
}
响应字段:
| 字段 | 类型 | 描述 |
|---|
| request_id | 字符串 | 请求的唯一标识符 |
| water |
布尔值 | 如果坐标位于水域则为 true,位于陆地则为 false |
| features | 字符串数组 | 该点的地理特征 — 例如 earth、ocean、lake、river、glacier、nature_reserve |
| latitude | 字符串 | 查询的纬度 |
| longitude | 字符串 | 查询的经度 |
费用: 每次查询消耗 1 个积分。
账户信息
查看用户的账户详情和剩余积分余额。
端点: GET https://api.isitwater.com/v1/accounts/me
请求头:
- - Authorization: Bearer $ISITWATERAPIKEY
curl 示例:
bash
curl -s https://api.isitwater.com/v1/accounts/me \
-H Authorization: Bearer $ISITWATERAPIKEY
响应字段:
字符串 | 账户名称 |
| balance | 数字 | 剩余积分 |
| auto
rechargeenabled | 布尔值 | 是否开启自动充值 |
费用: 免费(不消耗积分)。
错误处理
错误请求 | 无效的纬度或经度值 |
| 401 | 未授权 | 缺少或无效的 API 密钥 |
| 402 | 需要付款 | 账户没有剩余积分 |
错误响应返回 JSON 格式:
json
{
error: 问题描述
}
提示
- - 每次水域查询消耗 1 个积分。在发起大量请求前,使用账户信息端点检查用户的余额。
- 当用户提供地名而非坐标时(例如撒哈拉沙漠是水域吗?),首先对位置进行地理编码获取经纬度,然后调用水域查询端点。
- features 数组可以包含单个点的多个重叠值 — 例如,一个点可能同时返回 lake 和 nature_reserve。