---
title: "Churches near a point, ordered by distance"
method: GET
path: "/churches/nearby"
tags: ["Churches"]
---

# Churches near a point, ordered by distance

`GET /churches/nearby`

## Request

- Base URL: `https://api.holydb.com/v1`
- URL: `https://api.holydb.com/v1/churches/nearby`
- Auth: none declared

Optionally filter to churches with a Mass or Confession on a given day + time slot by passing both `day` and `time`; results are then sorted by closeness to that slot instead of raw distance.

## Query parameters

- `lat` string, required
- `lng` string, required
- `day` string: Day of week, e.g. 'sat' or '6'. Must be paired with `time`.
- `time` string: 24-hour HH:MM. Must be paired with `day`.

## Response `200`

Churches ordered by distance (or slot closeness, when day+time given)

- NearbyChurch[]
  - `id` number, required
  - `name` string, required
  - `parishId` string, required
  - `parishName` string, required
  - `lat` number, required
  - `lng` number, required
  - `distanceKm` number, required
  - `nextMass` Occurrence, nullable, required
    - `day` string, required
    - `time` string, required
    - `notes` string, nullable, required
  - `nextConfession` Occurrence, nullable, required
    - `day` string, required
    - `time` string, required
    - `notes` string, nullable, required

## Other responses

- `400`: Missing or invalid lat/lng

---

[API](https://skmtc.dev/holydb/apis/holydb-api.md) · [All operations](https://skmtc.dev/holydb/apis/holydb-api/llms.txt) · [OpenAPI document](https://skmtc.dev/holydb/apis/holydb-api/revisions/7b5ce0171598?raw)
