Land or Water API

The purpose of this API is to determine whether a latitude / longitude pair is on land or water. It can detect any size body of water. If you would like to use it (free of charge for reasonable use cases), please reach out.

Request Format

GET
https://cristella.me/api/land-water/[token]/[latitude],[longitude]

Successful Response: Land location

200 OK
{
  "status": "success",
  "data": {
    "lat": 40.702743,
    "lon": -74.016977,
    "loc": "land"
  }
}

Successful Response: Water location

200 OK
{
  "status": "success",
  "data": {
    "lat": 40.702385,
    "lon": -74.017407,
    "loc": "water"
  }
}

Failure Response: Invalid latitude longitude pair

400 Bad Request
{
  "status": "fail",
  "message": "Invalid latitude longitude pair",
  "data": {
    "lat": 90.01,
    "lon": -74.017407
  }
}

Failure Response: External resource not available

This API relies on the availability of a Google service. In the unlikely event that this service is unavailable, the call will fail and should be retried at a later point in time.

503 Service Unavailable
{
  "status": "fail",
  "message": "External resource not available",
  "data": {
    "lat": 34.052234,
    "lon": -118.243685
  }
}