OpenPlaceRulesrobots.txt for the physical world

Developers

The registry is published as static JSON files, rebuilt with the site. There is no key, no sign-up and no query string: every endpoint is a plain GET on GitHub Pages, and browsers can call it from any site (Access-Control-Allow-Origin: *).

Informational only, not legal advice or permission. Entries report what a public source says and are unverified by the owner unless marked owner_verified. An activity that is not listed is unspecified, never allowed. Local law and signs on site come first.

Endpoints (v1)

GETWhat
/api/v1/index.jsonVersion, generated_at, counts, endpoint list, the tile scheme
/api/v1/openapi.jsonOpenAPI 3.1 description of every file and its schema
/api/v1/places.jsonEvery entry as a compact record without geometry (467 now, about 565 KB)
/api/v1/places/{id}.jsonOne full entry, with geometry and zones, e.g. rijksmuseum
/api/v1/countries.json, /api/v1/countries/{cc}.jsonJurisdictions, and every entry in one (lower-case code, e.g. th, eu), including nationwide rules with no map point
/api/v1/near/index.json, /api/v1/near/{lat}/{lng}.json1°×1° tiles for nearby lookups (8130 published tiles)
/api/stats.json, /data/seed.json, /data/places.csvUnversioned files from before v1; they keep working

Near tiles

Chains, operators and the applies_at field (API 1.2.0)

Some entries cover many sites but carry one representative point: a theatre group, a members' club, a gym chain, a court or school system, exam rooms. Their rules apply only at their own sites, not across the city around that point. Every place record now has applies_at: "area" (a venue point, a mapped circle or polygon, or an area-wide law) or "own_sites", and sites: the sites an official page names, each {name, address, lat, lng, address_source} (coordinates are an OpenStreetMap geocode of that address). Most chains have no listed sites yet, so they never match a point. Right now 101 entries are own_sites and 6 of them list sites. GET /api/check and the MCP tool count them only within 1000 m of a listed site ("match": "site") and list the rest under chains_and_operators, which never decides the answer. All fields are additions: existing fields keep their meaning.

Status values

status is one of in_force, in_force_temporary, starts_soon (adopted, not yet in force) or proposed (new in API 1.2.0: the official record shows the rule under consideration, not adopted; 3 entries today). Only in-force entries decide a lookup. Treat any other value as not in force.

curl

# API index: version, build time, counts and the near-tile scheme
curl -s https://openplacerules.org/api/v1/index.json

# One place (full entry with geometry and zones)
curl -s https://openplacerules.org/api/v1/places/rijksmuseum.json

# Everything in one jurisdiction (lower-case code)
curl -s https://openplacerules.org/api/v1/countries/th.json

# The 1x1 degree tile around Amsterdam (lat 52.37, lng 4.89 -> 52/4)
curl -s https://openplacerules.org/api/v1/near/52/4.json

# CORS: GitHub Pages sends Access-Control-Allow-Origin: *
curl -sI https://openplacerules.org/api/v1/places.json | grep -i -E '^(access-control-allow-origin|content-type):'

JavaScript (fetch)

Works in browsers and Node 18+.

// Nearest entries to a point, from the tile and its 8 neighbours.
const BASE = 'https://openplacerules.org/api/v1';
const wrap = (x) => ((x + 180) % 360 + 360) % 360 - 180;

function km(a, b, c, d) {
  const r = Math.PI / 180, x = Math.sin((c - a) * r / 2) ** 2 + Math.cos(a * r) * Math.cos(c * r) * Math.sin((d - b) * r / 2) ** 2;
  return 12742 * Math.asin(Math.sqrt(x));
}

async function nearest(lat, lng, n = 5) {
  const y = Math.floor(lat), x = Math.floor(lng), urls = [];
  for (const dy of [-1, 0, 1]) for (const dx of [-1, 0, 1]) {
    if (y + dy < -90 || y + dy > 89) continue;
    urls.push(`${BASE}/near/${y + dy}/${wrap(x + dx)}.json`);
  }
  // Empty tiles are not published, so a 404 just means "nothing there".
  const tiles = await Promise.all(urls.map((u) => fetch(u).then((r) => (r.ok ? r.json() : null))));
  const byId = new Map();
  for (const t of tiles) if (t) for (const p of t.places) if (p.lat != null) byId.set(p.id, p);
  return [...byId.values()]
    .map((p) => ({ ...p, km: km(lat, lng, p.lat, p.lng) }))
    .sort((a, b) => a.km - b.km)
    .slice(0, n);
}

nearest(52.3600, 4.8852).then((list) => {
  for (const p of list) console.log(p.km.toFixed(1) + ' km', p.name, JSON.stringify(p.rules));
});

Python

# Python 3, standard library only.
import json, math, urllib.error, urllib.request

BASE = "https://openplacerules.org/api/v1"

def get(url):
    try:
        with urllib.request.urlopen(url, timeout=20) as r:
            return json.load(r)
    except urllib.error.HTTPError as e:
        if e.code == 404:  # empty tiles are not published
            return None
        raise

def km(a, b, c, d):
    r = math.pi / 180
    x = math.sin((c - a) * r / 2) ** 2 + math.cos(a * r) * math.cos(c * r) * math.sin((d - b) * r / 2) ** 2
    return 12742 * math.asin(math.sqrt(x))

def nearest(lat, lng, n=5):
    y, x = math.floor(lat), math.floor(lng)
    seen = {}
    for dy in (-1, 0, 1):
        for dx in (-1, 0, 1):
            if not -90 <= y + dy <= 89:
                continue
            tile = get(f"{BASE}/near/{y + dy}/{(x + dx + 180) % 360 - 180}.json")
            for p in (tile or {}).get("places", []):
                if p["lat"] is not None:
                    seen[p["id"]] = p
    return sorted(seen.values(), key=lambda p: km(lat, lng, p["lat"], p["lng"]))[:n]

index = get(f"{BASE}/index.json")
print(index["version"], index["generated_at"], index["stats"])
place = get(f"{BASE}/places/rijksmuseum.json")["place"]
print(place["name"], place["rules"], place["source"]["url"])
for p in nearest(13.7500, 100.4913):  # Bangkok
    print(round(km(13.75, 100.4913, p["lat"], p["lng"]), 1), "km", p["name"], p["rules"])

Sample apps and tools

Embeddable widget

Show one place's rules on any website with <script src="https://openplacerules.org/widget/v1.js" data-place="<id>"></script> (Shadow DOM, only calls this API), or an iframe at /embed/<id>/. Preview and snippets: /widget/.

Owner verification fields

Every place record has owner_verified (boolean), verification ("reported, unverified by owner" or "verified by owner (<method>, <YYYY-MM-DD>)") and owner_verification: null, or {status: "verified"|"lapsed", domain, method: "well-known"|"dns", verified_at, last_checked, lapsed_at, note, rules_from_owner}. A place verifies itself on /verify/: it publishes {"openplacerules": {"id", "token"}} in /.well-known/place-rules.json or a TXT record openplacerules-verify=<id>:<token> at _openplacerules.<domain>, and a daily GitHub Actions check confirms it (SPEC §7.3). A lapsed entry reads as reported again and carries a note.

Licence and attribution

More

Validate a place-rules.json · Spec · JSON Schema · MCP server tools check_place_rules and search_place_rules · llms.txt · Badges