---
title: "Nearest stations to a point (canonical-deduped, boardable)."
method: GET
path: "/v1/nearest"
tags: ["map"]
---

# Nearest stations to a point (canonical-deduped, boardable).

`GET /v1/nearest`

## Request

- Base URL: `https://pt-api.internal.example`
- URL: `https://pt-api.internal.example/v1/nearest`
- Auth: none declared

Nearest served stations to a coordinate, one entry per canonical station cluster, ordered by straight-line distance ascending. Pure served-index lookup (no engine call). Each `id` works verbatim in `/v1/departures`, `/v1/line-times` and as a plan `from=`/`to=` endpoint. Empty result is a 200 with an empty list; bad/missing coordinates are 400.

## Query parameters

- `lat` number
- `lon` number
- `point` string
- `limit` integer
- `max_km` number
- `modes` string
- `served_only` boolean

## Response `200`

Nearest stations.

- NearestResponse
  - `query` object, required
    - `lat` number
    - `lon` number
  - `stops` NearestStop[], required
    - `id` string, required: opaque bare id; works in /v1/departures, /v1/line-times, plan from=/to=
    - `name` string, nullable
    - `lat` number, required
    - `lon` number, required
    - `distance_m` integer, required: straight-line metres
    - `modes` string[]
    - `departures_per_day` integer, nullable
    - `canonical_station_id` string, nullable
    - `country` string, nullable: Dataset tag of the pipeline unit that ships the stop, not an ISO code (e.g. "germany", "flixbus"). Null when unknown. Treat it as provenance; use /v1/geocode for an ISO country.
    - `locality` string, nullable
    - `disambiguator` string, nullable
    - `served` boolean
    - `walk_distance_m` integer, nullable: street-network walk if available, else straight-line estimate
    - `walk_duration_s` integer, nullable
    - `distance_kind` 'walk' | 'straight'

## Other responses

- `400`: RFC 7807 problem.

---

[API](https://skmtc.dev/alltimetables/apis/european-journey-planner-api.md) · [All operations](https://skmtc.dev/alltimetables/apis/european-journey-planner-api/llms.txt) · [OpenAPI document](https://skmtc.dev/alltimetables/apis/european-journey-planner-api/revisions/3216e9384a8b?raw)
