---
title: "Plan a trip"
method: GET
path: "/trips"
---

# Plan a trip

`GET /trips`

## Request

- Base URL: `https://api.abfahrt.now`
- URL: `https://api.abfahrt.now/trips`
- Auth: one of:
  - API key in header `x-api-key`
  - API key in query parameter `api_key`
- TypeScript: <https://skmtc.dev/abfahrt/apis/abfahrt-european-transit-api/docs/trips/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns trip options between two coordinates. Finds the nearest stops
at origin and destination and queries the transit provider for routes.
Available in countries with routing support (Germany, Austria, France, Switzerland, Belgium, Norway, Finland, Denmark, Sweden, UK, Netherlands, Ireland, Luxembourg).

## Query parameters

- `from_lat` number, double, required
- `from_lon` number, double, required
- `to_lat` number, double, required
- `to_lon` number, double, required
- `alerts` 1

## Response `200`

Successful response with trip options

- TripResponse
  - `region` string, required
  - `trips` Trip[], required
    - `legs` TripLeg[], required
      - `line` string, required
      - `direction` string, required
      - `mode` 'subway' | 'suburban' | 'tram' | 'bus' | 'ferry' | 'regional' | 'express'
      - `from` string, required: Boarding stop name
      - `to` string, required: Alighting stop name
      - `departure` integer, required: Departure time (Unix ms)
      - `arrival` integer, required: Arrival time (Unix ms)
      - `departureDelay` integer, required: Departure delay in minutes
      - `arrivalDelay` integer, required: Arrival delay in minutes
      - `departurePlatform` string
      - `cancelled` boolean, required
      - `stops` integer, required: Number of intermediate stops
      - `stopNames` string[]: Names of the intermediate stops between from and to, in travel order (without from/to themselves). Only present when the upstream provides a stop list.
      - `sameVehicle` boolean: Through-running continuation: this leg is the same physical vehicle as the previous leg, re-signed as a different line (e.g. an evening U3 continuing as U1). Passengers stay seated; such legs are not counted in the trip's changes.
      - `alerts` string[]: Only with alerts=1. Ids of entries in `disruptions` that affect this leg.
    - `departure` integer, required: Trip start time (Unix ms)
    - `arrival` integer, required: Trip end time (Unix ms)
    - `duration` integer, required: Total duration in minutes
    - `changes` integer, required: Number of transfers
  - `attribution` string
  - `disruptions` Disruption[]: Only present with alerts=1. Disruptions referenced by the legs' `alerts` ids.
    - `id` string, required: Stable id, unique within the response
    - `severity` 'info' | 'warning' | 'severe', required
    - `effect` 'cancellation' | 'delay' | 'detour' | 'stop_moved' | 'replacement_service' | 'accessibility' | 'other'
    - `title` string, required
    - `description` string
    - `lines` string[]: Affected line labels, when the source names them
    - `stopNames` string[]
    - `mode` 'subway' | 'suburban' | 'tram' | 'bus' | 'ferry' | 'regional' | 'express'
    - `validFrom` integer: Start of validity, epoch milliseconds
    - `validTo` integer: End of validity, epoch milliseconds
    - `url` string: Link to the operator's notice, when provided
    - `source` string, required: Data source identifier
    - `attribution` string: Licence credit for this disruption; display it alongside the notice

## Other responses

- `400`: Missing or invalid parameters
- `401`: Missing or invalid API key

## Changes

- **2026-10-24** `e91a2a3f0979`: 3 info
  - added the new optional `query` request parameter `alerts`
  - added the optional property `disruptions` to the response with the `200` status
  - added the optional property `trips/items/legs/items/alerts` to the response with the `200` status

[Operation history](https://skmtc.dev/abfahrt/apis/abfahrt-european-transit-api/changes/trips/get.md)

---

[API](https://skmtc.dev/abfahrt/apis/abfahrt-european-transit-api.md) - [All operations](https://skmtc.dev/abfahrt/apis/abfahrt-european-transit-api/llms.txt) - [OpenAPI document](https://skmtc.dev/abfahrt/apis/abfahrt-european-transit-api/revisions/e91a2a3f0979?raw)
