An API for determining if a point on earth is on water (ocean, river, or lake), or land.

Api

https://is-on-water.balbona.me/api/v1/get/[latitude]/[longitude]

Response

{
  "isWater": true,
  "feature": "LAKE",
  "lat": 46.67,
  "lon": 103.3,
  "reqMs": 50
}

Data

Our dataset is ASTWBD v001 (ASTER Global Water Body Data Base), provided by the U.S./Japan ASTER Science Team.

It contains data acquired between March 1, 2000, and November 30, 2013

The dataset's pixel size is 30 meters, therefore the results might be incorrect in shores up to that distance (Ex: classifying a beach as OCEAN)

Rate limits

This is a free API intended for development and small-scale use. Requests are limited to 120 requests per minute per IP address. If you're rate limited, you'll get an HTTP 429 response with a Retry-After header telling you how many seconds to wait. Every response also includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers.

If you need more requests, this project is open source: clone the GitHub repo and host your own instance.


Water Example

https://is-on-water.balbona.me/api/v1/get/30.03/31.22

Result

{
  "isWater": true,
  "feature": "RIVER",
  "lat": 30.03,
  "lon": 31.22,
  "reqMs": 55
}

Land Example

https://is-on-water.balbona.me/api/v1/get/-10.47/105.57

Result

{
  "isWater": false,
  "feature": "LAND",
  "lat": -10.47,
  "lon": 105.57,
  "reqMs": 53
}

©2023 Nuno Balbona. Web App design based on the previous OnWater.io

GitHub