ToiletNearest.com
REST API · v1

Public Toilet API

Query live toilet locations by coordinate. Data sourced from OpenStreetMap via Overpass API, UK government open data, Australia's National Public Toilet Map, and our curated worldwide seed dataset. Free for non-commercial use.

All responses are JSON. The API requires no authentication for the open tier. HTTPS only. Rate limited by IP address to prevent abuse.

Real-time OSM
Live Overpass data
Global coverage
195 countries
No auth needed
Open tier
JSON response
Standard format

Base URL

https://toiletnearest.com

All endpoints are relative to this base URL. All requests must use HTTPS. HTTP requests are redirected to HTTPS automatically.

Endpoint reference

GET/api/toiletsFetch toilets near a coordinate
ParameterTypeRequiredDescription
latnumberYesLatitude in decimal degrees (e.g. 51.505)
lngnumberYesLongitude in decimal degrees (e.g. -0.09)
radiusnumberNoSearch radius in metres (default 2000, max 50000)

Example requests

curl
curl "https://toiletnearest.com/api/toilets?lat=51.505&lng=-0.09&radius=2000"
JavaScript
const res = await fetch(`https://toiletnearest.com/api/toilets?lat=${lat}&lng=${lng}&radius=2000`);
const data = await res.json();
console.log(data.elements); // Array of toilet locations
Python
import requests

res = requests.get(
    "https://toiletnearest.com/api/toilets",
    params={"lat": 51.505, "lng": -0.09, "radius": 2000}
)
data = res.json()
print(f"Found {len(data['elements'])} toilets")

Example response

JSON
{
  "elements": [
    {
      "type": "node",
      "id": 123456789,
      "lat": 51.5007,
      "lon": -0.1246,
      "tags": {
        "amenity": "toilets",
        "name": "Westminster Bridge WC",
        "fee": "no",
        "wheelchair": "yes",
        "opening_hours": "24/7",
        "changing_table": "yes",
        "addr:city": "London",
        "addr:country": "GB"
      }
    }
  ],
  "_osm_count": 48,
  "_seed_count": 0
}

Response fields

FieldTypeDescription
elementsArrayList of toilet objects. Each object contains id, lat, lon, and a tags object.
elements[].idNumberOpenStreetMap node ID. Unique identifier for the facility.
elements[].lat / lonNumberGeographic coordinates of the toilet in decimal degrees.
elements[].tags.amenityStringAlways 'toilets' for toilet nodes.
elements[].tags.nameStringName of the facility if recorded in OSM. May be empty.
elements[].tags.feeString'yes' if there is a charge, 'no' if free. May be absent.
elements[].tags.wheelchairString'yes', 'limited', or 'no'. May be absent.
elements[].tags.opening_hoursStringOSM opening_hours format string. '24/7' for always open.
elements[].tags.changing_tableString'yes' if baby changing facilities are present.
_osm_countNumberCount of results from OpenStreetMap Overpass queries.
_seed_countNumberCount of results from our curated seed dataset (fallback).

Data sources and freshness

API responses draw from a three-layer data pipeline. Understanding which layer served a response helps you assess its accuracy and freshness.

Layer 1 - OSM Overpass API (live)
Freshness: Minutes old

The primary data source. For most coordinates, we query the OpenStreetMap Overpass API in real time and return fresh node, way, and relation data tagged as amenity=toilets. Response time varies by region, typically 300ms–2s.

Layer 2 - Government open data cache
Freshness: Updated daily

For the UK, Australia, Germany, Singapore and several others, we maintain locally cached government datasets that are refreshed daily. These provide higher completeness and verified opening hours compared to OSM alone.

Layer 3 - Curated seed dataset
Freshness: Updated monthly

When OSM and government data return sparse or empty results (common in developing countries), we fall back to our manually curated seed dataset of 300+ high-confidence locations. _seed_count in the response tells you how many results came from this layer.

Rate limits and access tiers

TierRequests / minuteRadius limitAuth requiredCost
Open (no key)102,000 mNoneFree
Developer10010,000 mAPI key headerFree (approval)
Commercial1,000+50,000 mAPI key headerContact us

Rate limit responses return HTTP 429 with a Retry-After header indicating when you may resume. Persistent circumvention of rate limits will result in your IP being blocked. If you are experiencing rate limit issues on the open tier for a legitimate non-commercial project, get in touch and we will work something out.

Attribution requirements

Toilet location data sourced from OpenStreetMap is made available under the Open Database Licence (ODbL). If you integrate its data into a public-facing product, you must display the following attribution:

Attribution must be visible to end users, not buried in a credits page
For UK government data, also attribute: Contains public sector information licensed under the Open Government Licence v3.0
For Australian data, also attribute: Data sourced from the National Public Toilet Map, Australian Government
For mobile apps, the attribution must appear either on the map screen or in an accessible 'About' section

Need higher limits or commercial access?

Commercial usage, white-label integrations, bulk data exports, or bespoke country datasets - get in touch and we'll find the right arrangement. We work with councils, mapping agencies, travel apps, and accessibility platforms.