Skip to content

StopList-Request

Listet alle Haltestellen eines (Teil-)Gebiets oder Verbunds auf.

Endpoint

  • Pfad: XML_STOPLIST_REQUEST
  • Methode: GET

Parameter (Auszug)

ParameterTypBeschreibung
regionstringGebiet/Verbundkennung
formatstringKoordinatenformat
pagenumberSeitennummer (Paginierung)
pageSizenumberSeitengröße

Beispiel-Request

GET /XML_STOPLIST_REQUEST?region=VRR&page=1&pageSize=500&format=WGS84

Antwort (Beispiel)

json
{
  "stops": [ { "id": "de:05513:1001", "name": "Essen Hbf" } ],
  "page": 1,
  "total": 12345
}

JavaScript-Beispiel (Iteration)

js
async function* iterateStops(region) {
  const base = 'https://server:port/virtuellesVerzeichnis/XML_STOPLIST_REQUEST'
  let page = 1
  const pageSize = 1000
  while (true) {
    const usp = new URLSearchParams({ region, page: String(page), pageSize: String(pageSize), format: 'WGS84' })
    const res = await fetch(`${base}?${usp}`)
    const data = await res.json()
    for (const s of data.stops) yield s
    if (data.stops.length < pageSize) break
    page++
  }
}

title: StopList-Request (Alle Haltestellen) outline: deep

StopList-Request

Liefert vollständige Haltestellenlisten für ein Verbundgebiet oder Teilgebiet.

Endpoint

  • Pfad: XML_STOPLIST_REQUEST
  • Methode: GET

Parameter (Auszug)

ParameterTypBeschreibung
areastringGebietskennung (Verbund/Region)
formatstringOptional: Ausgabeformat (z. B. json)
pagenumberPagination: Seite
pageSizenumberPagination: Größe

Beispiel-Request

GET /XML_STOPLIST_REQUEST?area=VRR&page=1&pageSize=1000

Antwort (Beispiel)

json
{
  "stops": [ { "id": "de:05513:1001", "name": "Essen Hbf" } ],
  "nextPage": 2
}

JavaScript-Beispiel

js
async function listStops(area, { page = 1, pageSize = 1000 } = {}) {
  const base = 'https://server:port/virtuellesVerzeichnis/XML_STOPLIST_REQUEST'
  const usp = new URLSearchParams({ area, page: String(page), pageSize: String(pageSize) })
  const res = await fetch(`${base}?${usp}`)
  if (!res.ok) throw new Error('HTTP ' + res.status)
  return res.json()
}