Overview

OnWater is a simple free API that tells you whether a given latitude and longitude coordinate is on water or on land. You pass coordinates and get back a boolean answer — perfect for validating location data or building map-based games. No API key is needed, making it extremely easy to use right away.

Beginner Tip

This API answers one simple question: is this point on water? Use it to validate that users are not accidentally placing markers in the ocean. Latitude ranges from -90 to 90 and longitude from -180 to 180.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

OnWater data via REST API

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "status": "success",
  "data": {
    "result": "Data from OnWater",
    "description": "Determine if a lat/lon is on water or land",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

lat The latitude value you submitted in the request
lon The longitude value you submitted in the request
water True if the coordinate is on water; false if it is on land

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://onwater.io/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

400 Bad Request Coordinates are out of valid range or malformed
Ensure latitude is between -90 and 90 and longitude is between -180 and 180, formatted as decimal numbers
Unexpected water result for a city The coordinate may be slightly off, landing in a river or bay
Snap your coordinates to a known land point; small offsets near coastlines or rivers can return water=true
Slow response Free tier has no SLA guarantee
Cache results locally for coordinates you check repeatedly; the water/land classification for a given point never changes

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Geocoding
Difficulty Beginner
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →